emacs-devel
[Top][All Lists]
Advanced

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

What is restore_window_configuration in read_minibuf (minibuf.c) for?


From: Alan Mackenzie
Subject: What is restore_window_configuration in read_minibuf (minibuf.c) for?
Date: Mon, 19 Apr 2021 10:46:11 +0000

Hello, Emacs.

Emacs 28, master branch.

In src/minibuf.c, function read_minibuf, there's a
restore_window_configuration set up to be called on minibuffer
termination.

When this call of restore_window_configuration happens, the restored
frame sometimes includes a minibuffer which has since moved to another
frame (reproduction recipe below).  Having the minibuffer displayed on
two frames causes trouble.

What is the purpose of this restore_window_configuration in
read_minibuf?  Does anybody know?  Removing it appears to fix the above
bug, but what problems might this cause?  I would like to remove it.

Recipe to reproduce the bug:
(i) emacs -Q --eval "(setq enable-recursive-minibuffers t
  minibuffer-follows-selected-frame 'hybrid)"
(ii) C-x 5 2, giving two frames F1, F2.
(iii) With four existing files file1, file2, file3, file4:
(iv) In F1, C-x C-f file1.
  In F2 C-x C-f file2.
  In F1 C-x C-f file3.
  In F2 C-x C-f file4.
(v) Currently the minibuffers are stacked up in F2.
(vi) In F2 type RET, visiting file4.  The MB for file3 is visible in
  F2's mini window.
(vii) In F2's mini window, type RET.  This visits file3 in F1, leaving
  the stack of minibuffers in F2.  However ....
(viii) The minibuffer for file2 is also visible in F1.  This is a bug
  (see above).
(ix) Typing RET in F1's mini window visits file2, but "loses" the
  minibuffer for file1, which now needs to be aborted with C-].

Just as a matter of interest, the above sequence on Emacs-27 doesn't
even get that far - it "loses" the minibuffers for file2 and file1 at an
early stage.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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