diff options
| author | Martin Rudalics | 2024-09-11 10:36:14 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2024-09-11 10:36:14 +0200 |
| commit | fc3a7f45292b9a7be95fdefd24fedb7e8f564d1c (patch) | |
| tree | 42c8f350f181c8705564f4320054c0fdaefbba77 /src/window.c | |
| parent | 74ea24233ca281b19c3e3d2552621ceac30dfc48 (diff) | |
| download | emacs-fc3a7f45292b9a7be95fdefd24fedb7e8f564d1c.tar.gz emacs-fc3a7f45292b9a7be95fdefd24fedb7e8f564d1c.zip | |
For minibuffer windows record minibuffers only (Bug#72487)
* src/minibuf.c (zip_minibuffer_stacks): Use wset type
functions. Call 'record-window-buffer' instead of
'push-window-buffer-onto-prev' to handle all sorts of buffers
shown in minibuffer windows in a uniform way.
(read_minibuf): Call 'record-window-buffer' instead of
'push-window-buffer-onto-prev' for same reason as previous.
* lisp/calculator.el (calculator-update-display)
(calculator-save-and-quit): Make sure calculator buffer is live
before operating on it.
* lisp/window.el (record-window-buffer): Handle case where
WINDOW is a minibuffer window: Unconditionally remove WINDOW's
buffer from WINDOW's list of previous buffers and push it if
and only if it is a live minibuffer (Bug#72487). Do not run
'buffer-list-update-hook' if WINDOW is a minibuffer window.
(push-window-buffer-onto-prev): Make it an alias of
'record-window-buffer' so it will run the latter's checks.
(replace-buffer-in-windows): Handle minibuffer windows and
rewrite doc-string accordingly.
* doc/lispref/windows.texi (Buffers and Windows): Explain
handling of minibuffer windows in 'replace-buffer-in-windows'.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index 35092ddd582..34968ac824f 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -3647,9 +3647,17 @@ replace_buffer_in_windows (Lisp_Object buffer) | |||
| 3647 | call1 (Qreplace_buffer_in_windows, buffer); | 3647 | call1 (Qreplace_buffer_in_windows, buffer); |
| 3648 | } | 3648 | } |
| 3649 | 3649 | ||
| 3650 | /* If BUFFER is shown in a window, safely replace it with some other | 3650 | /** If BUFFER is shown in any window, safely replace it with some other |
| 3651 | buffer in all windows of all frames, even those on other keyboards. */ | 3651 | buffer in all windows of all frames, even those on other keyboards. |
| 3652 | 3652 | Do not delete any window. | |
| 3653 | |||
| 3654 | This function is called by Fkill_buffer when it detects that | ||
| 3655 | replacing BUFFER in some window showing BUFFER has failed. It | ||
| 3656 | assumes that ‘replace-buffer-in-windows’ has removed any entry | ||
| 3657 | referencing BUFFER from any window's lists of previous and next | ||
| 3658 | buffers and that window's ‘quit-restore’ and 'quit-restore-prev' | ||
| 3659 | parameters. | ||
| 3660 | */ | ||
| 3653 | void | 3661 | void |
| 3654 | replace_buffer_in_windows_safely (Lisp_Object buffer) | 3662 | replace_buffer_in_windows_safely (Lisp_Object buffer) |
| 3655 | { | 3663 | { |