bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63181: 28.2; Can't suppress server-already-running warning


From: Eli Zaretskii
Subject: bug#63181: 28.2; Can't suppress server-already-running warning
Date: Sun, 30 Apr 2023 08:56:32 +0300

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]