Berkeley CSUA MOTD:Entry 24906
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

2002/5/21-22 [Computer/SW/Editors/Emacs] UID:24906 Activity:high
5/21    How do I set the default font in emacs 21's Global-Font-Lock-Mode?
        I can set the default face, and I can set the "special" features
        of GFLM (strings, function names, et al), but every time I enter
        GFLM (Java mode) I lose my default face to regular black text on
        white background.  Specifically, I'd like a black background under
        white text.  Thanks.
        \_ Try either:
           (setq default-frame-alist
                 (append default-frame-alist
                         '((foreground-color       .       "white")
                           (background-color       .       "black"))))
           or:
           (set-foreground-color "WHITE")
           (set-background-color "BLACK")
           I forget which one is the one you'll need.
           \_ Tried both of these.  When I first enter emacs, it starts
              off white on black (as I prefer), but when it enters GFLM
              with syntaxt highlighting, it reverses to black on white.
              Is there a way I can set the GFLM to use white on black?
              \_ Something else in your .emacs is setting the colors back
                 then.  Which mode are you in?
        \_ Can you start emacs with "emacs -r"?  -- yuen
           \_ Nope, doesn't seem to change anything.
              \_ It works for me in Emacs20 under both Solaris and NT.  Guess
                 it's different for 21.  -- yuen
        \_ Here's the relevant part from my .emacs:
           (custom-set-variables
            '(fill-column 79)
            '(default-frame-alist '((foreground-color . "white")
                                    (background-color . "black")
                                    (cursor-color . "gold")
                                    (height . 45)
                                    (width . 86)))
           )
        \_ I stick that stuff in my .Xdefaults
             emacs*Background: Black
             emacs*Foreground: White