all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thibault <thibault@thb.lt>
To: 31859@debbugs.gnu.org
Subject: bug#31859: 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	[thread overview]
Message-ID: <87tvq2d8fw.fsf@thb.lt> (raw)

[-- Attachment #1: Type: text/plain, Size: 1066 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

             reply	other threads:[~2018-06-16 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-16 16:04 Thibault [this message]
2018-06-16 16:15 ` bug#31859: 26.1; Emacs has no way to determine if the current instance has a running server Eli Zaretskii
2018-06-16 16:27   ` Thibault Polge
2018-06-16 16:30     ` Eli Zaretskii
2018-06-23  7:52       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tvq2d8fw.fsf@thb.lt \
    --to=thibault@thb.lt \
    --cc=31859@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.