emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCHv4 1/4] `kill-buffer' runs query functions before checking buf


From: Michal Nazarewicz
Subject: Re: [PATCHv4 1/4] `kill-buffer' runs query functions before checking buffer modification.
Date: Tue, 25 Jun 2013 00:35:32 +0200
User-agent: Notmuch/0.15.2+55~geb6e9d8 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

On Mon, Jun 24 2013, martin rudalics wrote:
> Sure.  What I meant is that `kill-buffer' should return immediately when
> the buffer is dead after calling the query functions instead of entering
> the do_yes_or_no_p stuff with a dead buffer.  Or did I miss something?

Ah, right.  Changing the 

    if (INTERACTIVE && !NILP (BVAR (b, filename))
        && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))

condition to

    if (INTERACTIVE && BUFFER_LIVE_P (b) && !NILP (BVAR (b, filename))
        && BUF_MODIFF (b) > BUF_SAVE_MODIFF (b))

would solve the issue.  Either that or adding

  if (!BUFFER_LIVE_P (b))
    return unbind_to (count, Qt);

just prior to the whole if statement which has the side effect of not
calling kill-buffer-hook if any of the kill-buffer-query-functions kills
the buffer, which actually may be desired.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: address@hidden>--------------ooO--(_)--Ooo--

Attachment: signature.asc
Description: PGP signature


reply via email to

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