unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33934: 26.1; server.el/emacsclient mismatch regarding socket...
@ 2018-12-31  2:02 kris
  2018-12-31  5:25 ` Phil Sainty
  2018-12-31 14:59 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: kris @ 2018-12-31  2:02 UTC (permalink / raw)
  To: 33934

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!





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#33934: 26.1; server.el/emacsclient mismatch regarding socket...
  2018-12-31  2:02 bug#33934: 26.1; server.el/emacsclient mismatch regarding socket kris
@ 2018-12-31  5:25 ` Phil Sainty
  2018-12-31 15:05   ` Eli Zaretskii
  2018-12-31 14:59 ` Eli Zaretskii
  1 sibling, 1 reply; 5+ messages in thread
From: Phil Sainty @ 2018-12-31  5:25 UTC (permalink / raw)
  To: kris, 33934

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






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#33934: 26.1; server.el/emacsclient mismatch regarding socket...
  2018-12-31  2:02 bug#33934: 26.1; server.el/emacsclient mismatch regarding socket kris
  2018-12-31  5:25 ` Phil Sainty
@ 2018-12-31 14:59 ` Eli Zaretskii
  1 sibling, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2018-12-31 14:59 UTC (permalink / raw)
  To: kris; +Cc: 33934

> From: kris <cq.personal@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#33934: 26.1; server.el/emacsclient mismatch regarding socket...
  2018-12-31  5:25 ` Phil Sainty
@ 2018-12-31 15:05   ` Eli Zaretskii
       [not found]     ` <CACTzTFDCNDdRePDdeun=gX9+V8k=AtrZio4U3y=9n9wQGF-ZDw@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2018-12-31 15:05 UTC (permalink / raw)
  To: Phil Sainty; +Cc: cq.personal, 33934

> From: Phil Sainty <psainty@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#33934: 26.1; server.el/emacsclient mismatch regarding socket...
       [not found]     ` <CACTzTFDCNDdRePDdeun=gX9+V8k=AtrZio4U3y=9n9wQGF-ZDw@mail.gmail.com>
@ 2019-01-04 13:58       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2019-01-04 13:58 UTC (permalink / raw)
  To: kris; +Cc: 33934-done

> From: kris <cq.personal@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-01-04 13:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-31  2:02 bug#33934: 26.1; server.el/emacsclient mismatch regarding socket kris
2018-12-31  5:25 ` Phil Sainty
2018-12-31 15:05   ` Eli Zaretskii
     [not found]     ` <CACTzTFDCNDdRePDdeun=gX9+V8k=AtrZio4U3y=9n9wQGF-ZDw@mail.gmail.com>
2019-01-04 13:58       ` Eli Zaretskii
2018-12-31 14:59 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).