GNU bug report logs - #33934
26.1; server.el/emacsclient mismatch regarding socket...

Previous Next

Package: emacs;

Reported by: kris <cq.personal <at> gmail.com>

Date: Mon, 31 Dec 2018 02:57:02 UTC

Severity: minor

Found in version 26.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33934 in the body.
You can then email your comments to 33934 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33934; Package emacs. (Mon, 31 Dec 2018 02:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to kris <cq.personal <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 31 Dec 2018 02:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: kris <cq.personal <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; server.el/emacsclient mismatch regarding socket...
Date: Mon, 31 Dec 2018 03:02:22 +0100
emacsclient has the -s option for specifying a UNIX socket directory
(emacslient -h says filename but it is a directory in the code - the bug
report!).
but server.el uses defvar to set server-socket-dir and there appears no
way to override it.

I changed defvar to defcustom to continue.
this is useful for my use case of running separate emacs
processes per project directory in order to do file change monitoring
with emacsclient -e signalling the correct session.

emacs forever!




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33934; Package emacs. (Mon, 31 Dec 2018 05:26:02 GMT) Full text and rfc822 format available.

Message #8 received at 33934 <at> debbugs.gnu.org (full text, mbox):

From: Phil Sainty <psainty <at> orcon.net.nz>
To: kris <cq.personal <at> gmail.com>, 33934 <at> debbugs.gnu.org
Subject: Re: bug#33934: 26.1; server.el/emacsclient mismatch regarding
 socket...
Date: Mon, 31 Dec 2018 18:25:13 +1300
On 31/12/18 3:02 PM, kris wrote:
> emacsclient has the -s option for specifying a UNIX socket directory
> but server.el uses defvar to set server-socket-dir and there appears no
> way to override it.

You can override it just as easily as with any defvar:

(require 'server)
(setq server-socket-dir "/path/to/dir")
(setq server-name "myserver")
(server-start)

$ emacsclient -c -s /path/to/dir/myserver


You can also use:

$ emacs --daemon=myserver

To start a server with 'server-name' set to 'myserver'; and then:

$ emacsclient -c -s myserver





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33934; Package emacs. (Mon, 31 Dec 2018 15:00:02 GMT) Full text and rfc822 format available.

Message #11 received at 33934 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kris <cq.personal <at> gmail.com>
Cc: 33934 <at> debbugs.gnu.org
Subject: Re: bug#33934: 26.1;
 server.el/emacsclient mismatch regarding socket...
Date: Mon, 31 Dec 2018 16:59:21 +0200
> From: kris <cq.personal <at> gmail.com>
> Date: Mon, 31 Dec 2018 03:02:22 +0100
> 
> emacsclient has the -s option for specifying a UNIX socket directory
> (emacslient -h says filename but it is a directory in the code - the bug
> report!).
> but server.el uses defvar to set server-socket-dir and there appears no
> way to override it.
> 
> I changed defvar to defcustom to continue.
> this is useful for my use case of running separate emacs
> processes per project directory in order to do file change monitoring
> with emacsclient -e signalling the correct session.

Can you explain how you arrived at the conclusion that -s names the
directory of the socket file?

My reading of the code is that it's indeed the name of the socket
file, either with or without the leading directories.  In the former
case, the file is placed under a user-specific subdirectory of
$TMPDIR; in the latter case, the file is placed where the leading
directories specify.  And the user option server-name in Emacs, which
_is_ a defcustom, causes the server to do the same, depending on
whether server-name includes leading directories.

So it sounds to me like you could use a different server-name and
argument to -s for each project, and get what you want without any
changes, without ever needing to modify socket-dir.  If I'm missing
something, please point out what did I miss.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33934; Package emacs. (Mon, 31 Dec 2018 15:06:01 GMT) Full text and rfc822 format available.

Message #14 received at 33934 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: cq.personal <at> gmail.com, 33934 <at> debbugs.gnu.org
Subject: Re: bug#33934: 26.1;
 server.el/emacsclient mismatch regarding socket...
Date: Mon, 31 Dec 2018 17:05:37 +0200
> From: Phil Sainty <psainty <at> orcon.net.nz>
> Date: Mon, 31 Dec 2018 18:25:13 +1300
> 
> (setq server-socket-dir "/path/to/dir")
> (setq server-name "myserver")

You could simply customize server-name to an absolute file name.
server.el runs that through expand-file-name with server-socket-dir as
the default directory, which will leave an absolute file name
unchanged regardless of what server-socket-dir says.  I guess we
should improve the documentation about that.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 04 Jan 2019 13:59:03 GMT) Full text and rfc822 format available.

Notification sent to kris <cq.personal <at> gmail.com>:
bug acknowledged by developer. (Fri, 04 Jan 2019 13:59:04 GMT) Full text and rfc822 format available.

Message #19 received at 33934-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kris <cq.personal <at> gmail.com>
Cc: 33934-done <at> debbugs.gnu.org
Subject: Re: bug#33934: 26.1;
 server.el/emacsclient mismatch regarding socket...
Date: Fri, 04 Jan 2019 15:58:37 +0200
> From: kris <cq.personal <at> gmail.com>
> Date: Tue, 1 Jan 2019 12:18:53 +0100
> 
> Indeed I fall corrected.
> The docs could be clearer but otherwise I'm wasting bandwidth.

Thanks, I pushed a change to improve the documentation, and I'm
marking this bug done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Feb 2019 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 77 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.