From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#48674: Frames and minibuffer bug Date: Fri, 28 May 2021 10:26:32 +0200 Message-ID: References: <1911d1b0-ed9f-7359-b28c-fbaef27df8f3@gmx.at> <1e21b121-91c1-cbe9-d9ae-24915f163ae5@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28374"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48674@debbugs.gnu.org, Iris =?UTF-8?Q?Garc=C3=ADa?= To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 28 10:27:11 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 1lmXpn-0007GL-5d for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 May 2021 10:27:11 +0200 Original-Received: from localhost ([::1]:43286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmXpm-0007pw-76 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 May 2021 04:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmXpe-0007n8-9z for bug-gnu-emacs@gnu.org; Fri, 28 May 2021 04:27:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmXpe-00074r-2X for bug-gnu-emacs@gnu.org; Fri, 28 May 2021 04:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lmXpd-0004UZ-VN for bug-gnu-emacs@gnu.org; Fri, 28 May 2021 04:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 May 2021 08:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48674 X-GNU-PR-Package: emacs Original-Received: via spool by 48674-submit@debbugs.gnu.org id=B48674.162219040217242 (code B ref 48674); Fri, 28 May 2021 08:27:01 +0000 Original-Received: (at 48674) by debbugs.gnu.org; 28 May 2021 08:26:42 +0000 Original-Received: from localhost ([127.0.0.1]:53564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmXpJ-0004U1-Rw for submit@debbugs.gnu.org; Fri, 28 May 2021 04:26:42 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]:41041) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmXpJ-0004Tq-4f for 48674@debbugs.gnu.org; Fri, 28 May 2021 04:26:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1622190393; bh=RFg2FgJISvoqlEfiTww/wlX4ewkJnIbpoHPr1oXq0bI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=DjO/BknqKXGOHqFh+5g8a472/7pHgijOSex200gS7jPTXH5CQff9w/+sqULKbaXiH D45e8WussZut3cuICEjHRRwZDBU6FWSiCRMAUj5++cVhw3bFy1J0Mc5NoAeZXMbVjX GU49hLBXNg3QLE2Xdvr9OQT9Omx4hfJpNrhXw+T0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.100] ([212.95.5.65]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MulqN-1lVhhC2KEV-00rnQl; Fri, 28 May 2021 10:26:33 +0200 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:CLkTnGBQS89C8AWlazeFIoBYm9MBK+g1LJnwIUlHWG/ENV1LvHo 9GheXMr9y+oCLTszqtmji0R1xoyNR/60vD//OG1JS5B7SJmNZvDIodjLusz5wITtKPboXzn 2ys6GlfwkYEfHJOlXDAJxdKpk7GIZYQJpZbFKAb05vjhPTJB9Azf/qXEa3wk2jxbF1Ynb66 4ncdT3/LkEHWVLyf72N5Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:wC0vMko5Du8=:/SDN5ktRnb19OMEePobNOv iZ2iMw75ZmJa2J9gX+kXY80MlGKH+jnwhmbcjeip705uhwjrz5dgxYoqoPT7tUeEqWXcbIwdF Jnyx6jUV2xhZJizZDlMHotXQ8dOMYlnigtZv9jl4ymVzkopXZt89QxAwDVWp90X0TPlI5UoNI ZbqtXLCwSyciapg00W7qm1tw+yIxRIIRRNbvZmuCHb/OUqKtKlrQJ49vkbwkgQvK9XU3bVf/r 3un+tafr8gyk7cqyg+SwZDtgw+AbzabQ7qD6XDVqr8gQzepglE+zxM3nRF95OgGLPPA4uNkQ3 n8TIcIBII8OoYweUUDHMxI0HJR2N4qBIkx8Gi5YQG9BmeYRmeTVmBQPuzI2pK2GJgfTZrk5Bf gqPky2Ls2zXXt1LmESQQtVxBrCkXD6+Fk06lCEukMhkPs5SvTj32NxrOVCQD73cN56mBtzWpT KIZHPAlcFVGFbuGLtNUUkae7lqR9v4qCn3RrSOtkY2GAN79AGmbN6E4S7tmDfE833NWyz+J9y p69T/Kv4nsOjqyqSzJl91DxGRTe+lWpUVk41oROzgMcoYNcQ4TNz5eYy/2nuLf5jmTLNkS82X 62bLsM4RaDxAX8f/X7InxDekzDX5pZEmXUso/Wb6XlBEgGEN0u79MQs7BxwJtRljXbZhw70FM 4xsCyzwE+0R6GqS7eHPzqfj9riVWDWQpi8XmicluEAtCcPKViCWu7RFnGeVzJzVRlPcOSqq6P Ty4c8Og6GihgpG/w1xEI1rovRXPTi9lREmsg+p7cZ6nCcZ+wz9z/7XaeTO0UIInWWQeTGqIb 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:207447 Archived-At: >> Does this mean that the > >> Fselect_window (f->selected_window, norecord); > >> in do_switch_frame fails? If so, why? > > For some values of "fails", yes. When we're in frame F1's minibuffer, > and do (with-selected-frame F2 (foo)): > (i) Frame F2 becomes selected. > (ii) The current window in F1 ceases to be the mini-window, becoming some > other window. > (iii) The minibuffer is moved from F1 to F2. > > (iv) We evaluate (foo). > > (v) Frame F1 becomes selected again. > (vi) The current window in F1 doesn't revert to being the mini-window. But why precisely does Fselect_window fail here? > This is what has preoccupied me over the last few hours. It seems we > want do_switch_frame to do different things for (i) a "permanent" frame > switch (e.g. C-x 5 o) and (i) a "temporary" frame switch (e.g. > with-selected-frame). If the selected window in F1 is the mini-window, > we want it to select a different window in (i), but stay the same in > (ii). Be careful in one additional regard: The display engine calls Fselect_window too for its own purposes. >> Are we sure that we want to disallow a function on >> `minibuffer-setup-hook' to change the selected window? With Emacs 27 > > >> (defun foo () >> (select-window (frame-first-window))) > >> (add-hook 'minibuffer-setup-hook 'foo) > > >> works without any problems here. > > Are you sure? For me, that setup makes C-x C-f open a minibuffer, but > leave point in the same window, not the miniwindow. That was a quick try > with the emacs-27 branch, not Emacs 27.{1,2}, and was on a GUI. Yes. But this is an effect the user/application might want - explicitly select some other window to, for example (I'm purely speculating), select a completion window right away. Iris OTOH never wants to select another window explicitly. > I think we should disallow selecting windows in minibuffer-setup-hook. > This hook is run after the mini-window has been selected in read_minibuf, > just before the recursive edit. We cannot disallow it. We can only undo its effect. And that would constitute an incompatible change - do you really want to go for it? martin