On Wed, May 20, 2009 at 3:24 PM, Jean Magnan de Bornier wrote: > Jean Magnan de Bornier wrote : > [snip] > > Well I ended writing a zsh script (lauched in .xsession) to check if an > emacs server is running, and lauching the server only if there isn't any. > bye, > -- I do something similar (but using bash). I have a script that is *not* intended to be launched in some init-file. Instead, the user invokes the script when he wants to use emacs. The script starts the emacs-daemon if not already started, and then invokes the client. I am not completely sure it covers all your requirements, but it works very well for me. See http://hugoheden.wordpress.com/2009/03/21/invoking-emacs-daemon-and-client-easily/ > > Jean >