From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame Date: Wed, 6 Jul 2022 18:16:03 +0000 Message-ID: References: <83bku69nn2.fsf@gnu.org> <83iloc8yzs.fsf@gnu.org> <83h73w8f7i.fsf@gnu.org> <83zghn7ckd.fsf@gnu.org> <83zghm5evt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10382"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, 56305@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 06 20:18:34 2022 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 1o99bd-0002VL-F0 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jul 2022 20:18:33 +0200 Original-Received: from localhost ([::1]:34276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o99bc-0005NR-E9 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 06 Jul 2022 14:18:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o99aA-0004QJ-Ix for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 14:17:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o99aA-0000GT-9e for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 14:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o99aA-00008b-5S for bug-gnu-emacs@gnu.org; Wed, 06 Jul 2022 14:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Jul 2022 18:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56305 X-GNU-PR-Package: emacs Original-Received: via spool by 56305-submit@debbugs.gnu.org id=B56305.1657131373463 (code B ref 56305); Wed, 06 Jul 2022 18:17:02 +0000 Original-Received: (at 56305) by debbugs.gnu.org; 6 Jul 2022 18:16:13 +0000 Original-Received: from localhost ([127.0.0.1]:55135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o99ZM-00007P-M5 for submit@debbugs.gnu.org; Wed, 06 Jul 2022 14:16:12 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:36545 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1o99ZK-00007C-Iz for 56305@debbugs.gnu.org; Wed, 06 Jul 2022 14:16:11 -0400 Original-Received: (qmail 61191 invoked by uid 3782); 6 Jul 2022 18:16:04 -0000 Original-Received: from acm.muc.de (p4fe15bd4.dip0.t-ipconnect.de [79.225.91.212]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 06 Jul 2022 20:16:04 +0200 Original-Received: (qmail 8682 invoked by uid 1000); 6 Jul 2022 18:16:03 -0000 Content-Disposition: inline In-Reply-To: <83zghm5evt.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:236286 Archived-At: Hello, Eli and Martin. On Wed, Jul 06, 2022 at 20:29:10 +0300, Eli Zaretskii wrote: > > Date: Wed, 6 Jul 2022 17:04:40 +0000 > > Cc: rudalics@gmx.at, monnier@iro.umontreal.ca, 56305@debbugs.gnu.org, > > acm@muc.de > > From: Alan Mackenzie > > > Do you have a suggestion for a change there to improve the behavior? > > I do now. I think we should expunge the entire section of code. > I'm okay with doing that on master, but who will tell us what will > that do for Emacs 28? I hoped to be able to release Emacs 28.2 > soon-ish, so I don't want to wait for this change to collect enough > trust so that we could cherry-pick it. I think I will wait a day and see if Martin or Stefan or anybody else has anything more to say about it. > I guess that means Emacs 28.2 will have this issue unresolved, unless > someone comes up with some ideas. An idea I had on Sunday was to forcibly set the window system focus to the minibuffer frame just before the recursive edit in read_minibuf, though I didn't post a patch for it. This appears to work for me. It would look something like this: diff --git a/src/minibuf.c b/src/minibuf.c index 0fc7f2caa1..7723167d4d 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -896,6 +896,10 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, /* Don't allow the user to undo past this point. */ bset_undo_list (current_buffer, Qnil); + /* Ensure that the minibuffer frame has the window-system focus. + This is sometimes needed for minibuffer-only frames. */ + Fx_focus_frame (mini_frame, Qt); + recursive_edit_1 (); /* If cursor is on the minibuffer line, -- Alan Mackenzie (Nuremberg, Germany).