unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Alan Mackenzie <acm@muc.de>, Eli Zaretskii <eliz@gnu.org>
Cc: "al@petrofsky.org" <al@petrofsky.org>,
	"rudalics@gmx.at" <rudalics@gmx.at>,
	"monnier@iro.umontreal.ca" <monnier@iro.umontreal.ca>,
	"63967@debbugs.gnu.org" <63967@debbugs.gnu.org>
Subject: bug#63967: 28.2; switch-to-buffer in normal window fails if minibuffer window is active
Date: Sun, 11 Jun 2023 14:35:59 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488540494768F247C04D507F357A@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <ZIXO5KNYzNcuEMh-@ACM>

> > > Perhaps we should modify the minibuffer code
> > > to note which window should be current after
> > > the completion or abortion of the minibuffer
> > > read action.
> 
> > Isn't that simply "the window which was selected
> > before entering the minibuffer"?
> 
> Most of the time, yes.  If that window no longer
> exists on termination of the minibuffer, or we've
> moved to a different frame, things aren't so simple.

You can and will ignore this, but IMO _all_ of
the above is misguided and short-sighted.  "Isn't
that simply...?" is just plain wrong - both the
question and any single answer.

It isn't "simply" _anything_ you can preconceive.
It's _whichever window ended up_ selected after
using the minibuffer.  Nothing more, nothing less.

Let's-hard-code-which-window-should-be-selected
is maybe related to the fact that I can no longer
use Emacs > 26.3.

What's wrong with attempts to predetermine which
window should be selected after a minibuffer
read?

It's the presumption that a minibuffer's only
purpose is to return something read, and that the
state of Emacs, including which windows exist and
which should be selected, should be the same as
before the minibuffer was entered - or should be
any other predefined state.  The selected window
here shouldn't be determined formulaically.

This completely prevents or interferes with code
that _does things_ while the minibuffer is active
with the intent of changing such state, e.g., the
intent to change the selected window, and not
just till minibuffer reading is finished.

There.  I've said it again.  And clearly Emacs
won't be going back to its former freedom in
this regard - 1000 ships have sailed.  But IMO
this is a great loss.  And it comes, I think,
from assuming that others use existing behavior
only the way you do.

My use of Emacs relies on doing lots of things
while a minibuffer is active - including things
that you might do only when it's inactive.  And
the changes I make while its active shouldn't
be overridden when a minibuffer is exited.

And yes, this can include changing the selected
window and focused frame.  I want to be able to
do that myself, interactively or by definition
from the function that invoked the minibuffer.

To my mind you've hobbled Emacs - specifically
its minibuffer, just as much as if you'd poked
out its eyes or cut off its legs.

If you'd really wanted to provide only some
_default_ behavior wrt choosing the window to
select here, then you'd have done that.  You'd
have provided some way (e.g., a variable) for
code to _prevent_ force-selecting the window
you've predetermined to be the "chosen one".

The Emacs minibuffer was "simply" better
before you simply "fixed" it.





  parent reply	other threads:[~2023-06-11 14:35 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08 21:32 bug#63967: 28.2; switch-to-buffer in normal window fails if minibuffer window is active Al Petrofsky
2023-06-09 11:16 ` Eli Zaretskii
2023-06-09 15:08   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09 16:09     ` Eli Zaretskii
2023-06-09 19:18       ` Eli Zaretskii
2023-06-10 15:49         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-10 19:42           ` Alan Mackenzie
2023-06-11  5:03             ` Eli Zaretskii
2023-06-11 13:40               ` Alan Mackenzie
2023-06-11 13:53                 ` Eli Zaretskii
2023-06-13 18:43                   ` Eli Zaretskii
2023-06-13 21:36                     ` Alan Mackenzie
2023-06-14 12:15                       ` Eli Zaretskii
2023-06-15 10:25                         ` Alan Mackenzie
2023-06-17 11:31                         ` Alan Mackenzie
2023-06-17 13:08                           ` Eli Zaretskii
2023-06-17 13:52                           ` martin rudalics
2023-06-17 16:23                             ` Alan Mackenzie
2023-06-17 18:46                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-11 14:35                 ` Drew Adams [this message]
2023-06-11 16:01                   ` Alan Mackenzie
2023-06-12  7:17                     ` martin rudalics
2023-06-12 12:04                       ` Eli Zaretskii
2023-06-11 16:12                   ` Eli Zaretskii
2023-06-09 16:52   ` Gregory Heytings
2023-06-09 17:21     ` Eli Zaretskii
2023-06-09 20:04       ` Gregory Heytings
2023-06-10  5:59         ` Eli Zaretskii
2023-06-10  6:39           ` Gregory Heytings
2023-06-10  6:45             ` Eli Zaretskii
2023-06-10  8:45               ` Gregory Heytings
2023-06-10  6:52   ` martin rudalics
2023-06-10  8:28     ` Eli Zaretskii
2023-06-10 14:51       ` martin rudalics
2023-06-10 17:09         ` Eli Zaretskii
2023-06-11  8:10           ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB5488540494768F247C04D507F357A@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=63967@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=al@petrofsky.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).