GNU bug report logs - #31859
26.1; Emacs has no way to determine if the current instance has a running server

Previous Next

Package: emacs;

Reported by: Thibault <thibault <at> thb.lt>

Date: Sat, 16 Jun 2018 16:05:02 UTC

Severity: wishlist

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 31859 in the body.
You can then email your comments to 31859 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#31859; Package emacs. (Sat, 16 Jun 2018 16:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thibault <thibault <at> thb.lt>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 16 Jun 2018 16:05:02 GMT) Full text and rfc822 format available.

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

From: Thibault <thibault <at> thb.lt>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1;
 Emacs has no way to determine if the current instance has a running
 server
Date: Sat, 16 Jun 2018 18:04:19 +0200
[Message part 1 (text/plain, inline)]
It's all in the subject line: Emacs has no way to determine if the
current instance has a running server.  There's the `server-mode'
variable along with the `daemonp' and `server-running-p' functions, but
none of them are actually usable for the most elementary use case of
determining whether *this* instance has a server started.

 - `server-mode' is nil if the server was started with `M-x server-start',
   and t only if was started with `server-mode'

 - `(daemonp)' returns non-nil if and only if emacs was started as a
   daemon.

That is, the following sexp:

(progn
    (require 'server)
    (server-start)
    (or server-mode (daemonp)))

will always evaluate to nil, except from emacsclient.

 - (server-running-p) tries to determine if /some/ server is running,
   somewhere, that is configured like the current server would be, but
   it doesn't guarantee that the server runs from the current instance.
   If you start two instances, `(server-running-p)' will eval to `t' *in
   both* after the server was started in any one of them.

Thanks,
Thibault
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31859; Package emacs. (Sat, 16 Jun 2018 16:16:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thibault <thibault <at> thb.lt>
Cc: 31859 <at> debbugs.gnu.org
Subject: Re: bug#31859: 26.1;
 Emacs has no way to determine if the current instance has a running
 server
Date: Sat, 16 Jun 2018 19:15:19 +0300
> From: Thibault <thibault <at> thb.lt>
> Date: Sat, 16 Jun 2018 18:04:19 +0200
> 
> It's all in the subject line: Emacs has no way to determine if the
> current instance has a running server.

Does it work to test whether server-process is bound and non-nil?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31859; Package emacs. (Sat, 16 Jun 2018 16:28:02 GMT) Full text and rfc822 format available.

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

From: Thibault Polge <thibault <at> thb.lt>
To: 31859 <at> debbugs.gnu.org
Subject: Re: bug#31859: 26.1;
 Emacs has no way to determine if the current instance has a running
 server
Date: Sat, 16 Jun 2018 18:27:03 +0200
[Message part 1 (text/plain, inline)]
> Does it work to test whether server-process is bound and non-nil?

It works, indeed.  Would you accept a documentation PR on the variable
and the two functions, which are much more obvious candidates?
Something like:

For a general way of determining if the current instance has a server
running, check the value of `server-process`.

Or a PR adding a stupid helper function like:

;; server.el ---
...
;;;###autoload
(defun server-started-p ()
    "Return non-nil if this Emacs has a server started."
    (and (boundp server-process) server-process))

What do you think?

Th
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31859; Package emacs. (Sat, 16 Jun 2018 16:32:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Thibault Polge <thibault <at> thb.lt>
Cc: 31859 <at> debbugs.gnu.org
Subject: Re: bug#31859: 26.1;
 Emacs has no way to determine if the current instance has a running
 server
Date: Sat, 16 Jun 2018 19:30:51 +0300
> From: Thibault Polge <thibault <at> thb.lt>
> Date: Sat, 16 Jun 2018 18:27:03 +0200
> 
> > Does it work to test whether server-process is bound and non-nil?
> 
> It works, indeed.  Would you accept a documentation PR on the variable
> and the two functions, which are much more obvious candidates?
> Something like:
> 
> For a general way of determining if the current instance has a server
> running, check the value of `server-process`.
> 
> Or a PR adding a stupid helper function like:

I'd prefer a documentation change, but let's see if someone has other
opinions.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 23 Jun 2018 07:53:01 GMT) Full text and rfc822 format available.

Notification sent to Thibault <thibault <at> thb.lt>:
bug acknowledged by developer. (Sat, 23 Jun 2018 07:53:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: thibault <at> thb.lt
Cc: 31859-done <at> debbugs.gnu.org
Subject: Re: bug#31859: 26.1;
 Emacs has no way to determine if the current instance has a running
 server
Date: Sat, 23 Jun 2018 10:52:34 +0300
> Date: Sat, 16 Jun 2018 19:30:51 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 31859 <at> debbugs.gnu.org
> 
> > From: Thibault Polge <thibault <at> thb.lt>
> > Date: Sat, 16 Jun 2018 18:27:03 +0200
> > 
> > > Does it work to test whether server-process is bound and non-nil?
> > 
> > It works, indeed.  Would you accept a documentation PR on the variable
> > and the two functions, which are much more obvious candidates?
> > Something like:
> > 
> > For a general way of determining if the current instance has a server
> > running, check the value of `server-process`.
> > 
> > Or a PR adding a stupid helper function like:
> 
> I'd prefer a documentation change, but let's see if someone has other
> opinions.

No further comments, so I installed a documentation change, and I'm
marking this bug done.

Thanks.




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

This bug report was last modified 6 years and 334 days ago.

Previous Next


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