From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#47894: 28.0.50; isearch does not work if enable-recursive-minibuffers is on and some input method is set. Date: Wed, 21 Apr 2021 20:02:02 +0300 Organization: LINKOV.NET Message-ID: <87o8e7bmgl.fsf@mail.linkov.net> References: <87eef6p8bh.fsf@gmail.com> <874kg0d8ui.fsf@mail.linkov.net> <192e82f20f7e5133aaea@heytings.org> <6f6e4aa5-9fdf-b4e6-04d5-c43448d67623@gmx.at> <192e82f20f92affaec0e@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1806"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: max.brieiev@gmail.com, 47894@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 21 19:07:27 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 1lZGJw-0000K4-So for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Apr 2021 19:07:24 +0200 Original-Received: from localhost ([::1]:43364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZGJv-000189-Lm for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 21 Apr 2021 13:07:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lZGJa-00017g-Gc for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2021 13:07:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lZGJa-0004en-98 for bug-gnu-emacs@gnu.org; Wed, 21 Apr 2021 13:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lZGJZ-00030t-WE; Wed, 21 Apr 2021 13:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 21 Apr 2021 17:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47894 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 47894-submit@debbugs.gnu.org id=B47894.161902478211528 (code B ref 47894); Wed, 21 Apr 2021 17:07:01 +0000 Original-Received: (at 47894) by debbugs.gnu.org; 21 Apr 2021 17:06:22 +0000 Original-Received: from localhost ([127.0.0.1]:59691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZGIw-0002zs-BA for submit@debbugs.gnu.org; Wed, 21 Apr 2021 13:06:22 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:36417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lZGIq-0002zJ-BV for 47894@debbugs.gnu.org; Wed, 21 Apr 2021 13:06:20 -0400 X-Originating-IP: 91.129.102.166 Original-Received: from mail.gandi.net (m91-129-102-166.cust.tele2.ee [91.129.102.166]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id B8E1F1C0004; Wed, 21 Apr 2021 17:06:08 +0000 (UTC) In-Reply-To: <192e82f20f92affaec0e@heytings.org> (Gregory Heytings's message of "Wed, 21 Apr 2021 07:49:28 +0000") 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:204642 Archived-At: --=-=-= Content-Type: text/plain >> For users (eq (current-buffer) (window-buffer)) _should_ be >> invariant. When and if an application temporarily violates that >> invariant, it should reestablish it before the user can see it. So if an >> application calls `display-buffer' in a state where the invariant does >> not hold, it should handle that case including the complication that >> `display-buffer' might have selected another window. And it goes without >> saying that a display buffer action should never violate that invariant. > > I see. So in this case the bug was elsewhere as I thought, it's > display-buffer-select which was wrong (as you said it should have used > pop-to-buffer) and not the code I added in > isearch-post-command-hook. Anyway using (window-buffer (selected-window)) > should not harm, and is an extra safety against display buffer actions > doing something weird. As this bug report indicates, automatically exiting isearch does more harm. So rather than forcibly exit isearch, we could select the original window back, in the same vein as isearch-back-into-window in the same hook moves point back to the old window boundaries: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=isearch-post-command-hook-select-window.patch diff --git a/lisp/isearch.el b/lisp/isearch.el index f1e6e3eba2..1dfb0c86fc 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3052,6 +3057,8 @@ isearch-pre-command-hook (isearch-clean-overlays))))) (defun isearch-post-command-hook () + (unless (eq (selected-window) (old-selected-window)) + (select-window (old-selected-window))) (when isearch-pre-scroll-point (let ((ab-bel (isearch-string-out-of-window isearch-pre-scroll-point))) (if ab-bel --=-=-=--