0

My emacs configuration seems to be causing a strange issue where the frame font is changed to a non-monospaced font whenever I disable the first theme that was loaded.

Because I run emacs from the command line as a daemon and connect using emacsclient, I have to use an after-make-frame hook to set the font/theme (setting these during daemon start has no effect).

EDIT: I have isolated the code that is causing the problem:

(package-initialize)

(defun set-my-font-for-frame (frame)
  (interactive (list nil))
  (set-frame-font "Monaco for Powerline-12" nil t))

;; This is needed because you can't set the font at daemon start-up.
(add-hook 'after-make-frame-functions 'set-my-font-for-frame)
(add-hook 'after-make-frame-functions (lambda (frame) (load-theme 'solarized-dark t)))

If I run emacs with the above code and then disabled the solarized-dark theme, the frame font is changed.

  • Have you tried changing the order of (add-hook 'after-make-frame-functions 'set-my-font-for-frame) and (add-hook 'after-make-frame-functions (lambda (frame) (load-theme 'solarized-dark t)))? Does that help? – Melioratus Jun 2 '15 at 17:15
  • Never tried that. Not that I doubt it but why would that make a difference? I've never really looked in to how theming works in emacs (is font even considered a theme property?) – imalison Aug 8 '15 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.