Subject: bug#33219: 25.2; crontab -e doesn't connect to existing emacs daemon

From: Glenn Morris <[email-masked]>
Date: Thu, 01 Nov 2018 12:25:32 -0400

Boruch Baum wrote:

> When running 'crontab -e' with $EDITOR set to
>
>   emacsclient -nw -c --alternate-editor=""

I'm never sure whether EDITOR allows program name plus arguments,
separated by whitespace.,,

> emacsclient issues an error that it had failed to locate the emacs
> daemon socket file, so it spawns a new emacs daemon. On this
> distribution (Devuan Ascii/Ceres, a derviative of Debian 9 without
> systemd), the socket file is located at:
>
>   /tmp/user/${UID}/emacs${UID}/server

emacsclient looks in TMPDIR/emacs${UID}/server, or /tmp if TMPDIR is unset.
Is TMPDIR set to /tmp/user/${UID} ?
Otherwise I would not expect this to work.

> However, in other uses of emacsclient via $EDITOR (eg. mutt, newbeuter,
> w3m) the client does find the socket file and does connect to the
> existing daemon.

Then I'm confused as to how this is supposed to be an Emacs issue.

> A work-around has been to define:
>
>   export EDITOR="$HOME/.local/bin/emacsclient_wrapper"

Future emacsclient will respect the EMACS_SOCKET_NAME environment variable;
ref http://lists.gnu.org/r/emacs-diffs/2018-10/msg00191.html