all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: martin rudalics <rudalics@gmx.at>
Cc: enometh@meer.net, emacs-devel@gnu.org,
	Eli Zaretskii <eliz@gnu.org>,
	Andrii Kolomoiets <andreyk.mad@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: Stop frames stealing eachothers' minibuffers!
Date: Sat, 21 Nov 2020 10:27:51 +0000	[thread overview]
Message-ID: <20201121102751.GA11643@ACM> (raw)
In-Reply-To: <a9283202-9208-d93a-4c30-5667d078256a@gmx.at>

Hello, Martin.

On Sat, Nov 21, 2020 at 10:02:15 +0100, martin rudalics wrote:
>  >> (setq default-frame-alist '((minibuffer . nil)))

>  >> (defun foo ()
>  >>     (interactive)
>  >>     (read-from-minibuffer "...?")
>  >>     (insert (format "%s" (selected-frame))))

>  >> insert (foo) into *scratch* and type C-x C-e.  After answering the
>  >> prompt this gets me #<frame *Minibuf-1* 0x36132d8>.  Do the same with
>  >> Emacs 27 and it will get you the *scratch* frame.

>  > Yes, I see this (except for the Emacs 27 bit which I haven't tried,
>  > yet).

>  > However, if I type (frame-list) into *scratch* and do C-x C-e I get only
>  > one frame in the list, and it has the same address in the #<frame ...>
>  > output as the " *Minibuf-1* 0xxxx" output.

> You have to _load_ the

> (setq default-frame-alist '((minibuffer . nil)))

> part, it won't work after your default initial frame has been already
> set up.  Run Emacs via something like

> emacs -Q --load ~/foo.el

> to see the effect ....

OK, I've got it now.

[ .... ]

> But indeed, with Emacs -Q executing 'foo' defined as

> (defun foo ()
>    (interactive)
>    (read-from-minibuffer "...?")
>    (insert (format "window: %s .. frame: %s" (selected-window) (selected-frame))))

> reveals another aspect broken by your change.  The values reported by
> 'selected-window' and 'select-frame' do not match up any more (unless
> our masochistic way of printing frame names hides an important detail).

I'll look at that later.  I'll look at the other things below [snipped]
later, too.  I'm a bit short of time today.

[ .... ]

Here's a quick and dirty patch to minibuf.c which appears to fix the bug,
but I haven't given it much testing yet:



diff --git a/src/minibuf.c b/src/minibuf.c
index 464e3018f7..5312dc9805 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -508,7 +508,14 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt,
   mini_frame = WINDOW_FRAME (XWINDOW (minibuf_window));
   if (!EQ (mini_frame, selected_frame))
     record_unwind_protect (restore_window_configuration,
-			   Fcons (Qt,
+			   Fcons (
+                                  /* If we're at top minibuffer level in a
+                                     minibuffer-only frame, arrange for the
+                                     frame later to be switched back.  */
+                                  (FRAME_MINIBUF_ONLY_P (XFRAME (mini_frame))
+                                   && minibuf_level <= 1)
+                                  ? Qnil
+                                  : Qt,
                                   Fcurrent_window_configuration (mini_frame)));
 
   /* If the minibuffer is on an iconified or invisible frame,


> martin

-- 
Alan Mackenzie (Nuremberg, Germany).



  reply	other threads:[~2020-11-21 10:27 UTC|newest]

Thread overview: 259+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 19:02 Stop frames stealing eachothers' minibuffers! Alan Mackenzie
2020-10-13 19:20 ` Eli Zaretskii
2020-10-13 19:51   ` Alan Mackenzie
2020-10-13 20:25     ` Gregory Heytings via Emacs development discussions.
2020-10-13 20:44       ` Alan Mackenzie
2020-10-13 21:02         ` Drew Adams
2020-10-14 14:34         ` Eli Zaretskii
2020-10-14 16:02           ` Alan Mackenzie
2020-10-14 16:14             ` Eli Zaretskii
2020-10-14 16:35               ` Alan Mackenzie
2020-10-14 17:05                 ` Eli Zaretskii
2020-10-14 18:45                   ` Alan Mackenzie
2020-10-14 18:58                     ` Eli Zaretskii
2020-10-14 19:49                       ` Alan Mackenzie
2020-10-15 13:44                         ` Eli Zaretskii
2020-10-15 18:01                           ` Alan Mackenzie
2020-10-15 18:18                             ` Eli Zaretskii
2020-10-21 15:19                               ` Alan Mackenzie
2020-10-21 16:49                                 ` Drew Adams
2020-10-21 19:13                                   ` Alan Mackenzie
2020-10-21 18:32                                 ` Stefan Monnier
2020-10-21 19:38                                   ` Alan Mackenzie
2020-10-21 20:04                                 ` Alan Mackenzie
2020-10-22 16:14                                   ` Eli Zaretskii
2020-10-23 20:42                                     ` C-x o is moving between frames. [Was: Stop frames stealing eachothers' minibuffers!] Alan Mackenzie
2020-10-23 20:55                                       ` Stefan Monnier
2020-10-24  7:26                                       ` Eli Zaretskii
2020-10-24 15:44                                         ` Alan Mackenzie
2020-10-24 18:40                                           ` Stefan Monnier
2020-10-24 19:29                                             ` Alan Mackenzie
2020-10-30 22:09                                     ` Stop frames stealing eachothers' minibuffers! Alan Mackenzie
2020-10-31  7:25                                       ` Eli Zaretskii
2020-10-31 16:14                                         ` Alan Mackenzie
2020-10-31 16:45                                           ` Eli Zaretskii
2020-10-31 19:44                                             ` Alan Mackenzie
2020-10-31 20:00                                               ` Eli Zaretskii
2020-10-31 20:39                                                 ` Alan Mackenzie
2020-11-01 18:35                                                   ` Eli Zaretskii
2020-11-01 19:53                                                     ` Alan Mackenzie
2020-11-01 20:52                                                       ` Non-nested minibuffers (was: Stop frames stealing eachothers' minibuffers!) Stefan Monnier
2020-11-02 17:19                                                       ` Stop frames stealing eachothers' minibuffers! Eli Zaretskii
2020-11-02 18:51                                                         ` Alan Mackenzie
2020-11-02 19:19                                                           ` Eli Zaretskii
2020-11-03 21:08                                                             ` Alan Mackenzie
2020-11-04 16:47                                                               ` Eli Zaretskii
2020-11-04 17:39                                                                 ` Alan Mackenzie
2020-11-09 15:09                                                                   ` Madhu
2020-11-09 20:34                                                                     ` Andrii Kolomoiets
2020-11-10  3:25                                                                       ` Eli Zaretskii
2020-11-10  8:08                                                                         ` Andrii Kolomoiets
2020-11-10  8:52                                                                           ` Eli Zaretskii
2020-11-10 13:21                                                                             ` Stefan Monnier
2020-11-10 17:27                                                                               ` Andrii Kolomoiets
2020-11-10 18:26                                                                                 ` Eli Zaretskii
2020-11-10 22:43                                                                                   ` Andrii Kolomoiets
2020-11-11 15:38                                                                                     ` Eli Zaretskii
2020-11-10 19:57                                                                                 ` Stefan Monnier
2020-11-10 22:54                                                                                   ` Andrii Kolomoiets
2020-11-10 23:18                                                                                     ` Stefan Monnier
2020-11-11  7:47                                                                                       ` Andrii Kolomoiets
2020-11-11 16:07                                                                                         ` Eli Zaretskii
2020-11-11 20:37                                                                                           ` Alan Mackenzie
2020-11-14 13:36                                                                                             ` Eli Zaretskii
2020-11-14 17:12                                                                                               ` Eli Zaretskii
2020-11-14 18:48                                                                                                 ` Alan Mackenzie
2020-11-14 19:11                                                                                                   ` Eli Zaretskii
2020-11-14 19:24                                                                                                   ` martin rudalics
2020-11-14 21:37                                                                                                     ` Alan Mackenzie
2020-11-15  8:48                                                                                                       ` martin rudalics
2020-11-19 10:40                                                                                         ` Alan Mackenzie
2020-11-19 11:40                                                                                           ` Andrii Kolomoiets
2020-11-19 13:30                                                                                             ` Alan Mackenzie
2020-11-20 18:47                                                                                           ` martin rudalics
2020-11-20 21:00                                                                                             ` Alan Mackenzie
2020-11-20 21:36                                                                                               ` Stefan Monnier
2020-11-21  9:02                                                                                               ` martin rudalics
2020-11-21 10:27                                                                                                 ` Alan Mackenzie [this message]
2020-11-21 11:55                                                                                                   ` martin rudalics
2020-11-21 12:45                                                                                                     ` Alan Mackenzie
2020-11-21 15:53                                                                                                       ` martin rudalics
2020-11-22 10:59                                                                                                         ` Alan Mackenzie
2020-11-22 15:13                                                                                                           ` Stefan Monnier
2020-11-22 17:11                                                                                                             ` Alan Mackenzie
2020-11-22 19:58                                                                                                               ` Stefan Monnier
2020-11-22 17:57                                                                                                           ` martin rudalics
2020-11-22 18:38                                                                                                             ` Alan Mackenzie
2020-11-23  9:10                                                                                                               ` martin rudalics
2020-11-23 13:36                                                                                                                 ` Alan Mackenzie
2020-11-23 14:22                                                                                                                   ` martin rudalics
2020-11-23 16:07                                                                                                                     ` Alan Mackenzie
2020-11-23 18:08                                                                                                                       ` martin rudalics
2020-11-23 20:16                                                                                                                         ` Andrii Kolomoiets
2020-11-24  8:46                                                                                                                           ` martin rudalics
2020-11-23 20:22                                                                                                                         ` Gregory Heytings via Emacs development discussions.
2020-11-23 20:26                                                                                                                           ` Andrii Kolomoiets
2020-11-24  8:47                                                                                                                             ` martin rudalics
2020-11-24  8:46                                                                                                                           ` martin rudalics
2020-11-24 10:25                                                                                                                             ` martin rudalics
2020-11-24 11:37                                                                                                                               ` Gregory Heytings via Emacs development discussions.
2020-11-24 19:24                                                                                                                                 ` martin rudalics
2020-11-25  9:25                                                                                                                                   ` martin rudalics
2020-11-25 21:09                                                                                                                                     ` Alan Mackenzie
2020-11-25 21:31                                                                                                                                       ` Gregory Heytings via Emacs development discussions.
2020-11-25 21:54                                                                                                                                         ` Alan Mackenzie
2020-11-25 22:23                                                                                                                                           ` Gregory Heytings via Emacs development discussions.
2020-11-27 10:02                                                                                                                                             ` Alan Mackenzie
2020-11-27 10:36                                                                                                                                               ` Gregory Heytings via Emacs development discussions.
2020-11-27 10:47                                                                                                                                                 ` Gregory Heytings via Emacs development discussions.
2020-11-27 11:20                                                                                                                                                   ` Alan Mackenzie
2020-11-27 12:03                                                                                                                                                     ` Gregory Heytings via Emacs development discussions.
2020-11-27 11:14                                                                                                                                                 ` Alan Mackenzie
2020-11-27 12:03                                                                                                                                                   ` Gregory Heytings via Emacs development discussions.
2020-11-27 15:42                                                                                                                                                     ` martin rudalics
2020-11-27 15:54                                                                                                                                                       ` Gregory Heytings via Emacs development discussions.
2020-11-27 17:14                                                                                                                                                         ` martin rudalics
2020-11-27 17:43                                                                                                                                                           ` Gregory Heytings via Emacs development discussions.
2020-11-27 18:08                                                                                                                                                             ` martin rudalics
2020-11-27 20:02                                                                                                                                                               ` Gregory Heytings via Emacs development discussions.
2020-11-27 18:50                                                                                                                                                             ` Eli Zaretskii
2020-11-26 15:44                                                                                                                                         ` martin rudalics
2020-11-26 20:32                                                                                                                                           ` Gregory Heytings via Emacs development discussions.
2020-11-27  7:33                                                                                                                                           ` Gregory Heytings via Emacs development discussions.
2020-11-27  9:34                                                                                                                                             ` martin rudalics
2020-11-27 10:06                                                                                                                                               ` Gregory Heytings via Emacs development discussions.
2020-11-27 10:36                                                                                                                                                 ` martin rudalics
2020-11-27 10:43                                                                                                                                                   ` Gregory Heytings via Emacs development discussions.
2020-11-27 15:41                                                                                                                                                     ` martin rudalics
2020-11-27 16:19                                                                                                                                                       ` Gregory Heytings via Emacs development discussions.
2020-11-27 17:14                                                                                                                                                         ` martin rudalics
2020-11-27 18:01                                                                                                                                                           ` Gregory Heytings via Emacs development discussions.
2020-11-27 18:35                                                                                                                                                             ` martin rudalics
2020-11-27 20:05                                                                                                                                                               ` Gregory Heytings via Emacs development discussions.
2020-11-28 10:45                                                                                                                                             ` Alan Mackenzie
2020-11-28 15:35                                                                                                                                               ` Alan Mackenzie
2020-11-28 17:02                                                                                                                                               ` Stefan Monnier
2020-11-28 20:59                                                                                                                                                 ` Gregory Heytings via Emacs development discussions.
2020-11-28 21:10                                                                                                                                                   ` Stefan Monnier
2020-11-28 22:01                                                                                                                                                     ` Gregory Heytings via Emacs development discussions.
2020-11-28 22:10                                                                                                                                                       ` Stefan Monnier
2020-11-28 22:38                                                                                                                                                         ` Gregory Heytings via Emacs development discussions.
2020-11-29 18:15                                                                                                                                                 ` Alan Mackenzie
2020-11-27 10:13                                                                                                                                           ` Alan Mackenzie
2020-11-27 10:36                                                                                                                                             ` martin rudalics
2020-11-27 11:30                                                                                                                                               ` Alan Mackenzie
2020-11-27 12:29                                                                                                                                               ` Eli Zaretskii
2020-11-27 13:43                                                                                                                                                 ` Gregory Heytings via Emacs development discussions.
2020-11-27 14:09                                                                                                                                                   ` Stefan Monnier
2020-11-27 15:03                                                                                                                                                   ` Eli Zaretskii
2020-11-27 22:00                                                                                                                                                   ` Alan Mackenzie
2020-11-27 15:42                                                                                                                                                 ` martin rudalics
2021-01-03 18:10                                                                                                                                               ` Alan Mackenzie
2021-01-03 18:24                                                                                                                                                 ` martin rudalics
2021-01-03 18:42                                                                                                                                                   ` Alan Mackenzie
2021-01-03 20:08                                                                                                                                                     ` martin rudalics
2021-01-03 20:43                                                                                                                                                       ` Alan Mackenzie
2021-01-04  9:20                                                                                                                                                 ` martin rudalics
2021-01-05 18:07                                                                                                                                                   ` Alan Mackenzie
2021-01-05 18:53                                                                                                                                                     ` martin rudalics
2021-01-07 17:36                                                                                                                                                       ` Alan Mackenzie
2021-01-07 18:08                                                                                                                                                         ` Drew Adams
2021-01-07 18:26                                                                                                                                                         ` martin rudalics
2021-01-10  0:53                                                                                                                                                           ` Alan Mackenzie
2021-01-10  1:34                                                                                                                                                             ` Stefan Monnier
2021-01-10 16:03                                                                                                                                                               ` Alan Mackenzie
2021-01-10 16:04                                                                                                                                                             ` martin rudalics
2021-01-10 17:18                                                                                                                                                               ` Alan Mackenzie
2021-01-10 17:30                                                                                                                                                                 ` Stefan Monnier
2021-01-10 17:49                                                                                                                                                                 ` martin rudalics
2021-01-10 18:25                                                                                                                                                                   ` Alan Mackenzie
2021-01-10 19:05                                                                                                                                                                     ` martin rudalics
2021-01-06  0:14                                                                                                                                                     ` Gregory Heytings via Emacs development discussions.
2021-01-06  0:48                                                                                                                                                       ` Stefan Monnier
2021-01-06  9:40                                                                                                                                                         ` Gregory Heytings via Emacs development discussions.
2021-01-06 15:52                                                                                                                                                           ` Stefan Monnier
2021-01-07  7:52                                                                                                                                                             ` Richard Stallman
2021-01-07 14:33                                                                                                                                                               ` Eli Zaretskii
2021-01-07 13:27                                                                                                                                                       ` Alan Mackenzie
2021-01-07 23:34                                                                                                                                                         ` Gregory Heytings via Emacs development discussions.
2020-11-26 15:43                                                                                                                                       ` martin rudalics
2020-11-27 11:53                                                                                                                                         ` Alan Mackenzie
2020-11-24 12:59                                                                                                                               ` Andrii Kolomoiets
2020-11-24 19:24                                                                                                                                 ` martin rudalics
2020-11-21 17:19                                                                                                 ` Stefan Monnier
2020-11-21 18:08                                                                                                   ` martin rudalics
2020-11-11  8:28                                                                                   ` martin rudalics
2020-11-11 18:47                                                                                     ` Drew Adams
2020-11-11 19:10                                                                                       ` martin rudalics
2020-11-10 16:45                                                                             ` Drew Adams
2020-11-10 19:51                                                                               ` Stefan Monnier
2020-11-10 20:08                                                                                 ` Eli Zaretskii
2020-11-10 20:12                                                                                 ` Drew Adams
2020-10-14 20:17                       ` Gregory Heytings via Emacs development discussions.
2020-10-14 17:07                 ` Gregory Heytings via Emacs development discussions.
2020-10-13 20:51       ` Andreas Schwab
2020-10-13 21:02         ` Gregory Heytings via Emacs development discussions.
2020-10-13 22:22         ` Stefan Monnier
2020-10-13 22:28   ` Stefan Monnier
2020-10-14 14:47     ` Eli Zaretskii
2020-10-14 17:22       ` Stefan Monnier
2020-10-14 17:32         ` Gregory Heytings via Emacs development discussions.
2020-10-14 17:47           ` Eli Zaretskii
2020-10-15  1:43             ` Stefan Monnier
2020-10-14 17:43         ` Eli Zaretskii
2020-10-15  1:42           ` Stefan Monnier
2020-10-13 19:22 ` Gregory Heytings via Emacs development discussions.
2020-10-13 22:25 ` Stefan Monnier
     [not found] <<20201031194419.GC5887@ACM>
     [not found] ` <<834kmago8m.fsf@gnu.org>
     [not found]   ` <<20201031203914.GD5887@ACM>
     [not found]     ` <<835z6ogc1h.fsf@gnu.org>
     [not found]       ` <<20201101195313.GA6190@ACM>
     [not found]         ` <<83sg9rd6cp.fsf@gnu.org>
     [not found]           ` <<20201102185147.GC7297@ACM>
     [not found]             ` <<83mtzzd0s3.fsf@gnu.org>
     [not found]               ` <<20201103210853.GA21923@ACM>
     [not found]                 ` <<83ft5pax2p.fsf@gnu.org>
     [not found]                   ` <<20201104173954.GA14535@ACM>
     [not found]                     ` <<m31rh2pnws.fsf@leonis4.robolove.meer.net>
     [not found]                       ` <<m28sbas208.fsf@gmail.com>
     [not found]                         ` <<83v9ed3nbw.fsf@gnu.org>
     [not found]                           ` <<m21rh1prap.fsf@gmail.com>
     [not found]                             ` <<CF5D4DFC-5288-4D2C-AF4A-A7D1B267CAFF@gnu.org>
     [not found]                               ` <<44261efc-da8d-44f2-9a9a-200d1683b313@default>
     [not found]                                 ` <<jwvzh3pvvmi.fsf-monnier+emacs@gnu.org>
     [not found]                                   ` <<83imad0yb3.fsf@gnu.org>
2020-11-10 20:17                                     ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2021-02-03 15:20 jakanakaevangeli
2021-02-06 15:52 ` Alan Mackenzie
2021-02-06 23:25 jakanakaevangeli
2021-02-07 12:55 ` Alan Mackenzie
2021-02-07 16:44   ` jakanakaevangeli
2021-02-07 20:26     ` Alan Mackenzie
2021-02-08 12:53       ` jakanakaevangeli
2021-02-11 11:44         ` Alan Mackenzie
2021-02-11 14:29           ` Stefan Monnier
2021-02-12  9:48             ` Alan Mackenzie
2021-03-13 18:23             ` Alan Mackenzie
2021-03-13 19:39               ` Stefan Monnier
2021-03-13 20:24                 ` Alan Mackenzie
2021-03-13 20:52                   ` Stefan Monnier
2021-03-14 18:26                     ` Alan Mackenzie
2021-03-14 18:48                       ` Eli Zaretskii
2021-03-14 20:32                       ` Stefan Monnier
2021-03-13 20:53               ` jakanakaevangeli
2021-03-14 19:17                 ` Alan Mackenzie
2021-03-14 21:23                   ` Miha Rihtaršič
2021-03-17 19:32                     ` Alan Mackenzie
2021-03-17 19:55                       ` Eli Zaretskii
2021-03-17 20:19                         ` Eli Zaretskii
2021-03-18 11:27                           ` Alan Mackenzie
2021-03-18 11:46                             ` Eli Zaretskii
2021-03-18 15:51                               ` martin rudalics
2021-03-18 16:58                                 ` Alan Mackenzie
2021-03-18 18:44                                   ` Eli Zaretskii
2021-03-19 11:40                                     ` Alan Mackenzie
2021-03-19 12:33                                       ` Eli Zaretskii
2021-03-19 15:35                                         ` Alan Mackenzie
2021-03-19 15:59                                           ` Eli Zaretskii
2021-03-20 10:28                                             ` Alan Mackenzie
2021-03-20 10:49                                               ` Eli Zaretskii
2021-03-20 12:24                                                 ` Alan Mackenzie
2021-03-20 12:49                                                   ` Miha Rihtaršič
2021-03-20 13:59                                                     ` Stefan Monnier
2021-03-21 10:30                                                     ` Alan Mackenzie
2021-03-21 10:38                                                       ` Eli Zaretskii
2021-03-21 10:40                                                         ` Eli Zaretskii
2021-03-21 14:49                                                         ` Alan Mackenzie
2021-03-21 15:00                                                           ` Stefan Monnier
2021-03-21 15:43                                                           ` Eli Zaretskii
2021-03-21 16:17                                                             ` Michael Welsh Duggan
2021-03-21 16:37                                                             ` Alan Mackenzie
2021-03-20 12:50                                                   ` Eli Zaretskii
2021-03-20 13:51                                                     ` Alan Mackenzie
2021-03-20 13:55                                                   ` Stefan Monnier
2021-03-20 14:01                                                     ` Eli Zaretskii
2021-03-20 14:12                                                     ` Alan Mackenzie
2021-03-21 15:44                       ` Miha Rihtaršič
2021-03-21 17:03                         ` 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

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

  git send-email \
    --in-reply-to=20201121102751.GA11643@ACM \
    --to=acm@muc.de \
    --cc=andreyk.mad@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=enometh@meer.net \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.