Typically I start emacs with the GUI, and start a server right away with (server-start)
. Now I can easily open documents into my existing emacs session from terminal via emacsclient -n <file>
, or from the File Browser.
From time to time, however, I want to run emacs inside my terminal using emacsclient -t
. This happens most often when writing git commit logs or performing other very small tasks. In those instances, the fact that my init file was loaded in a GUI instance of emacs means that I don't get any of my customizations that are specific to TTY emacs.
I know that I can run
emacs -nw -q -l "some-custom-init-file.el"
but that will reload all of the packages every time. Can I have the best of both worlds? Is there a way to set up a "TTY daemon" so that I can use separate customizations for running inside the terminal versus visiting the file in an existing emacs window?
(setq linum-format "%d ")
in the TTY customization file. Also, my color theme always looks strange in TTY mode, so I will definitely choose a different theme for the TTY. I actually don't have that many differences at the moment, but now that I know that I can have different servers, the list may grow.M-x report-emacs-bug
and request new features such as the ability to have different face themes in TTY and in GUI frames (actually, a theme can specify completely different colors for those different kinds of frames, so you could also adjust your theme). Using several daemons for those separate cases is just a workaround for a lack of corresponding functionality in Emacs.