1

I'm new to Emacs. Been a vim user.

Using M-x customize-face, irrespective of what font I set it to, Emacs always ends up using Inconsolata-g for Powerline font. Default is DejaVu Sans Mono. I tried removing .emacs.d directory as well as emacs (package itself), but neither helps.

Here's what I do:

  1. M-x customize-face default
  2. Set it to, say, Ubuntu Mono Regular
  3. Hit Apply and things look good
  4. So I hit State and choose option #1 which stores it to ~/.emacs (for fresh install; I use ~/.emacs/init.el instead - not sure which is better of two)
  5. C-x C-c
  6. Start emacs again and the font is set back to Inconsolata-g for Powerline

How do I get rid of what I'm seeing on step 6 here? I saved ~/.emacs to ~/.emacs.d/init.el and here are its contents:

$ cat .emacs.d/init.el 
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 130 :width normal :foundry "PfEd" :family "Ubuntu Mono Regular")))))
1

This sounds like bug #25228: GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored.

Take a look at that, and see if it doesn't correspond to your scenario.

  • Specifically see if (define-key special-event-map [config-changed-event] 'ignore) helps. debbugs.gnu.org/cgi/bugreport.cgi?bug=25228#152 – npostavs Apr 2 '17 at 15:25
  • I think I was using incorrect font name all the time. Using correct name seems to solve the issue and persists the restarts. Thanks for your help Drew & npostavs – Dharmit Apr 3 '17 at 11:35
  • 2
    Then please do one of two things: (1) delete your question or (2) add the solution you found as an answer, and accept that answer. I'd suggest #1, as I doubt the question and answer will help someone else, but you decide. Thx. – Drew Apr 3 '17 at 23:50
0

Try this:

(setq default-frame-alist '((font . "PragmataPro-13")))

"PragmataPro" is the font name, 13 is the font size, replace them with your own.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.