From unknown Fri Jun 20 07:16:20 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#31859 <31859@debbugs.gnu.org> To: bug#31859 <31859@debbugs.gnu.org> Subject: Status: 26.1; Emacs has no way to determine if the current instance has a running server Reply-To: bug#31859 <31859@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:16:20 +0000 retitle 31859 26.1; Emacs has no way to determine if the current instance h= as a running server reassign 31859 emacs submitter 31859 Thibault severity 31859 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 16 12:04:48 2018 Received: (at submit) by debbugs.gnu.org; 16 Jun 2018 16:04:48 +0000 Received: from localhost ([127.0.0.1]:51857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDh2-0005ej-4c for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:04:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDgz-0005eV-Ck for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:04:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUDgt-0004Gu-LA for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:04:40 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:40208) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fUDgt-0004Gg-IW for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:04:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40450) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUDgs-0005Cp-KT for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2018 12:04:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUDgp-0004EH-Gx for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2018 12:04:38 -0400 Received: from 2.mo2.mail-out.ovh.net ([188.165.53.149]:40193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fUDgp-0004B0-Ap for bug-gnu-emacs@gnu.org; Sat, 16 Jun 2018 12:04:35 -0400 Received: from player778.ha.ovh.net (unknown [10.109.108.42]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id 4261313A19B for ; Sat, 16 Jun 2018 18:04:25 +0200 (CEST) Received: from maladict.thb.lt (unknown [194.199.3.13]) (Authenticated sender: thibault@thb.lt) by player778.ha.ovh.net (Postfix) with ESMTPSA id B339F1800A6 for ; Sat, 16 Jun 2018 18:04:24 +0200 (CEST) User-agent: mu4e 0.9.18; emacs 26.1 From: Thibault To: bug-gnu-emacs@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-ID: <87tvq2d8fw.fsf@thb.lt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Ovh-Tracer-Id: 3821304284542322955 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrleekgdelkecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEExwXquOM8bWb4Q2zVGxM2FxoLkGQFAlslNQMACgkQGxM2FxoL kGQQGw/+PwSASnmm63eSH1o4zIV0RQDEug12Q5x9llSdHNtCWA/d2anFaf/C0ZrI aba902vZQ9qp6RknxTm9RcvTpQVLGLJtww/SSp5dQdmjzy1z29gtBl4ZhD9P8MFb xoMtmecOT4qQdQ1NoOSc6TuVLrTPeOsJ9F0wl7/VYoZbBJfO6pclWQyEAWB5iBSa LhSgvvxfW12FhdxuYGVt0Izvk9rt61xlM/H4RdVZ3mkusCaIVWpjriB23KBjquhR 0MjT/flF72T68CF7g3C7CoWJ5nNP39AUNNgsAy+7pyazxDk3sDEduUJ7o8irkzTN vvLWj7VNxVoPl2Y0/ccy/yIjJ+uO11XMOYOnh2eCOtGKCvIn61Sfq/751WU9AIm3 I9N/pFk8D1S/WNuE0kkfB2qDsF3f7MPb38bBy5RbbpPW6lRYVzpc+EazoZKQhsHA aDiKFSrKCEkPBPZJWMvXq1EtUkiVz13YCLMGiO7Mkoy3z5QeJbV9GHjIRNjZwnjq deyXmOID5qrOdY42NJCCqPZvzOHFISwocRD7sPFfvd4orTxU3vmPeQjfXUW+oTZt tOfSe70WyXPJsvHLgad8mxZfL7EwAEYd4Cjg7RSjIbmyXyH9Nq0dCM0/IRMJfhBT JoYEBG/wPnQp8+ci1v0B9PzDmmMHNg+/DLFG6/v2YuPIYIKG59E= =qNKY -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 16 12:15:38 2018 Received: (at 31859) by debbugs.gnu.org; 16 Jun 2018 16:15:38 +0000 Received: from localhost ([127.0.0.1]:51883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDrW-0005vP-88 for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:15:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUDrU-0005vD-RM for 31859@debbugs.gnu.org; Sat, 16 Jun 2018 12:15:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUDrM-0002ME-Hw for 31859@debbugs.gnu.org; Sat, 16 Jun 2018 12:15:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUDrM-0002Lp-B0; Sat, 16 Jun 2018 12:15:28 -0400 Received: from [176.228.60.248] (port=3917 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fUDrL-0007kF-Ng; Sat, 16 Jun 2018 12:15:28 -0400 Date: Sat, 16 Jun 2018 19:15:19 +0300 Message-Id: <83a7ruzp0o.fsf@gnu.org> From: Eli Zaretskii To: Thibault In-reply-to: <87tvq2d8fw.fsf@thb.lt> (message from Thibault on Sat, 16 Jun 2018 18:04:19 +0200) Subject: Re: bug#31859: 26.1; Emacs has no way to determine if the current instance has a running server References: <87tvq2d8fw.fsf@thb.lt> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31859 Cc: 31859@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Thibault > 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 16 12:27:11 2018 Received: (at 31859) by debbugs.gnu.org; 16 Jun 2018 16:27:11 +0000 Received: from localhost ([127.0.0.1]:51900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUE2h-0006Cw-3X for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:27:11 -0400 Received: from 17.mo4.mail-out.ovh.net ([46.105.41.16]:57441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUE2f-0006Cn-IH for 31859@debbugs.gnu.org; Sat, 16 Jun 2018 12:27:10 -0400 Received: from player714.ha.ovh.net (unknown [10.109.120.85]) by mo4.mail-out.ovh.net (Postfix) with ESMTP id CAC43182AEA for <31859@debbugs.gnu.org>; Sat, 16 Jun 2018 18:27:07 +0200 (CEST) Received: from maladict.thb.lt (unknown [194.199.3.13]) (Authenticated sender: thibault@thb.lt) by player714.ha.ovh.net (Postfix) with ESMTPSA id 28DCD3C0098 for <31859@debbugs.gnu.org>; Sat, 16 Jun 2018 18:27:06 +0200 (CEST) References: <87tvq2d8fw.fsf@thb.lt> <83a7ruzp0o.fsf@gnu.org> User-agent: mu4e 0.9.18; emacs 26.1 From: Thibault Polge To: 31859@debbugs.gnu.org Subject: Re: bug#31859: 26.1; Emacs has no way to determine if the current instance has a running server In-reply-to: <83a7ruzp0o.fsf@gnu.org> Date: Sat, 16 Jun 2018 18:27:03 +0200 Message-ID: <87sh5md7e0.fsf@thb.lt> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Ovh-Tracer-Id: 4204673202285955476 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrleekgddutdefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenuc X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 31859 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain > 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEExwXquOM8bWb4Q2zVGxM2FxoLkGQFAlslOlcACgkQGxM2FxoL kGTTCA/7BTvOuDMkhapisFugcDyImwTFyaQ6bCxuxooYfQuyJRk1p5D9AlmaurW8 5wrCWKw5vlvPUycVJzMjXjYRVZXtSsE14SLPYIV2OPP/G23Lh06KkAieXVrDeUVd /4qjh51w8qU3QXufRXLj0Cmax78vmUB6JmRG8CBMeyBmzht0Osebj6RB05ZG8sfH VMpemq8pb9NwD+FhdtSYDk781TNHeCr10Q7IGAnOewuFJpR7FSY+xdoyXhR7fE2K I13C2bz+0fQQhan7Aw5chu7Q8YhVHYb01wjQ47vTaJAgrKC9XXeQv7gaolvoaIZT J2i/L2xMx9C/Fa7B4GwsqeNpIOLNEotyOwcfrKRFd1zGDtwWaCIvmKNBz1U5v3nZ mQuANrije/4RnH+JpmO4cmJS/3FzPsWoVUNzfNK/+ncfL+m7ofEtIy/zvjmJcbIi 1kIL8yAHfw23Vx6wv/d0Ev5IMB79ckXa0g/I1K6pWhOhzGW8EMGMS+SbI/x19G7S 7vMBtU7WPvjA7iqbbkllguPzdOucYg4cU2UuP3YpEXpuyr5m4Pld8PMOVQWnHyBx 0WGFNQtadANLO5dtZystHHc2wb844bQYnL1BFAfGBU2/Akp1tK4ii6EN4xw/8CYk Fb3di64PS1eyZAQqLRtJJjh0k59YVH45vd58S6mMQXMGg3H/8xw= =9avi -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 16 12:31:13 2018 Received: (at 31859) by debbugs.gnu.org; 16 Jun 2018 16:31:13 +0000 Received: from localhost ([127.0.0.1]:51912 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUE6b-0006KK-3o for submit@debbugs.gnu.org; Sat, 16 Jun 2018 12:31:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fUE6Z-0006K8-8q for 31859@debbugs.gnu.org; Sat, 16 Jun 2018 12:31:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUE6P-0003S1-Aw for 31859@debbugs.gnu.org; Sat, 16 Jun 2018 12:31:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUE6P-0003Rr-7R; Sat, 16 Jun 2018 12:31:01 -0400 Received: from [176.228.60.248] (port=3930 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fUE6N-0000Xc-PG; Sat, 16 Jun 2018 12:31:00 -0400 Date: Sat, 16 Jun 2018 19:30:51 +0300 Message-Id: <83602izoas.fsf@gnu.org> From: Eli Zaretskii To: Thibault Polge In-reply-to: <87sh5md7e0.fsf@thb.lt> (message from Thibault Polge on Sat, 16 Jun 2018 18:27:03 +0200) Subject: Re: bug#31859: 26.1; Emacs has no way to determine if the current instance has a running server References: <87tvq2d8fw.fsf@thb.lt> <83a7ruzp0o.fsf@gnu.org> <87sh5md7e0.fsf@thb.lt> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31859 Cc: 31859@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > From: Thibault Polge > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 23 03:52:38 2018 Received: (at 31859-done) by debbugs.gnu.org; 23 Jun 2018 07:52:38 +0000 Received: from localhost ([127.0.0.1]:60744 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fWdLY-0001ol-Bq for submit@debbugs.gnu.org; Sat, 23 Jun 2018 03:52:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fWdLX-0001oa-68 for 31859-done@debbugs.gnu.org; Sat, 23 Jun 2018 03:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWdLN-0007jM-26 for 31859-done@debbugs.gnu.org; Sat, 23 Jun 2018 03:52:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWdLM-0007jG-Un; Sat, 23 Jun 2018 03:52:24 -0400 Received: from [176.228.60.248] (port=2116 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fWdLM-00082H-6Q; Sat, 23 Jun 2018 03:52:24 -0400 Date: Sat, 23 Jun 2018 10:52:34 +0300 Message-Id: <83fu1euegt.fsf@gnu.org> From: Eli Zaretskii To: thibault@thb.lt In-reply-to: <83602izoas.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Jun 2018 19:30:51 +0300) Subject: Re: bug#31859: 26.1; Emacs has no way to determine if the current instance has a running server References: <87tvq2d8fw.fsf@thb.lt> <83a7ruzp0o.fsf@gnu.org> <87sh5md7e0.fsf@thb.lt> <83602izoas.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 31859-done Cc: 31859-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) > Date: Sat, 16 Jun 2018 19:30:51 +0300 > From: Eli Zaretskii > Cc: 31859@debbugs.gnu.org > > > From: Thibault Polge > > 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. From unknown Fri Jun 20 07:16:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 21 Jul 2018 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator