aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAlan Mackenzie2021-03-21 16:54:31 +0000
committerAlan Mackenzie2021-03-21 16:54:31 +0000
commit7c2ebf6e23663fdc7b1880a4d7caeadc8c47c00e (patch)
tree19216102a0b7fc0212b8cdfa6fc8d70ed6ad86b4 /doc
parente276810dff9838e1bb8c2ec450f85835ed60bf14 (diff)
downloademacs-7c2ebf6e23663fdc7b1880a4d7caeadc8c47c00e.tar.gz
emacs-7c2ebf6e23663fdc7b1880a4d7caeadc8c47c00e.zip
Prevent open minibuffers getting lost when their frame gets deleted
This happened with minibuffer-follows-selected-frame set to t. * doc/emacs/mini.texi (Basic Minibuffer): State where a command's action takes place when a minibuffer's frame has been deleted. * lisp/window.el (window--before-delete-windows, record-window-buffer): Take into account that minibuffers are now recorded on w->prev_buffers field. * src/fns.c (merge_c): New version of `merge' taking a C function, rather than a Lisp function as the comparison function. * src/frame.c (do_switch_frame): Pass arguments sf and for_deletion to move_minibuffers_onnto_frame. * src/lisp.h (top level): Declare merge_c and move_minibuffers_onto_selected_frame. * src/minibuf.c (MB_frame): New Lisp_Object recording the minibuffer's frame. (choose_minibuf_frame): Remove all code except that which sets minibuf_window to the current frame's minibuffer. (minibuffer_ent_greater): New comparison function, passed to merge_c. (zip_minibuffer_stacks): New function. (move_minibuffers_onto_frame): Renamed from `move_minibuffer_onto_frame' given two arguments, the old frame and for_deletion, and simplified. Minibuffers are now stacked in the mini-window's ->prev_buffers field. (read_minibuf): Several detailed amendments. (exp_MB_frame): New Lisp_Object, the expired minibuffer's frame. (read_minibuf_unwind): Search for the expired minibuffer's frame, rather than taking it from (unreliable) variables. Switch temporarily to this frame for tidying up operations. (minibuffer_unwind): New function which pops a stacked minibuffer. (syms_of_minibuf): Call staticpro for the two new Lisp variables. * src/window.c (Fset_window_configuration): Don't record minibuffers with record-window-buffer. * src/xdisp.c (gui_consider_frame_title): Remove redundant Fselect_window, which caused an unwanted frame switch. Amend the arguments to format_mode_line_unwind_data to match.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/mini.texi4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi
index 9c1b9757593..d0865c5d0bd 100644
--- a/doc/emacs/mini.texi
+++ b/doc/emacs/mini.texi
@@ -82,7 +82,9 @@ after a recursive minibuffer has been opened in the current command
82(@pxref{Recursive Mini,,, elisp}). This option is mainly to retain 82(@pxref{Recursive Mini,,, elisp}). This option is mainly to retain
83(approximately) the behavior prior to Emacs 28.1. Note that the 83(approximately) the behavior prior to Emacs 28.1. Note that the
84effect of the command, when you finally finish using the minibuffer, 84effect of the command, when you finally finish using the minibuffer,
85always takes place in the frame where you first opened it. 85always takes place in the frame where you first opened it. The sole
86exception is that when that frame no longer exists, the action takes
87place in the currently selected frame.
86 88
87@node Minibuffer File 89@node Minibuffer File
88@section Minibuffers for File Names 90@section Minibuffers for File Names