8

I've got (set-face-attribute 'default nil :height 100) in my init.el because I find the default font size a little too large. However, it doesn't get executed when emacs is loaded.

I don't have an init.elc file that's not representative updated version of my init.el, and I know the rest of the my init.el is being executed.

There are no other (set-face-attribute ...) sexps after it that could be overwriting it.

Going back in to my init.el after loading emacs and executing it myself sets the property correctly (i.e. for all buffers (but not new frames), persistently)

Squidly
  • 620

2 Answers2

6

After some chopping bits out of my config file, I discovered it was due to (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12")).

The reason I'd discounted it before was because I ran (set-face-attribute 'default nil :height 100) at the very end of my init file.

The solution is to change the sexp that alters default-frame-alist to be (add-to-list 'default-frame-alist '(font . "DejaVu Sans Mono-12") '(height . 100)), and remove the one that alters the face-attribute directly

Squidly
  • 620
1

This is an old thread, but I had the same problem and managed to fix it. I see that you did as well, but wanted to contribute my solution, as I didn't find it anywhere else.

I just added the following line to my ~/.emacs.d/init.el:

(add-hook 'find-file-hook (lambda () (set-face-attribute 'default nil :height 105)))

And it worked. Props to alexis in the comments on OP for the suggestion.