bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#45072: 28.0.50; Emacs switches other buffer back uncontrollably, if


From: Juri Linkov
Subject: bug#45072: 28.0.50; Emacs switches other buffer back uncontrollably, if other window's buffer is changed by user during minibuffer editing
Date: Tue, 03 Aug 2021 10:57:04 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> Yes.  But maybe read-from-minibuffer-restore-windows would be even
>> better.
>
> And `read-minibuffer-restore-windows' would be even shorter.  Attached.
>
> +  DEFVAR_BOOL ("read-minibuffer-restore-windows", 
> read_minibuffer_restore_windows,
> +            doc: /* Non-nil means restore window configurations on exit from 
> minibuffer.
> +If this is non-nil (the default), reading input with the minibuffer will
> +restore, on exit, the window configurations of the frame where the
> +minibuffer was entered from and, if it is different, the frame that owns
> +the associated minibuffer window.  If this is nil, no such restorations
> +are done.  */);
> +  read_minibuffer_restore_windows = true;

I recommend to install this patch.  Maybe it's not perfect, but works
reasonably well, and there is the high demand for this feature.
Only such additional patch is necessary:

diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 3751ba80e0..40454eed23 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2319,6 +2333,10 @@ exit-minibuffer
       (error "%s" "Not in most nested command loop"))
     (when (not (innermost-minibuffer-p))
       (error "%s" "Not in most nested minibuffer")))
+  ;; When read_minibuf doesn't restore all previous windows,
+  ;; then at least pop down the completions window.
+  (unless read-minibuffer-restore-windows
+    (minibuffer-hide-completions))
   ;; If the command that uses this has made modifications in the minibuffer,
   ;; we don't want them to cause deactivation of the mark in the original
   ;; buffer.

reply via email to

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