How can I make emacsclient simply open a window for an existing emacs daemon without opening a new file

I use the emacs daemon to save an emacs session, even if I need to restart the computer on which I am running my X server, or if I want to access the same session from another computer. This works very well, but when restoring a session I would really like to just run "emacsclient --create-frame --no-wait" to connect to the daemon without opening a new file. This will not allow me to leave without specifying a file name.

I tried using --eval to execute the function, not to open the file, but the window just disappears when the evaluation is complete.

(Emacs 23.1 via backports in Debian GNU / Linux 5.0.)

+7
emacs emacsclient
source share
4 answers

From the help provided by emacsclient, you have several options. Firstly, it is already mentioned, which is equal to emacsclient -c . This will try to create a frame associated with the emacs daemon. The advantage of this is that if DISPLAY is not installed, then it will open emacs in the terminal.

This leads us to the next best option (especially if you are logging in remotely): emacsclient -t , which causes emacs to open in terminal mode, even if DISPLAY is installed.

Also keep in mind that you can also set the display from the command line. I often use this when logging into VNC remotely. Full command: emacsclient -d DISPLAY -c

+11
source share

emacsclient -c works for me.

+5
source share

emacsclient -n -e "(make-frame)"

The -n flag means emacsclient not waiting, and the emacs instance does not destroy the frame.

+2
source share

If you use emacs from the command line, you can also consider emacsclient -t

+2
source share

All Articles