How to tell KDE to store command line options on session save?

1

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?

viam0Zah

Posted 2009-08-25T06:47:51.270

Reputation: 1 909

Answers

0

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:

#!/bin/sh
emacsclient -e '(kill-emacs)' # try a graceful kill first
pkill emacs
rm -f /tmp/emacs`id -u`/server
emacs --daemon

Ryan C. Thompson

Posted 2009-08-25T06:47:51.270

Reputation: 10 085

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. – viam0Zah – 2009-09-03T14:22:05.873