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: martin rudalics
Subject: Re: [PATCHv4 1/4] `kill-buffer' runs query functions before checking buffer modification.
Date: Tue, 25 Jun 2013 08:47:02 +0200

> 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.

It's the early return I had in mind but changing the condition looks
equally well to me.  Note that we also have to change the Elisp info
entry of `kill-buffer-query-functions'.

martin



reply via email to

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