unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Barzilay <eli@barzilay.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21723-done@debbugs.gnu.org
Subject: bug#21723: 24.5; Bug in `server-kill-emacs-query-function'
Date: Thu, 22 Oct 2015 01:30:28 -0400	[thread overview]
Message-ID: <CALO-gutZb6cYVO5D4d3Ks1EORTDY=0bN8gqFo1y+QSw1icCDmw@mail.gmail.com> (raw)
In-Reply-To: <83si54upu8.fsf@gnu.org>

On Wed, Oct 21, 2015 at 12:51 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Eli Barzilay <eli@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.

(Ah -- I saw the bug when adapting old hacks to new code, and saw that
difference.  I wondered why I didn't report it if I had a fixed version,
but my hacks were probably more than 10 years old so based on the
previous version...)

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





      reply	other threads:[~2015-10-22  5:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-21  8:52 bug#21723: 24.5; Bug in `server-kill-emacs-query-function' Eli Barzilay
2015-10-21 16:51 ` Eli Zaretskii
2015-10-22  5:30   ` Eli Barzilay [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALO-gutZb6cYVO5D4d3Ks1EORTDY=0bN8gqFo1y+QSw1icCDmw@mail.gmail.com' \
    --to=eli@barzilay.org \
    --cc=21723-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).