setting FG and BG colors

topic posted Wed, May 26, 2004 - 8:05 AM by  Stephen
I installed RH9 recently and can't seem to switch emacs to white on black. I tried to do it through the menus, but only managed to switch the menus and not the main text. I used to just add a few lines to .Xdefaults, but that didn't seem to work for me this time. I know its probably simple but can someone tell me how?

Thanks.
posted by:
Stephen
  • Re: setting FG and BG colors

    Sat, May 29, 2004 - 11:47 AM
    In my xemacs customization (I suspect something similar should work for vanilla emacs) I find :

    (custom-set-faces
    '(default ((t (:foreground "#000000" :background "#ffffcc" :size "18pt" :family "Lucidatypewriter"))) t))

    Which changes the default foreground/background and sets the font and size.

    Now exactly what all the pieces are and how they fit together :)

    And I well remember that it took rather a while to find it.
    • Re: setting FG and BG colors

      Sat, May 29, 2004 - 1:56 PM
      its strange. if i make a .emacs file with that in it, and switch the colors so that its white on black, emacs comes up, switches to a black background for a fraction of a second, and then switches back to a white background. without the .emacs file, it doesnt do the switch back and forth - its just white from the beginning. erg.
    • Re: setting FG and BG colors

      Sun, May 30, 2004 - 6:35 AM
      i even tried setting it from the command line like "emacs -fg white -bg black" and even that doesn't work. it looks like emacs is one of the many things in RH9 thats just plain broke or sucky. maybe i should finally switch to vi. (or install emacs 19)
      • Re: setting FG and BG colors

        Sun, May 30, 2004 - 12:52 PM
        I tried the custom-set-faces in both an emacs and xemacs initialization file and it did the right thing (changed the colors to the specified colors, same for the font) in both cases.

        emacs version : 21.3.2

        xemacs version : 21.4.15

        Is it possible that you're loading in a mode that wants to override the defaults?
  • Re: setting FG and BG colors

    Mon, May 31, 2004 - 12:12 PM
    This is how I do it:

    (setq default-frame-alist
    '((background-color . "black")
    (foreground-color . "white")))
    • Re: setting FG and BG colors

      Mon, May 31, 2004 - 12:52 PM
      nope. did the same thing. it flashes for a tiny fraction of a second to black background, but then back to white. i have no idea what's going on. maybe redhat just screwed something up?

      really, what I want is emacs 19. i don't really like the new emacs. but emacs 19 won't compile on RH9 it seems. i get some parse error in lib-src/movemail.c. and i can't seem to find an rpm or linux binary anywhere for emacs 19...
      • Re: setting FG and BG colors

        Mon, May 31, 2004 - 2:54 PM
        I can't think of anything in RH9 that would do what you're describing, and I use emacs there all the time.

        Have you tried starting emacs with -q in addition to the -fg and -bg parameters? Do you have any *reverseVideo settings in your X resources?

        Another thing to try is to add
        (setq initial-frame-alist default-frame-alist)
        after setting default-frame-alist in your .emacs.

Recent topics in "Emacs"

Topic Author Replies Last Post
eMergency eLisp 0 January 25, 2008
pretty quiet 0 September 14, 2007
Emacs 22 released Theron Ttlåx 0 June 5, 2007
ViewMail with smtpmail? offlinealex 0 November 29, 2006