Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Emacs in daemon mode under KDE, that is, I have emacs --daemon running. Everything works fine. If I tell KDE to save session on logout, and restore that saved session on next login, it forgets about the --deamon command line option, and brings up a standalone Emacs instance. Is there a way to restore the command line option, too?

share|improve this question
up vote 0 down vote accepted

If I recall correctly, there is a way to tell KDE not to save certain applications. You should add emacs to KDE's "don't save" list, and then add "emacs --daemon" to your startup programs.

Otherwise, you could always add something like this to your startup programs:

emacsclient -e '(kill-emacs)' # try a graceful kill first
pkill emacs
rm -f /tmp/emacs`id -u`/server
emacs --daemon
share|improve this answer
Thanks. Finally, I came out with a similar solution, but I thought there is a standard way without the need of a separate shell script. – Török Gábor Sep 3 '09 at 14:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.