GNU bug report logs - #13319
24.2.91; emacsclient doesn't find server with nonstandard name

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Mon, 31 Dec 2012 17:17:01 UTC

Severity: minor

Tags: moreinfo

Found in version 24.2.91

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.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 13319 in the body.
You can then email your comments to 13319 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#13319; Package emacs. (Mon, 31 Dec 2012 17:17:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 31 Dec 2012 17:17:02 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.91; emacsclient doesn't find server with nonstandard name
Date: Mon, 31 Dec 2012 18:11:18 +0100
Hi,

In emacs -Q, do this:

(progn
  (require 'server)
  (let ((server-name (concat "server_" (format-time-string  "%H:%M:%S"))))
    (server-start)))

Then I try to connect to this server, but it fails:

| bash-4.2:mh:~$ /usr/bin/emacsclient ~/.bashrc 
| /usr/bin/emacsclient: can't find socket; have you started the server?
| To start the server in Emacs, type "M-x server-start".
| /usr/bin/emacsclient: No socket or alternate editor.  Please use:
| 
|         --socket-name
|         --server-file      (or environment variable EMACS_SERVER_FILE)
|         --alternate-editor (or environment variable ALTERNATE_EDITOR)


When I explicitly specify the server name with the -s option,
emacsclient succeeds.  But due to the doc (man page), "emacsclient"
should connect to "the first server it finds":

| `-s SERVER-NAME'
| `--socket-name=SERVER-NAME'
|      Connect to the Emacs server named SERVER-NAME.  The server name is
|      given by the variable `server-name' on the Emacs server.  If this
|      option is omitted, `emacsclient' connects to the first server it
|      finds.  (This option is not supported on MS-Windows.)

Obviously this is not fulfilled here.  And it is no useful behavior.  If
only one server is running (and the socket is located under the
canonical path), emacsclient should find and use it.  It is arguable
which server should be used if more than one is running (and what the
"first server it finds" should be).

BTW, here is an explanation for why I want to start the server like
above (not substantially important for this report):

I often make changes to my config file/ elpa installations or rebuild
Emacs.  To guarantee that I always have a running Emacs (as a fallback
when something went wrong and a newly started Emacs fails to start), I
keep my old Emacs open and start a new one.  If I had just

  (server-start)

in my config, the new Emacs would not start a server (since the old one
is still running).  After having closed the old Emacs, I had no server
running, so I had to manually start the server every time.  This is
annoying.  So I want to start a server with a unique name.


Thanks,

Michael.


In GNU Emacs 24.2.91.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2012-12-30 on drachen
Bzr revision: rgm <at> gnu.org-20121230122326-m6gw29pkwjgwqf9d
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
System Description:	Debian GNU/Linux testing (wheezy)





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13319; Package emacs. (Mon, 31 Dec 2012 19:36:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 13319 <at> debbugs.gnu.org
Subject: Re: bug#13319: 24.2.91;
	emacsclient doesn't find server with nonstandard name
Date: Mon, 31 Dec 2012 20:34:43 +0100
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Obviously this is not fulfilled here.  And it is no useful behavior.  If
> only one server is running (and the socket is located under the
> canonical path), emacsclient should find and use it.

This is questionable.  How does it know that a random socket is a emacs
server socket?

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13319; Package emacs. (Mon, 31 Dec 2012 20:21:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 13319 <at> debbugs.gnu.org
Subject: Re: bug#13319: 24.2.91;
	emacsclient doesn't find server with nonstandard name
Date: Mon, 31 Dec 2012 21:20:16 +0100
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> Michael Heerdegen <michael_heerdegen <at> web.de> writes:
>
> > Obviously this is not fulfilled here.  And it is no useful behavior.  If
> > only one server is running (and the socket is located under the
> > canonical path), emacsclient should find and use it.
>
> This is questionable.  How does it know that a random socket is a emacs
> server socket?

Here on Debian, it looks under /tmp/emacs$UID.  Can there be any other
socket?


Regards,

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13319; Package emacs. (Thu, 15 Jul 2021 15:57:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Andreas Schwab <schwab <at> linux-m68k.org>, 13319 <at> debbugs.gnu.org
Subject: Re: bug#13319: 24.2.91; emacsclient doesn't find server with
 nonstandard name
Date: Thu, 15 Jul 2021 17:56:19 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

>> > Obviously this is not fulfilled here.  And it is no useful behavior.  If
>> > only one server is running (and the socket is located under the
>> > canonical path), emacsclient should find and use it.
>>
>> This is questionable.  How does it know that a random socket is a emacs
>> server socket?
>
> Here on Debian, it looks under /tmp/emacs$UID.  Can there be any other
> socket?

This was eight years ago, and some things have changed in this area
(like the location of the server socket), but the issue still remains, I
think?  That is, the client won't look around for a socket with a
non-standard name.

But I tend to think that this is actually the correct behaviour --
having emacsclient guess at what socket name to use sounds a bit too
DWIM to me:  I may deliberately have set up a server to do one very
specific thing under a non-standard name, and I would not want any
random emacsclient invocation to use that special server just because it
can't find the standard socket.  (Which I may just have forgotten to
start the server for.)

So I think this behaves as it should.  Anybody else got another opinion?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 15 Jul 2021 15:57:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13319; Package emacs. (Fri, 16 Jul 2021 01:09:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Andreas Schwab <schwab <at> linux-m68k.org>, 13319 <at> debbugs.gnu.org
Subject: Re: bug#13319: 24.2.91; emacsclient doesn't find server with
 nonstandard name
Date: Fri, 16 Jul 2021 03:08:04 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> >> This is questionable.  How does it know that a random socket is a emacs
> >> server socket?
> >
> > Here on Debian, it looks under /tmp/emacs$UID.  Can there be any other
> > socket?
>
> This was eight years ago, and some things have changed in this area
> (like the location of the server socket), but the issue still remains, I
> think?

Seems so.

> That is, the client won't look around for a socket with a
> non-standard name.
>
> But I tend to think that this is actually the correct behaviour --
> having emacsclient guess at what socket name to use sounds a bit too
> DWIM to me:  I may deliberately have set up a server to do one very
> specific thing under a non-standard name, and I would not want any
> random emacsclient invocation to use that special server just because it
> can't find the standard socket.  (Which I may just have forgotten to
> start the server for.)

What would happen in this case?  Can't you use another place to store
the socket then?

> So I think this behaves as it should.  Anybody else got another opinion?

I don't know if something like you describe could be prevented.  If you
are sure that my suggestion would cause trouble, then I'm ok with
closing.  I'm too ignorant about how this socket stuff is working to
have an opinion.

Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13319; Package emacs. (Fri, 16 Jul 2021 08:50:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: Andreas Schwab <schwab <at> linux-m68k.org>, 13319 <at> debbugs.gnu.org
Subject: Re: bug#13319: 24.2.91; emacsclient doesn't find server with
 nonstandard name
Date: Fri, 16 Jul 2021 10:49:24 +0200
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> What would happen in this case?  Can't you use another place to store
> the socket then?

I can, but I don't see how that's a better design.

>> So I think this behaves as it should.  Anybody else got another opinion?
>
> I don't know if something like you describe could be prevented.  If you
> are sure that my suggestion would cause trouble, then I'm ok with
> closing.

I think it would, but I'd like to hear whether anybody else has an
opinion here...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13319; Package emacs. (Fri, 16 Jul 2021 11:25:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: michael_heerdegen <at> web.de, schwab <at> linux-m68k.org, 13319 <at> debbugs.gnu.org
Subject: Re: bug#13319: 24.2.91;
 emacsclient doesn't find server with nonstandard name
Date: Fri, 16 Jul 2021 14:24:05 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Fri, 16 Jul 2021 10:49:24 +0200
> Cc: Andreas Schwab <schwab <at> linux-m68k.org>, 13319 <at> debbugs.gnu.org
> 
> >> So I think this behaves as it should.  Anybody else got another opinion?
> >
> > I don't know if something like you describe could be prevented.  If you
> > are sure that my suggestion would cause trouble, then I'm ok with
> > closing.
> 
> I think it would, but I'd like to hear whether anybody else has an
> opinion here...

I think we should fix the documentation to not say anything about "the
first available socket" there.  If the socket name is not the default
one, the user should tell emacsclient which socket to use.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13319; Package emacs. (Fri, 16 Jul 2021 12:52:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: michael_heerdegen <at> web.de, schwab <at> linux-m68k.org, 13319 <at> debbugs.gnu.org
Subject: Re: bug#13319: 24.2.91; emacsclient doesn't find server with
 nonstandard name
Date: Fri, 16 Jul 2021 14:51:18 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> I think we should fix the documentation to not say anything about "the
> first available socket" there.  If the socket name is not the default
> one, the user should tell emacsclient which socket to use.

Yup.  Done, and closing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 13319 <at> debbugs.gnu.org and Michael Heerdegen <michael_heerdegen <at> web.de> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 16 Jul 2021 12:52:02 GMT) Full text and rfc822 format available.

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

This bug report was last modified 3 years and 312 days ago.

Previous Next


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