[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The emacsclient socket vs. etc/emacs.bash

From: Romain Francoise
Subject: The emacsclient socket vs. etc/emacs.bash
Date: Fri, 08 Dec 2006 14:15:57 +0100

I received a bug report stating that newer CVS versions of Emacs no
longer delete their server socket on exit, which causes problems for
users of the `edit' function provided by etc/emacs.bash:

| function edit ()
| {
| [...]
|     # Do not just test if these files are sockets.  On some systems
|     # ordinary files or fifos are used instead.  Just see if they exist.
|     if [ -e "${HOME}/.emacs_server" -o -e "/tmp/emacs${UID}/server" ]; then
|        emacsclient "$@"
|        return $?
|     else
|        echo "edit: starting emacs in background..." 1>&2
|     fi

This function checks for the existence of the socket to decide whether
to call emacsclient or start a new Emacs instance.  Since the socket
remains behind after Emacs exits, it decides to call emacsclient, which
fails (since the latter cannot start a new Emacs itself, yet).

If I understand the recent changes to server.el correctly, Emacs
shouldn't delete the socket on exit, because it might be a socket
started by another Emacs instance and not the original socket.
In that case, isn't it possible to check for the liveness of the socket,
and delete it if it's dead?

(Or perhaps emacs.bash should just do emacsclient -a emacs ...)


Romain Francoise <address@hidden> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
                                        | ever free! --Bryan W. Procter

reply via email to

[Prev in Thread] Current Thread [Next in Thread]