From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Micha=C5=82?= Krzywkowski Newsgroups: gmane.emacs.bugs Subject: bug#34972: [PATCH] Use a different name for the help buffer in query-replace Date: Mon, 01 Apr 2019 11:12:20 +0200 Message-ID: <87imvyytqj.fsf@gmail.com> References: <87wokophsk.fsf@gmail.com> <87d0m6regr.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="49867"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.0; emacs 27.0.50 Cc: =?UTF-8?Q?Micha=C5=82?= Krzywkowski , 34972@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 01 11:14:43 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hAt1c-000CoH-7w for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Apr 2019 11:14:40 +0200 Original-Received: from localhost ([127.0.0.1]:34262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAt1b-00028D-2P for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Apr 2019 05:14:39 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hAt04-0001CP-Cq for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 05:13:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hAt03-000722-5I for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 05:13:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hAt02-00071f-JG for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 05:13:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hAt02-0007Hs-9x for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2019 05:13:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Micha=C5=82?= Krzywkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Apr 2019 09:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34972 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 34972-submit@debbugs.gnu.org id=B34972.155410995527975 (code B ref 34972); Mon, 01 Apr 2019 09:13:02 +0000 Original-Received: (at 34972) by debbugs.gnu.org; 1 Apr 2019 09:12:35 +0000 Original-Received: from localhost ([127.0.0.1]:38826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAsza-0007H8-Sd for submit@debbugs.gnu.org; Mon, 01 Apr 2019 05:12:35 -0400 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:40363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hAszZ-0007Gu-Dr for 34972@debbugs.gnu.org; Mon, 01 Apr 2019 05:12:33 -0400 Original-Received: by mail-wr1-f45.google.com with SMTP id h4so10922099wre.7 for <34972@debbugs.gnu.org>; Mon, 01 Apr 2019 02:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=4rYP4in7NMKdAX0PLkNDwxZzYTtfOpwnC9DHNaEYiVs=; b=GPzELgFZGQpWG/sRwe1ykulCva7dBCKF4RV1C2UNO0wngrxoYkjmbes3Sr6qDI4Wz0 f5GFVrCR8s23OFiyRHOI1sI+Wjs+2I2Thz0Dq2Fe6UGuuSZ8ZgieO0LPq9zd4HDgM7lU gasOkgIyg5yG2W7FLLQ9D9untCM1x+gb8/D1PvuqstQ0RBx9Qetjof846su9jcqm/YG4 AYbUGKb4q6k3tp+AjPYyyUaODasY9AECbpzHYbwrJuHKJign5PEbGYBEgaw54GanYW/5 wZHqPBl6CmnvjGJV5d20NwnL9TmOAw6USQzq8wm34Q9u2gOhzBVGzNYfrp6XLFtJJBHN rdag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=4rYP4in7NMKdAX0PLkNDwxZzYTtfOpwnC9DHNaEYiVs=; b=B9molO7Zy+LfkjdI41+/h88q7b7BJJ3sIxDRtzzuynydpI2xxwE7OS/Dg8FKxpmP/I 5qx4V/Slw/XCgaLIGowPKu6D6M5oH7x5DKE+eYwcjrDJHXMQI46qkASjBiF6gSiEIJjv DEPrHVCoHZbJilRdpszfe5HZnPCYaxKtgBqAMi2+eJOhtLqRwyMEH3+Rnf5QrpjRfYqQ K7S6xz7CZb4ygv+IMjj+9t6VgHQewNzGsSSADELpU1MWWxtQLzbCRbYRXGhY+qF6A7IW XBBYAwqbIVilmkc7HhE9mS7YANhPG74SO+8BvdfoQMyf/HE/0Qfs0Uw0uuNeGiuViM6E IB3w== X-Gm-Message-State: APjAAAVJX91CQaW+7Tew+GWbKWJDgJ22iWqzNwdh04ZWiAYXdA7FRSyT J2ArnijoYMNvQfb4AUh6I9t0IGcV X-Google-Smtp-Source: APXvYqwxK5oDK0a0lT+4tiNCzL5qymPuW4LrQrZfn7SGQeNwwsK/eCHW6T+euRZ/79ZjGtY5GEP3FA== X-Received: by 2002:a5d:4492:: with SMTP id j18mr33679451wrq.212.1554109946972; Mon, 01 Apr 2019 02:12:26 -0700 (PDT) Original-Received: from debian ([195.182.34.201]) by smtp.gmail.com with ESMTPSA id h18sm13925611wrt.97.2019.04.01.02.12.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Apr 2019 02:12:26 -0700 (PDT) In-reply-to: <87d0m6regr.fsf@mail.linkov.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:157012 Archived-At: --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Hi Juri, >> There are a couple of ways to improve behavior of perform-replace: >> >> - Use a different name for the query-replace help buffer (patch attached) >> - Make 'C-l' or some other key bury the help buffer, if it was displayed >> in the main window >> - Make '?' toggle visibility of the help buffer >> - Allow switching windows in query-replace >> - Display the help message in the minibuffer > > To solve the same problem, isearch binds display-buffer-overriding-action > to isearch--display-help-action with '(nil (inhibit-same-window . t)) > that forces the *Help* buffer to be displayed in another window. Thanks for letting me know. I'm attaching a different patch which uses display-buffer-overriding-action. Does it look OK? --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Inhibit-displaying-help-buffer-in-main-window-in-per.patch Content-Transfer-Encoding: quoted-printable Content-Description: Patch From=20c3a1806b355228b28b70ddce716b6f578e9eacb1 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Micha=3DC5=3D82=3D20Krzywkowski?=3D Date: Mon, 1 Apr 2019 10:26:46 +0200 Subject: [PATCH] Inhibit displaying help buffer in main window in perform-replace * lisp/replace.el (perform-replace): Use display-buffer-overriding-action with inhibit-same-window to prevent the help buffer from being displayed in the main window. (Bug#34972) =2D-- lisp/replace.el | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index 318a9fb025..bd96fc3300 100644 =2D-- a/lisp/replace.el +++ b/lisp/replace.el @@ -2643,22 +2643,24 @@ perform-replace (setq def (lookup-key map key)) ;; Restore the match data while we process the command. (cond ((eq def 'help) =2D (with-output-to-temp-buffer "*Help*" =2D (princ =2D (concat "Query replacing " =2D (if backward "backward " "") =2D (if delimited-flag =2D (or (and (symbolp delimited-flag) =2D (get delimited-flag =2D 'isearch-message-p= refix)) =2D "word ") "") =2D (if regexp-flag "regexp " "") =2D from-string " with " =2D next-replacement ".\n\n" =2D (substitute-command-keys =2D query-replace-help))) =2D (with-current-buffer standard-output =2D (help-mode)))) + (let ((display-buffer-overriding-action + '(nil (inhibit-same-window . t)))) + (with-output-to-temp-buffer "*Help*" + (princ + (concat "Query replacing " + (if backward "backward " "") + (if delimited-flag + (or (and (symbolp delimited-flag) + (get delimited-flag + 'isearch-message-p= refix)) + "word ") "") + (if regexp-flag "regexp " "") + from-string " with " + next-replacement ".\n\n" + (substitute-command-keys + query-replace-help))) + (with-current-buffer standard-output + (help-mode))))) ((eq def 'exit) (setq keep-going nil) (setq done t)) =2D-=20 Micha=C5=82 Krzywkowski PGP: A5A7 06C4 28EF 8F64 2868 13A1 7BDE C129 F0B8 09A1 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D- Micha=C5=82 Krzywkowski PGP: A5A7 06C4 28EF 8F64 2868 13A1 7BDE C129 F0B8 09A1 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEWxyvIOWnapfz9K2Z20CneWXMPiIFAlyh1fQACgkQ20CneWXM PiLDPAf/WMIe87AOK+88CrTo+R5n4pg2rt89hW+nzRZYXX3S2MX5zl38HWy2dsNc 2F4XTQ2ZL1GHpX6omlEeGsLH3UzYq6MCn8ijHRGCyOFyTwwysjPOxwLOMvIrhgJW vzOuRUsM6Vd1F4sCK7LmXCsGtKPT81MixcmntxFM9q8IIXtETHBoHG0ugdDhAbhV xSnU5VxCVz1P6hnz9jPfmCRpSzwh22rcPWFPUGELVuhuEnyVwoXE7dU3XZ+y7CRU cSdghsWPV3ecl1z2HSOZyFgBTmBrqImETixcT12PYWlOr+nWzYp/etQoXRTikjYB MCnkRzBgQHhy7/++19mDJ+DGGq1bFQ== =GltU -----END PGP SIGNATURE----- --==-=-=--