emacs-devel
[Top][All Lists]
Advanced

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

Re: kill-buffer calls frame's buffer-predicate for all buffers even if t


From: Constantin Kulikov
Subject: Re: kill-buffer calls frame's buffer-predicate for all buffers even if the killed buffer was not shown in any window.
Date: Mon, 16 Jan 2017 11:14:10 +0300

> it needs to find another buffer to become the current one
The current in what sense? In the sense of 1)(current-buffer) or 2) (windown-buffer (selected-window))?
If 1) then why require that this buffer is not visible?
If 2) then why call the buffer-predicate in the case where the killed buffer was not shown in any window?

What I understand of how kill-buffer must work:
First call kill-buffer hooks
Then find windows with the buffer and replace it, here the call to buffer-predicate it legit if the buffer was visible in any window.
Then really kill the buffer.
At this point we can set selected window buffer as current because we already have called the replace-buffer-in-window.
If there is no selected window, then we can take the first buffer in (buffer-list) as current
or create the *sctatch* and set it as current.

I can not see why there is a need to call buffer-predicate when killing a buffer that was not visible in any window.)

reply via email to

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