all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* What is restore_window_configuration in read_minibuf (minibuf.c) for?
@ 2021-04-19 10:46 Alan Mackenzie
  2021-04-19 12:08 ` martin rudalics
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Mackenzie @ 2021-04-19 10:46 UTC (permalink / raw)
  To: emacs-devel

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).



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-20 13:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-19 10:46 What is restore_window_configuration in read_minibuf (minibuf.c) for? Alan Mackenzie
2021-04-19 12:08 ` martin rudalics
2021-04-19 14:56   ` Alan Mackenzie
2021-04-19 15:20     ` Daniel Mendler
2021-04-19 16:03       ` martin rudalics
2021-04-19 15:31     ` Stefan Monnier
2021-04-19 16:02     ` martin rudalics
2021-04-20 13:38       ` Alan Mackenzie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.