1

I have been looking on the web to the existing answers to this question, but non of them works for me.

I would like to change the default font size for all frames in Aquamacs 3.3 GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109)), and I am on OS X 10.11.2. I have tried to insert

(set-default-font “Terminus-9”)

in the .emacs file, but it does not work. Do you guys know how to do this?

Here is what I get if I follow the suggestion by lawlist below, i.e., put (add-to-list 'default-frame-alist '(font . "Terminus-9")) in the .emacs file, save the .emacs file and restart Aquamacs. Then, switch to the Messages buffer and type: M-x eval-expression RET (message "%s" (frame-parameters)) RET:

    16 environment variables imported from login shell (/bin/bash).
   [..]
 ((tool-bar-position . top) (parent-id) (explicit-name) (display . MacBook-Pro.local) (icon-name) (window-id . 1) (bottom-divider-width . 0) (right-divider-width . 0) (top . 23) (left . 0) (buried-buffer-list) (buffer-list *Messages*  *Minibuf-1* *scratch*) (unsplittable) (minibuffer . #<window 4 on  *Minibuf-0*>) (width . 201) (height . 48) (name .  *Minibuf-1*) (modeline . t) (fringe) (border-color . white) (mouse-color . white) (environment) (visibility . t) (cursor-color . black) (background-mode . light) (display-type . color) (window-system . ns) (fullscreen . maximized) (alpha) (scroll-bar-height . 0) (scroll-bar-width . 15) (cursor-type . box) (auto-lower) (auto-raise) (icon-type) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (right-fringe . 11) (left-fringe . 3) (line-spacing) (background-color . #ffffff) (foreground-color . #000000) (horizontal-scroll-bars) (vertical-scroll-bars . right) (internal-border-width . 0) (border-width . 0) (font . -*-Monaco-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1) (fontsize . 0) (font-backend mac-ct))
    "((tool-bar-position . top) (parent-id) (explicit-name) (display . MacBook-Pro.local) (icon-name) (window-id . 1) (bottom-divider-width . 0) (right-divider-width . 0) (top . 23) (left . 0) (buried-buffer-list) (buffer-list *Messages*  *Minibuf-1* *scratch*) (unsplittable) (minibuffer . #<window 4 on  *Minibuf-0*>) (width . 201) (height . 48) (name .  *Minibuf-1*) (modeline . t) (fringe) (border-color . white) (mouse-color . white) (environment) (visibility . t) (cursor-color . black) (background-mode . light) (display-type . color) (window-system . ns) (fullscreen . maximized) (alpha) (scroll-bar-height . 0) (scroll-bar-width . 15) (cursor-type . box) (auto-lower) (auto-raise) (icon-type) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (right-fringe . 11) (left-fringe . 3) (line-spacing) (background-color . #ffffff) (foreground-color . #000000) (horizontal-scroll-bars) (vertical-scroll-bars . right) (internal-border-width . 0) (border-width . 0) (font . -*-Monaco-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1) (fontsize . 0) (font-backend mac-ct))"
    You can run the command ‘eval-expression’ with ⌥:
    "((tool-bar-position . top) (parent-id) (explicit-name) (display . MacBook-Pro.local) (icon-name) (window-id . 1) (bottom-divider-width . 0) (right-divider-width . 0) (top . 23) (left . 0) (buried-buffer-list) (buffer-list *Messages*  *Minibuf-1* *scratch*) (unsplittable) (minibuffer . #<window 4 on  *Minibuf-0*>) (width . 201) (height . 48) (name .  *Minibuf-1*) (modeline . t) (fringe) (border-color . white) (mouse-color . white) (environment) (visibility . t) (cursor-color . black) (background-mode . light) (display-type . color) (window-system . ns) (fullscreen . maximized) (alpha) (scroll-bar-height . 0) (scroll-bar-width . 15) (cursor-type . box) (auto-lower) (auto-raise) (icon-type) (title) (buffer-predicate) (tool-bar-lines . 1) (menu-bar-lines . 1) (right-fringe . 11) (left-fringe . 3) (line-spacing) (background-color . #ffffff) (foreground-color . #000000) (horizontal-scroll-bars) (vertical-scroll-bars . right) (internal-border-width . 0) (border-width . 0) (font . -*-Monaco-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1) (fontsize . 0) (font-backend mac-ct))"
    Making completion list... [2 times]
    You can run the command ‘make-frame’ with s-N

The suggestion does not work, and I have the same font as before.

  • Here is a link to the manual that describes how to do this in the vanilla generic Emacs. Perhaps it works the same in Aquamacs: gnu.org/software/emacs/manual/html_node/emacs/… – lawlist Oct 3 '18 at 14:35
  • @lawlist: Please consider posting the relevant info as an answer (it is the answer, IMO). Adding the link to the manual is an additional help. – Drew Oct 3 '18 at 14:57
  • @ lawlist I tried to include in the init file the three lines suggested in your link, it does not work. – James Oct 3 '18 at 16:32
  • Try putting this in your .emacs file: (add-to-list 'default-frame-alist '(font . "Terminus-9")). Then, save the .emacs file and restart Aquamacs. Then, switch to the *Messages* buffer and type: M-x eval-expression RET (message "%s" (frame-parameters)) RET and see if it shows the font parameter as being set to Terminus-9. Then, type M-x make-frame and from within that new frame repeat the same steps as above to see what the font parameter is for that new frame. Then, report back here by editing your question or with a new comment to let us know the results. – lawlist Oct 3 '18 at 17:34
  • @lawlist done it, see my revised answer. – James Oct 4 '18 at 20:35
0

Personally, I want all Menlo all the time. I achieve this in Aquamacs with:

(when window-system
  (setq initial-frame-alist nil)   ;; Undo Aquamacs forced defaults
  (setq default-frame-alist nil)   ;; Undo Aquamacs forced defaults
  (aquamacs-autoface-mode -1)      ;; Use one face (font) everywhere
  (set-frame-font "Menlo-12")      ;; Set the default font to Menlo size 12
  ;;(set-default-font "Menlo-12")  ;; This would do the same.
)

Aquamacs sets some hard defaults that need to be undone before you can be successful changing faces. Setting initial-frame-alist and default-frame-alist to nil, also eliminate problems with themes, à la

(when window-system
  (setq initial-frame-alist nil)
  (setq default-frame-alist nil)
  (when (featurep 'aquamacs)
    (load-theme 'sanityinc-tomorrow-bright t))
  [...]
)

If you're still having font/face/theme issues, ensure that you don't have settings in a custom.el file, or in ~/Library/Preferences/Aquamacs Emacs/Preferences.el file, that could be conflicting with your init.el.

  • Thank you. What should I change in those lines to alter the size of the font? – James Oct 15 '18 at 21:31
  • @James the "12" represents the pixel size of the font. In your case I'd try doing (set-frame-font "Terminus-9") before messing with fontspecs. – nega Oct 17 '18 at 16:22
  • Ok, I included (aquamacs-autoface-mode -1) and ` (set-frame-font "Terminus-9")` in .emacs, and get the error message Warning (initialization): An error occurred while loading ‘/Users/mcastellana/.emacs’:error: Font not available, #<font-spec nil nil Terminus-12 nil nil nil nil nil nil nil nil nil ((:name . Terminus-12) (:user-spec . Terminus-12))> [...] when emacs starts, and the font has not changed. – James Oct 18 '18 at 13:43
  • Do you have Terminus-9 installed? Do you have Terminus-12 installed? macOS doesn't come with a Terminus font. – nega Oct 18 '18 at 14:55
  • To get around this, I opened a document and found the font of the text with Alt + X + describe-char. I obtained -*-Monaco-normal-normal-normal-*-12-*-*-*-m-0-iso10646-1 (#x5B)'. Thus added (set-frame-font "Monaco-12")` in .emacs and replaced 12 with various sizes. There is no error message when I open emacs, but the font does not change. – James Oct 22 '18 at 20:46

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.