Emacs: GUI with emacs --daemon not loading fonts correctly
I set up an emacs --daemon
in order to startup emacs 开发者_Go百科faster. I like especially the GUI version of emacs, so I do emacsclient -c
to open a new emacs frame.
The problem is that I have changed my fonts, but these fonts aren't loaded if I start emacsclient -c
. However, they are applied if I start just emacs
(but this causes the whole .emacs
to be evaluated).
So: Is there a way of applying my font settings also if I start emacs with emacsclient -c
?
In short, you have to use default-frame-alist
for that. Like this:
(setq default-frame-alist '((font . "Inconsolata-dz-15")))
This will be evaluated every time you start a new, graphical frame in Emacs. This is also where you save other frame-related settings, like settings for your fringe
and such.
The following will probably do what you are looking for.
(add-to-list 'default-frame-alist '(font . "Inconsolata-12"))
If you're using Emacs 23.2 changing the monospaced font in GNOME will change the Emacs font as well. In earlier edition you'll have to do this:
echo "Emacs.font: Monospace-10" >> ~/.Xresources
xrdb
Replace Monospace-10 with the actual font you want to use.
emacslient
has an option -F
(--frame-parameters
) that lets you specify the font of a newly-created frame
Example:
emacsclient -c -F '((font . "8x16"))' some_file
精彩评论