4

I had set up a emacs --daemon at the OS startup and whenever I try to open emacsclient -n -c emacs opens a small window (possibly the minimum size possible) and with unreadable fonts (they are too small). A following picture shows the emacs window in perspective when opened with emacsclient -n -c

Small emacs window with small fonts

However, if I try to open an emacs frame on the default OS terminal (emacsclient -t) it works perfectly:

Emacs frame on a terminal

Whats wrong with emacs? I use Prelude and I have a .Xdefaults file containing Emacs.font: Ubuntu-10 that specify which font to use, but that doesn't seem to work.

  • Is it any different from how Emacs looks when you run it graphically without a daemon? – DoMiNeLa10 Sep 28 '17 at 21:44
  • Yes, totally normal – Rafael Campos Nunes Sep 28 '17 at 21:45
  • Can you reproduce this if you start Emacs with emacs --daemon -q? If not, post your init file. – Gilles 'SO- stop being evil' Jan 12 '18 at 20:38
  • @Gilles it can’t be reproduced with emacs --daemon -q. Something in my init file maybe? I’m using prelude fwiw, and the init file is entirely made of prelude code. – Rafael Campos Nunes Jan 24 '18 at 13:54
3

I've gotten this too. I think it's because when emacs is started in daemon mode, window-system is nil while reading your .emacs. You're probably setting up your default-frame-alist with something like (if window-system (...)) which won't work in daemon mode. Do it in a hook on after-make-frame-functions instead; that hook function takes the new frame as an arg.

0

I had the same problem, and it was because I was setting the font in my init file using

(set-frame-font FONT nil t)

which is closely related to GaryO's answer. Using

(setq default-frame-alist '((font . FONT))`

solved it for me.

  • set-frame-font indeed only applies to existing frames (as documented in the docstring). – Stefan Jun 5 at 19:14

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.