From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#63181: 28.2; Can't suppress server-already-running warning Date: Sun, 30 Apr 2023 08:56:32 +0300 Message-ID: <83jzxtq5f3.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5028"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63181@debbugs.gnu.org To: Dave Abrahams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 30 07:57:36 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pt03z-00014x-Vd for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Apr 2023 07:57:36 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pt03Z-0005fy-Q1; Sun, 30 Apr 2023 01:57:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pt03U-0005fM-OP for bug-gnu-emacs@gnu.org; Sun, 30 Apr 2023 01:57:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pt03S-0005lE-AM for bug-gnu-emacs@gnu.org; Sun, 30 Apr 2023 01:57:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pt03R-0007f2-LD for bug-gnu-emacs@gnu.org; Sun, 30 Apr 2023 01:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Apr 2023 05:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63181 X-GNU-PR-Package: emacs Original-Received: via spool by 63181-submit@debbugs.gnu.org id=B63181.168283416629378 (code B ref 63181); Sun, 30 Apr 2023 05:57:01 +0000 Original-Received: (at 63181) by debbugs.gnu.org; 30 Apr 2023 05:56:06 +0000 Original-Received: from localhost ([127.0.0.1]:37075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pt02Y-0007dl-84 for submit@debbugs.gnu.org; Sun, 30 Apr 2023 01:56:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37324) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pt02S-0007dB-GW for 63181@debbugs.gnu.org; Sun, 30 Apr 2023 01:56:04 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pt02L-0005en-U2; Sun, 30 Apr 2023 01:55:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=B29LrMzdLbavoR8J9BqWLKfhB+EaRNQipUxRZKIKask=; b=Ja4tNRSxtlSNy2bVvsjO 11sqZpVlfqBTn0/xI0mFFZx+Gr+WyfTmW4Mjk7NCxzx7QdwdU/CulimeyrhOOvw54BbG21h7q+UUG SIZ5phV5gA56B7eZ6YnqQzH81g383nt3m9ciaUINPTQiEqm/G2G3/YF3ezwiGz2BQh0FzYO8Ofwmh s8kzkhqmOT/erChWshOhRt8B8kll1XVj8/fMgpgElP41vBcjqFjoWSq265REAcxUm0NPFclo9zQVj KMQXLxH1kONKN9bz+q8464qZSPnRd2QRB/Ft3sCCjKX/yhqpGDL26cYDcxLORp5+BEsT8LvAg0SCL GPcNfm4iyn6pjQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pt02L-0004w6-3I; Sun, 30 Apr 2023 01:55:53 -0400 In-Reply-To: (message from Dave Abrahams on Sat, 29 Apr 2023 19:27:14 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:260826 Archived-At: > From: Dave Abrahams > Date: Sat, 29 Apr 2023 19:27:14 -0700 > > with emacs -Q or emacs -q, you can run > > (dlet ((warning-suppress-types '((server)))) > (server-mode)) > > from the *scratch* buffer, and if a server is already running, you just > get nil. But: if I put that stanza at the beginning of my early-init.el > (or init.el) and have no other configuration, I get a warning if the > server is already running. > > Warning (server): Unable to start the Emacs server. > There is an existing Emacs server, named "server". > To start the server in this Emacs process, stop the existing > server or call ‘M-x server-force-delete’ to forcibly disconnect it. Disable showing Disable logging > > It should be possible to suppress this warning programmatically, but I > can't find a way. Why do you let-bind the variable, instead of assigning a value to it? It's a defcustom, so it is meant to be bound with setq. You seem to assume that the warning produced by server-mode will be processed inside the binding, but that is not true during startup: warnings emitted during startup are delayed until after the init files are read and processed, and by that time your let-binding is long gone. If you, for some reason, insist on doing this with a let-binding, you will need to move this to after-init-hook or emacs-startup-hook, which are invoked after loading the init files, and warnings are no longer delayed.