From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs 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 Message-ID: <87fsvr55n7.fsf@linkov.net> References: <86eek3hvu5.fsf@protected.rcdrun.com> <87eek1fvgf.fsf@gnus.org> <83eek18ref.fsf@gnu.org> <835z5d8lhc.fsf@gnu.org> <87lfe8jsok.fsf@gnus.org> <83h7ow70ty.fsf@gnu.org> <7a7c3ef0-619d-cd76-a4e4-040009e33d75@gmx.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35831"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , bugs@gnu.support, 45072@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 03 10:16:59 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mApbe-0009AB-0h for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Aug 2021 10:16:58 +0200 Original-Received: from localhost ([::1]:60326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mApbc-000260-Rw for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 Aug 2021 04:16:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37078) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mApal-0008KK-D3 for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 04:16:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56500) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mApal-0004AB-53 for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 04:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mApal-00080O-1e for bug-gnu-emacs@gnu.org; Tue, 03 Aug 2021 04:16:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Aug 2021 08:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45072 X-GNU-PR-Package: emacs Original-Received: via spool by 45072-submit@debbugs.gnu.org id=B45072.162797854630709 (code B ref 45072); Tue, 03 Aug 2021 08:16:02 +0000 Original-Received: (at 45072) by debbugs.gnu.org; 3 Aug 2021 08:15:46 +0000 Original-Received: from localhost ([127.0.0.1]:39806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mApaU-0007zF-Eh for submit@debbugs.gnu.org; Tue, 03 Aug 2021 04:15:46 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:48479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mApaS-0007yn-HE for 45072@debbugs.gnu.org; Tue, 03 Aug 2021 04:15:44 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 5746B1C0007; Tue, 3 Aug 2021 08:15:35 +0000 (UTC) In-Reply-To: <7a7c3ef0-619d-cd76-a4e4-040009e33d75@gmx.at> (martin rudalics's message of "Wed, 9 Dec 2020 10:33:26 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211089 Archived-At: --=-=-= Content-Type: text/plain >> 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=read-minibuffer-restore-windows-exit-minibuffer.patch 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. --=-=-=--