all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dave Abrahams <dave@boostpro.com>
Cc: 63181@debbugs.gnu.org
Subject: bug#63181: 28.2; Can't suppress server-already-running warning
Date: Sun, 30 Apr 2023 08:56:32 +0300	[thread overview]
Message-ID: <83jzxtq5f3.fsf@gnu.org> (raw)
In-Reply-To: <F59D6B33-DEA6-4B15-B2C8-83381A58FCBF@boostpro.com> (message from Dave Abrahams on Sat, 29 Apr 2023 19:27:14 -0700)

> From: Dave Abrahams <dave@boostpro.com>
> 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.





  reply	other threads:[~2023-04-30  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-30  2:27 bug#63181: 28.2; Can't suppress server-already-running warning Dave Abrahams
2023-04-30  5:56 ` Eli Zaretskii [this message]
2023-05-01 15:27   ` Dave Abrahams
2023-05-01 15:54     ` Eli Zaretskii
2023-05-01 16:24       ` Dave Abrahams
2023-05-01 16:56         ` 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=83jzxtq5f3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=63181@debbugs.gnu.org \
    --cc=dave@boostpro.com \
    /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.