Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs/OSX Default font setting does not persist

I'm using Emacs 23.2. When I change the default font using Options --> Set Default Font... it correctly switches to the font that I select. I then do Options --> Save Options to make it permanent.

It writes a stanza to the end of my .emacs, but it's empty, doesn't contain anything about the font. Also, in the minibuffer it says "Loading battery...done" which seems a bit weird. And when I restart Emacs, the font is back to the default, which is Monaco. Similarly, changing the font size does not persist, but other (non-font-related) customizations do persist.

Anyone seen this? Anyone know how to make the font setting permanent?

like image 830
Neil Baylis Avatar asked Jan 27 '11 21:01

Neil Baylis


2 Answers

Try M-x customize-face RET default, adjust to your liking, then 'Save for future sessions'.

Edit: For example, that adds the following stanza to my (custom-set-faces) in .emacs:

(custom-set-faces
  '(default ((t (:inherit nil :stipple nil :background "White" :foreground "Black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :family "Consolas"))))
  ...

If all you want to so is set the font size & family (13pt Consolas in this example), this appears to be sufficient:

  '(default ((t (:height 130 :family "Consolas"))))
like image 61
bosmacs Avatar answered Oct 10 '22 14:10

bosmacs


Only way I got it to work was to modify manually the .emacs file:

(custom-set-faces                                                                                    
 '(default ((t (:height 150 :family "Menlo"))))
 )

PS: I'm on Yosemite

like image 20
magicrebirth Avatar answered Oct 10 '22 12:10

magicrebirth