2

In my .emacs file, I setup font size like:

(set-default-font "Source Code Pro 10")

If I run emacs as standalone program, i.e. emacs aFile.c, the font size looks correct. But if I run emacs using emacsclient , i.e. like this:

#!/bin/bash
exec /usr/bin/emacsclient --alternate-editor="" -c "$@"

the font size is 13, instead of 10, i specified in 10. Do you have any idea how to fix this?

Thank you.

1 Answer 1

0

Put this in your .emacs file:

(setq default-frame-alist '((font . "Source Code Pro-14")))

Edit

I'm sorry for the missing double quote typo. I've fixed it. It works on my system.

I also tried add-to-list, it won't set the font that @michael desired. Since @michael is using emacsclient, I see no problem in using setq.

Please @michael try and see whether it will work.

2
  • 1
    Normally, add-to-list is used instead of setq so as not to wipe out everything in the default-fame-alist. Your solution wipes it out and places only one-half of the font cons cell in its place. The default-frame-alist is a list of things. And, normally the elements of that list are cons cells -- like this, where the car of the cons cell is font -- e.g., (add-to-list 'default-frame-alist '(font . "-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1")) And, you have only one double quote . . .
    – lawlist
    Dec 29, 2014 at 0:43
  • As to a GUI version of Emacs on OSX with Emacs Trunk (October 2014), the default-frame-alist for the font also fails to catch the initial frame, but it works for subsequent frames. To handle the initial frame, I use: (set-face-attribute 'default (selected-frame) :font "-*-Courier-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1"). I haven't tested this with emacsclient.
    – lawlist
    Dec 29, 2014 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .