unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Drew Adams <drew.adams@oracle.com>, Alan Mackenzie <acm@muc.de>
Cc: "56305@debbugs.gnu.org" <56305@debbugs.gnu.org>,
	Eli Zaretskii <eliz@gnu.org>,
	"monnier@iro.umontreal.ca" <monnier@iro.umontreal.ca>
Subject: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame
Date: Sat, 16 Jul 2022 09:06:00 +0200	[thread overview]
Message-ID: <b572a2fc-de9d-7343-df57-35bad50c99ab@gmx.at> (raw)
In-Reply-To: <SJ0PR10MB54884AB3FA72DACEF928AF5FF3869@SJ0PR10MB5488.namprd10.prod.outlook.com>

 >> But if you display the buffer in a new frame and the window manager
 >> decides to always give focus to a new frame, that window will be
 >> selected.  It took me years to convince Drew that Emacs can't do
 >> anything about that.
 >
 > Odd.  I have no recollection of ever not being
 > convinced that frame operations are often beyond
 > Emacs's control (i.e., that window mgrs rule the
 > roost), or that `display-buffer' isn't, itself,
 > about selecting a window.

Then how about

   This is driving me crazy. I've tried a zillion ways to try to work around
   this problem, to no avail.

   On MS Windows, whenever a new frame is created, it becomes
   "selected"/"focussed". I use quote-marks here, because I think it might be
   more than what Emacs calls frame selection & focus. I admit that it's
   unclear to me just what's going on.

   ...

   I've tried every hack I can think of, from saving and restoring the selected
   buffer/window/frame, to redirecting and un-redirecting the frame focus, to
   playing with before-make-frame-hook and after-make-frame-functions. I cannot
   get the new frame to become un-"selected"/"focussed" and let me continue to
   use the minibuffer for input.

 > As I don't follow commits, could you situate the
 > change you're talking about in terms of a given
 > Emacs release or past discussion (e.g. bug thread)?
 > I'm curious about what got broken when (and why).

The original commit from 2008 can be studied here:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=6355802033d202c63f6fff4b77bf2b0c7aecceef

It was complemented in 2012 by:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=c6bf30222430f41fbb696e296f0f63f465eefc35

I have not tried to find out which one is responsible for the current
behavior nor which release first showed it.  The oldest version I can
build here is Emacs 24.  Neither of these commits hints at a prior bug
or discussion explaining why they were considered necessary.

It's interesting that these commits, while mostly acting on the function
unwind_format_mode_line, do not affect the formatting of mode lines via
display_mode_lines because the part of the vector used by these commits
is always NULL, nil or false there.  Hence the later check

   if (WINDOW_LIVE_P (old_window))

always fails when called from display_mode_line and display_mode_lines
correctly restores old window and frame via restore_selected_window.

Restoring the current buffer could be the only worthy contribution of
these changes but ironically is not done from display_mode_line - the
second argument of format_mode_line_unwind_data being NULL there.

 >> We should eliminate the original sin and be
 >> done with it once and for all.
 >
 > Probably easier said than done?

It's trivial because display_mode_lines handles it correctly.  The only
difficulty is to convince people that the commits mentioned above are
fundamentally flawed.  So far, my explanations have been met with cold
disregard.

martin





  reply	other threads:[~2022-07-16  7:06 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-29 17:54 bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame martin rudalics
2022-06-29 19:10 ` Eli Zaretskii
2022-06-30 10:35   ` Alan Mackenzie
2022-06-30 20:32   ` Alan Mackenzie
2022-07-02 11:38   ` Alan Mackenzie
2022-07-03  8:16     ` martin rudalics
2022-07-03 16:09       ` Alan Mackenzie
2022-07-03 16:17         ` Eli Zaretskii
2022-07-04 19:10           ` Alan Mackenzie
2022-07-04 19:21             ` Eli Zaretskii
2022-07-04 19:43               ` Alan Mackenzie
2022-07-05  2:29                 ` Eli Zaretskii
2022-07-05 15:59                   ` Alan Mackenzie
2022-07-05 16:24                     ` Eli Zaretskii
2022-07-05 17:09                       ` Alan Mackenzie
2022-07-06 17:04                       ` Alan Mackenzie
2022-07-06 17:29                         ` Eli Zaretskii
2022-07-06 18:16                           ` Alan Mackenzie
2022-07-06 18:34                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-06 18:58                             ` Andreas Schwab
2022-07-06 19:05                               ` Alan Mackenzie
2022-07-06 19:09                                 ` Andreas Schwab
2022-07-06 19:22                                   ` Alan Mackenzie
2022-07-07 17:25                                   ` Alan Mackenzie
2022-07-07 18:57                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-08 21:03                                       ` Alan Mackenzie
2022-07-09  2:15                                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-07  7:55                             ` martin rudalics
2022-07-07  9:12                               ` Alan Mackenzie
2022-07-08  7:01                                 ` martin rudalics
2022-07-08 10:55                                   ` Alan Mackenzie
2022-07-08 11:55                                     ` Eli Zaretskii
2022-07-08 18:31                                     ` Alan Mackenzie
2022-07-09  8:36                                       ` martin rudalics
2022-07-08 21:45                                     ` Gregory Heytings
2022-07-09  8:35                                     ` martin rudalics
2022-07-09 10:57                                       ` Alan Mackenzie
2022-07-10  8:07                                         ` martin rudalics
2022-07-10 11:34                                           ` Alan Mackenzie
2022-07-10 11:47                                             ` Eli Zaretskii
2022-07-10 12:41                                               ` Alan Mackenzie
2022-07-10 13:01                                                 ` Eli Zaretskii
2022-07-10 16:13                                             ` Drew Adams
2022-07-10 16:55                                               ` Alan Mackenzie
2022-07-11  7:45                                             ` martin rudalics
2022-07-11 11:12                                               ` Eli Zaretskii
2022-07-12  7:33                                                 ` martin rudalics
2022-07-12 16:02                                                   ` Eli Zaretskii
2022-07-11 16:22                                               ` Alan Mackenzie
2022-07-11 16:43                                                 ` Eli Zaretskii
2022-07-11 17:15                                                   ` Alan Mackenzie
2022-07-11 17:33                                                     ` Eli Zaretskii
2022-07-11 17:34                                                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-11 20:09                                                       ` Alan Mackenzie
2022-07-11 17:06                                                 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-11 20:01                                                   ` Alan Mackenzie
2022-07-12  7:35                                                 ` martin rudalics
2022-07-12 14:56                                                   ` Drew Adams
2022-07-16  7:06                                                     ` martin rudalics [this message]
2022-07-16 20:34                                                   ` Alan Mackenzie
2022-07-18  7:36                                                     ` martin rudalics
2022-07-18 14:44                                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-19  8:09                                                         ` martin rudalics
2022-07-19 16:04                                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-16 23:39                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-17 11:29                                                     ` Alan Mackenzie
2022-07-17 14:03                                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-17 15:06                                                         ` Alan Mackenzie
2022-07-18  7:37                                                     ` martin rudalics
2022-07-18 14:58                                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-18 15:58                                                         ` Eli Zaretskii
2022-07-18 16:12                                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-18 16:50                                                             ` Eli Zaretskii
2022-07-19 20:48                                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-20 12:17                                                                 ` Eli Zaretskii
2022-07-20 14:54                                                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-20 16:02                                                                     ` Eli Zaretskii
2022-07-21 15:07                                                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-21 15:58                                                                         ` Eli Zaretskii
2022-07-19  8:09                                                         ` martin rudalics
2022-07-07 15:54                           ` Alan Mackenzie
2022-07-04 19:46             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-04 19:59               ` Alan Mackenzie

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=b572a2fc-de9d-7343-df57-35bad50c99ab@gmx.at \
    --to=rudalics@gmx.at \
    --cc=56305@debbugs.gnu.org \
    --cc=acm@muc.de \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).