help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

properly setting up ~/.emacs.d for daemon usage


From: Filipe Silva
Subject: properly setting up ~/.emacs.d for daemon usage
Date: Sun, 11 Dec 2016 11:10:12 -0200

Dear users and developers of the mighty emacs editor,

I'm deeply in love with the --deamon feature, but I'm encountering a
scenario that I'm having a hard time to solve.

When I start emacs with emacs --daemon, emacs does not know if I wan't to
run emacs as a GUI or inside a terminal,
therefore all the checks inside my ~/.emacs.d init code which use
(display-graphic-p) will not work,
e.g. emacs will think that I have no gui because display-graphic-p will
return nil.

likewise, using (daemon-p) while my `~/.emacs.d/` config is loading up will
not work
because emacs has not loaded yet: the daemon boostrap procedure is not
complete so (daemon-p) dutifully returns nil.

The end result is: if I later try to connect to said daemon using
emacsclient pulling up a gui-frame, all the colors are off because emacs
thought that I had no gui.

Seems that the solution for that would be to put a hook somewhere that
would activate when an emacs frame is created. In this hook, I'd have to
put all my initialization code that is gui-dependent.

Make sense? How would an emacs user properly setup his ~/.emacs.d/ so that
it plays well with the daemon feature?

thanks in advance,

Ninrod


reply via email to

[Prev in Thread] Current Thread [Next in Thread]