mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2026-09-10 07:46:51 -04:00
; Warn about killed buffers returned by 'window-prev-buffers' (Bug#81370)
* src/window.c (Fwindow_prev_buffers): In doc-string mention that the return value may reference killed buffers. * doc/lispref/windows.texi (Window History): Mention that the return value of 'window-prev-buffers' may reference buffers that have been killed.
This commit is contained in:
parent
b07e634e4c
commit
924d88a736
|
|
@ -4939,6 +4939,11 @@ and @var{window-pos} is a marker that gives the window point position
|
||||||
The list is ordered so that earlier elements correspond to more
|
The list is ordered so that earlier elements correspond to more
|
||||||
recently-shown buffers, and the first element usually corresponds to the
|
recently-shown buffers, and the first element usually corresponds to the
|
||||||
buffer most recently removed from the window.
|
buffer most recently removed from the window.
|
||||||
|
|
||||||
|
As a rule, elements are removed from this list when their buffer gets
|
||||||
|
killed. In rare cases, however, elements may have survived the killing
|
||||||
|
of their buffer. It's a good idea therefore to always check buffers for
|
||||||
|
liveness when processing the return value of this function.
|
||||||
@end defun
|
@end defun
|
||||||
|
|
||||||
@defun set-window-prev-buffers window prev-buffers
|
@defun set-window-prev-buffers window prev-buffers
|
||||||
|
|
|
||||||
|
|
@ -2326,7 +2326,11 @@ WINDOW must be a live window and defaults to the selected one.
|
||||||
|
|
||||||
The return value is a list of elements (BUFFER WINDOW-START POS),
|
The return value is a list of elements (BUFFER WINDOW-START POS),
|
||||||
where BUFFER is a buffer, WINDOW-START is the start position of the
|
where BUFFER is a buffer, WINDOW-START is the start position of the
|
||||||
window for that buffer, and POS is a window-specific point value. */)
|
window for that buffer, and POS is a window-specific point value.
|
||||||
|
|
||||||
|
In rare ocasions BUFFER may have been already killed. It's therefore
|
||||||
|
advisable to always check the return value for the occurrence of dead
|
||||||
|
buffers before using it. */)
|
||||||
(Lisp_Object window)
|
(Lisp_Object window)
|
||||||
{
|
{
|
||||||
return decode_live_window (window)->prev_buffers;
|
return decode_live_window (window)->prev_buffers;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue