开发者

emacs23 on windows: set-face-foreground seems to get forgotten during load of emacs.el

开发者 https://www.devze.com 2023-01-25 13:10 出处:网络
Just got a new Windows laptop, installing emacs23 on it. My previous computers have used emacs 22 for I-don\'t-know-how-long.

Just got a new Windows laptop, installing emacs23 on it.

My previous computers have used emacs 22 for I-don't-know-how-long.

I have a longish emacs.el, which loads various side elisp libraries. I had everything set up just so, in emacs 22.

I brought this emacs.el over to the new pc, along with all the other elisp modules. Started emacs, and everything looks good. There's just one weird issue.

Near the top of the emacs.el, I do:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; basic, default colors

(set-face-foreground 'default "white")
(set-face-background 'default "black")

This makes the background black, and the foreground white (white-on-black). This is the opposite of what a default install of emacs on Windows will do.

While the rest of emacs.el is loading, I can see that these colors are in effect. It's just a blank Window, not even the scratch buffer is displayed. All I See is the message at the bottom of the window updating me on the progress of the load. (For some reason loading is much slower - I think I have some uncompiled .el libraries - I'll have to investigate that separately). Even so, it is a black window. (Without those statements in emacs.el, th开发者_开发知识库e window remains white.) Anyway, everything loads, then the screen reverts to black-on-white, rather than white-on-black.

The weird part is all the other fonts I've set, seem to "stick". Fonts like comment fonts, string fonts, function-names and so on in cc-mode... these all remain. Only the default foreground and background fonts don't "stick".

I guessed that maybe something in the stack of elisp modules was maybe resetting these fonts. So I duplicated those two statements (from above) at the very end of the emacs.el file. Still, though, the fonts get reverted.

If I then eval those statements in the scratch buffer after everything has loaded, then the fonts look as I expect - white-on-black.

Is there something different about how emacs23 does default fonts?

Why does it revert?

Why can I not get these settings to "stick" when evaluated from emacs.el?

Thanks for any help y'all can offer.


Found it. I also had in the emacs.el, this code:

(setq default-frame-alist
  '((top . 10) (left . 860)
    (width . 100) (height . 28)
    (cursor-color . "Blue")
    (cursor-type . box)
    (foreground-color . "White")
    (background-color . "Black")
    (mouse-color . "sienna3")
    (font . "-*-Lucida Console-normal-r-*-*-11-82-96-96-c-*-iso8859-1")
    )
  )

... which contradicted the set-face-foreground thing.

So I commented out the lines for foreground-color and background-color there, and it started up the way I like.

0

精彩评论

暂无评论...
验证码 换一张
取 消