When I start Emacs with emacs -Q --eval '(set-face-attribute (quote default) nil :height 180)
, the font changes for a split-second, but then returns to its default. Same thing if I put the code in my init file.
If I deliberately cause an error with emacs -Q --eval '(progn (set-face-attribute (quote default) nil :height 180) (bing))
, the change sticks. But this doesn't work if I put the code in my init file—I guess that whatever mechanism Emacs uses to recover from init-file errors doesn't prevent the font-size-revert code from running.
How do I get Emacs to accept my default font size?
I'm running Emacs 25.1.2 (from kelleyk's PPA) on Ubuntu 16.10.
default-frame-alist
orinitial-frame-alist
that will serve to set the default to your liking such that you can forego usingset-face-attribute
? For example, on OSX --with-x my applicable frame parameter is(font . "-Adobe-Courier-normal-normal-normal-*-20-*-*-*-m-110-iso10646-1")
.default-frame-alist
orinitial-frame-alist
?default-frame-alist
and I also pass along additional frame parameters programmatically based on a situation -- e.g.,(make-frame (list '(name . "ZTREE")))
You can have a function that determines your situation and passes the appropriate parameter based thereon. See alsomodify-frame-parameters
andset-frame-parameter
.