[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
[PATCHv4 3/4] Add `remember-notes' function to store notes across Emacs restarts., Michal Nazarewicz, 2013/06/24
[PATCHv4 4/4] Simplify conditional expression in `find-file-noselect'., Michal Nazarewicz, 2013/06/24
Re: [PATCHv4 0/4] Add `remember-notes' function, Stefan Monnier, 2013/06/30