GNU bug report logs - #21723
24.5; Bug in `server-kill-emacs-query-function'

Previous Next

Package: emacs;

Reported by: Eli Barzilay <eli <at> barzilay.org>

Date: Wed, 21 Oct 2015 08:53:02 UTC

Severity: normal

Merged with 19635

Found in versions 24.4, 24.5

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Eli Barzilay <eli <at> barzilay.org>
Subject: bug#21723: closed (Re: bug#21723: 24.5; Bug in `server-kill-emacs-query-function')
Date: Wed, 21 Oct 2015 16:53:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#21723: 24.5; Bug in `server-kill-emacs-query-function'

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 21723 <at> debbugs.gnu.org.

-- 
21723: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21723
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Eli Barzilay <eli <at> barzilay.org>
Cc: 21723-done <at> debbugs.gnu.org
Subject: Re: bug#21723: 24.5; Bug in `server-kill-emacs-query-function'
Date: Wed, 21 Oct 2015 19:51:59 +0300
> From: Eli Barzilay <eli <at> barzilay.org>
> Date: Wed, 21 Oct 2015 04:52:01 -0400
> 
> The code in `server-kill-emacs-query-function' (in server.el) has this
> in an `or':
> 
>     (let (live-client)
>       (dolist (proc server-clients)
>         (when (memq t (mapcar 'buffer-live-p (process-get
>                                               proc 'buffers)))
>           (setq live-client t)))
>       live-client)
> 
> IIUC, this looks for a live client, and if there is one, the t result
> means that the yes-or-no-p question in the end will *not* get asked.
> I verified this by:
> 
>   * Starting emacs -Q and in it start the server
> 
>   * Run emacsclient on a random file
> 
>   * Now, C-x C-c exits without asking any questions.
> 
> It seems to me like that condition is reversed, an the last line
> should instead be: (not live-client)

Ouch!  This bug was there for almost 10 years, since the simple loop
was rewritten as dolist, and the negation of the result was dropped in
the process.

Should be fixed now, thanks.

[Message part 3 (message/rfc822, inline)]
From: Eli Barzilay <eli <at> barzilay.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; Bug in `server-kill-emacs-query-function'
Date: Wed, 21 Oct 2015 04:52:01 -0400
The code in `server-kill-emacs-query-function' (in server.el) has this
in an `or':

    (let (live-client)
      (dolist (proc server-clients)
        (when (memq t (mapcar 'buffer-live-p (process-get
                                              proc 'buffers)))
          (setq live-client t)))
      live-client)

IIUC, this looks for a live client, and if there is one, the t result
means that the yes-or-no-p question in the end will *not* get asked.
I verified this by:

  * Starting emacs -Q and in it start the server

  * Run emacsclient on a random file

  * Now, C-x C-c exits without asking any questions.

It seems to me like that condition is reversed, an the last line
should instead be: (not live-client)

This will also make the first condition in the function unnecessary,
since if there are no clients, then the loop will not find a live one
and the question will be skipped.

-- 
                    ((x=>x(x))(x=>x(x)))                   Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!



This bug report was last modified 9 years and 216 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.