From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Teika Kazura Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Dec 2012 04:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13178@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.13554579127630 (code B ref -1); Fri, 14 Dec 2012 04:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Dec 2012 04:05:12 +0000 Received: from localhost ([127.0.0.1]:41644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjMWN-0001z0-O3 for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:05:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33542) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjMWL-0001yt-LO for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:05:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjMVP-0004lF-Fa for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:04:14 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMVP-0004lB-CQ for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:04:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMVM-0001F4-NG for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:04:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjMVJ-0004kn-TC for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:04:08 -0500 Received: from karen.lavabit.com ([72.249.41.33]:45688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMVJ-0004kb-PP for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:04:05 -0500 Received: from a.earth.lavabit.com (a.earth.lavabit.com [192.168.111.10]) by karen.lavabit.com (Postfix) with ESMTP id AD93911BC8B; Thu, 13 Dec 2012 22:04:04 -0600 (CST) Received: from localhost (p1143-ipad308hodogaya.kanagawa.ocn.ne.jp [124.85.82.143]) by lavabit.com with ESMTP id LDBKFOSRH1QR; Thu, 13 Dec 2012 22:04:04 -0600 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=xG2G0bI9wRT7jcJcERnMBuJJjk7uCxUCRVohhXcFJ1t7kx34Ekl5pj7qY7nvrYrc3dE3fWKdFq8EuJAjwDxfCRqqJn36tD/gFGyfwqsRZrynkT6RaoioE/r886g3vGgTNAuer9KgxNMw9cni31bSIp7qJOmLmnpEHPm9USvEcfw=; h=Date:Message-Id:To:Subject:From:Mime-Version:Content-Type:Content-Transfer-Encoding; Date: Fri, 14 Dec 2012 13:03:20 +0900 (JST) Message-Id: <20121214.130320.1173151390202861752.teika@lavabit.com> From: Teika Kazura Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hi, Emacs developers. In Emacs 24.1, query-replace soon after narrow-to-region fails. More precisely, minibuffer says "Replaced 0 occurrences", and the query-replace finishes even if there're matches. I don't think it's a recent regresion. Steps to reproduce: 0. emacs -Q 1. Open a buffer. 2. Set mark, and do narrow-to-region 3. Move to the top of the narrowed buffer. 4. Do query-replace. 5. minibuffer says "Replaced 0 occurrences", and the query-replace finishes. If you do query-replace again, then it starts correctly. It seems that some extra commands between each step hinder to reproduce. Probably you have to enable narrow-to-region beforehand, and query-replace history is necessary, so that "M-% " can invoke a query-replace. In fact, it was already reported in bug #8952: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8952 but as a "wishlist", mixed with several other things. So I dare to submit a separate entry. I've been bothered by this bug for years, but I didn't know how to reproduce it. Thank you in advance. Best regards, Teika (Teika kazura) From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Teika Kazura Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Feb 2015 08:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13178@debbugs.gnu.org Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.14250247871164 (code B ref 13178); Fri, 27 Feb 2015 08:14:01 +0000 Received: (at 13178) by debbugs.gnu.org; 27 Feb 2015 08:13:07 +0000 Received: from localhost ([127.0.0.1]:59224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRG2l-0000Ii-1p for submit@debbugs.gnu.org; Fri, 27 Feb 2015 03:13:07 -0500 Received: from mout.gmx.com ([74.208.4.200]:52312) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRG2i-0000I2-Kj for 13178@debbugs.gnu.org; Fri, 27 Feb 2015 03:13:05 -0500 Received: from localhost ([123.218.132.201]) by mail.gmx.com (mrgmxus002) with ESMTPSA (Nemesis) id 0MDQDb-1YHcTU1oth-00GrxP; Fri, 27 Feb 2015 09:12:58 +0100 Date: Fri, 27 Feb 2015 17:12:30 +0900 (JST) Message-Id: <20150227.171230.1758903055908506043.teika@gmx.com> From: Teika Kazura In-Reply-To: <20121214.130320.1173151390202861752.teika@lavabit.com> References: <20121214.130320.1173151390202861752.teika@lavabit.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Ifk1sXECgv+Yby08lLywCGQ/m711pGgd4JUdIP7DCUE/smlmXo3 9VcBn+qANzxSQoekf4haT+UPOoumh+QiWvnieUzCPDjTK2l3SVXxMtBhxO01/OF/jziJ+BW 1t7rOg/vIhy+MBzoioXP1PrB+x295OgMvgp0+1HKTZlquLogSyDyV016ALFTz5nHfSsTO7p BtqTga53qXA249uoWpjjA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) unarchive 13178 Sorry, it's not a bug, but a specification. If a region is active, `query-replace' (together with `replace-string') gets narrowed inside there. I didn't know that, and activated a zero-size region in the procedure described above. If you want to discuss it further, please go to bug #8952: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8952 Thanks, Teika (Teika kazura) From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Feb 2015 15:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Teika Kazura , 13178@debbugs.gnu.org Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142504932818085 (code B ref 13178); Fri, 27 Feb 2015 15:03:01 +0000 Received: (at 13178) by debbugs.gnu.org; 27 Feb 2015 15:02:08 +0000 Received: from localhost ([127.0.0.1]:60108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRMQa-0004hc-1V for submit@debbugs.gnu.org; Fri, 27 Feb 2015 10:02:08 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:28375) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRMQX-0004h8-QS for 13178@debbugs.gnu.org; Fri, 27 Feb 2015 10:02:06 -0500 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t1RF1wUJ017175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 Feb 2015 15:01:59 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id t1RF1vPK023662 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Feb 2015 15:01:58 GMT Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.13.8/8.13.8) with ESMTP id t1RF1vHt008515; Fri, 27 Feb 2015 15:01:57 GMT MIME-Version: 1.0 Message-ID: <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> Date: Fri, 27 Feb 2015 07:01:52 -0800 (PST) From: Drew Adams References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> In-Reply-To: <20150227.171230.1758903055908506043.teika@gmx.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > Sorry, it's not a bug, but a specification. >=20 > If a region is active, `query-replace' (together with `replace-string') g= ets > narrowed inside there. I didn't know that, and activated a zero-size reg= ion > in the procedure described above. Just FYI - It might help you recognize this situation if you use library `mode-line-posn.el'. It has the following behavior, which addresses the gotcha you mention: 1. The size of the region is shown in the mode line when the region is acti= ve. =20 Option `modelinepos-empty-region-flag' determines whether to also indica= te an empty active region. By default it is t, meaning indicate an empty active region. 2. Option `modelinepos-style' lets you choose the region info shown when th= e region is active: (a) number of chars, (b) number of chars and lines, or (c) anything else you might want. Choice (b) is the default. 3. The region highlighting in the mode-line is changed to a different face when you invoke a command that behaves specially for an active region, such as `query-replace'. The fact that `modelinepos-empty-region-flag' is non-nil by default means that whenever the region is active but empty you can easily notice this. #3 means that you can immediately tell when the region is active and you are currently using a command whose behavior changes when the region is active. More info and screenshots here: http://www.emacswiki.org/emacs/ModeLinePosition I proposed such behavior for Emacs, but there was no interest in it. It helps me. Maybe it will help you too. From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Feb 2015 19:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Cc: Teika Kazura , 13178@debbugs.gnu.org Reply-To: bruce.connor.am@gmail.com Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142506666612114 (code B ref 13178); Fri, 27 Feb 2015 19:52:02 +0000 Received: (at 13178) by debbugs.gnu.org; 27 Feb 2015 19:51:06 +0000 Received: from localhost ([127.0.0.1]:60217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRQwE-00039J-EI for submit@debbugs.gnu.org; Fri, 27 Feb 2015 14:51:06 -0500 Received: from mail-ob0-f176.google.com ([209.85.214.176]:55747) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YRQwB-00038p-Ov for 13178@debbugs.gnu.org; Fri, 27 Feb 2015 14:51:04 -0500 Received: by mail-ob0-f176.google.com with SMTP id wo20so20594014obc.7 for <13178@debbugs.gnu.org>; Fri, 27 Feb 2015 11:50:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:cc:content-type; bh=vRxw5sa0ADw0M2nb+QZibK3AYFaMpvaK7pXTkkA2OMA=; b=l+QtAsEvjnE5RG264YqTmjcLz/CmLpBXy4IctsIs5ypT65R2iHde92nX3Es18KJy3k +G1Ss0FbH0rLdw6ERxL3R5dEeB9XPeAaXOKInTynaOzFjVyCVnv+T7CG6nz+iyomur3k suhAdukZ/MiqQelbfGUm86jiMPGyeHzM4A9tn1c84gR8hdsG6QtPh/osec0BXiLVjmsD WSJCvxMjyl9F3E4yDwa4m4fdSLEcKS3EWgKPxUGXNlzZXMFUpIDN0aGPodFDQF+U3dqJ dX+tXOQfZDE4xSa/LKnhKGs9zb4h5r17CoPyL6Cjaf9ge1IJuKnBV1DB8qgRSccgqmap iGIQ== MIME-Version: 1.0 X-Received: by 10.202.218.135 with SMTP id r129mt9299636oig.26.1425066657915; Fri, 27 Feb 2015 11:50:57 -0800 (PST) Received: by 10.76.130.17 with HTTP; Fri, 27 Feb 2015 11:50:57 -0800 (PST) Received: by 10.76.130.17 with HTTP; Fri, 27 Feb 2015 11:50:57 -0800 (PST) In-Reply-To: <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> Date: Fri, 27 Feb 2015 16:50:57 -0300 X-Google-Sender-Auth: NhdIuqdneAMfejjHqNIJ2oFXfCs Message-ID: From: Artur Malabarba Content-Type: multipart/alternative; boundary=001a113d5b7cedd5250510172f73 X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Perhaps the "replace" family of commands ought to ignore the region if it's empty? Or at least notify the user? Perhaps the "replace" family of commands ought to ignore the region if it's empty? Or at least notify the user? [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (bruce.connor.am[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.176 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 1.2 MISSING_HEADERS Missing To: header 0.0 HTML_MESSAGE BODY: HTML included in message 1.8 MALFORMED_FREEMAIL Bad headers on message from free email service 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.3 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Perhaps the "replace" family of commands ought to ignore the region if it's empty? Or at least notify the user? Perhaps the "replace" family of commands ought to ignore the region if it's empty? Or at least notify the user? [...] Content analysis details: (2.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (bruce.connor.am[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.176 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 1.2 MISSING_HEADERS Missing To: header 0.0 HTML_MESSAGE BODY: HTML included in message 1.8 MALFORMED_FREEMAIL Bad headers on message from free email service 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid --001a113d5b7cedd5250510172f73 Content-Type: text/plain; charset=UTF-8 Perhaps the "replace" family of commands ought to ignore the region if it's empty? Or at least notify the user? --001a113d5b7cedd5250510172f73 Content-Type: text/html; charset=UTF-8

Perhaps the "replace" family of commands ought to ignore the region if it's empty? Or at least notify the user?

--001a113d5b7cedd5250510172f73-- From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Mar 2015 17:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Artur Malabarba Cc: Teika Kazura , 13178@debbugs.gnu.org Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142531702910245 (code B ref 13178); Mon, 02 Mar 2015 17:24:02 +0000 Received: (at 13178) by debbugs.gnu.org; 2 Mar 2015 17:23:49 +0000 Received: from localhost ([127.0.0.1]:33042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSU4K-0002fA-R0 for submit@debbugs.gnu.org; Mon, 02 Mar 2015 12:23:49 -0500 Received: from chene.dit.umontreal.ca ([132.204.246.20]:39572) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSU4J-0002f3-Bw for 13178@debbugs.gnu.org; Mon, 02 Mar 2015 12:23:47 -0500 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id t22HNitG025543; Mon, 2 Mar 2015 12:23:45 -0500 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 983B8AE124; Mon, 2 Mar 2015 12:23:40 -0500 (EST) From: Stefan Monnier Message-ID: References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> Date: Mon, 02 Mar 2015 12:23:40 -0500 In-Reply-To: (Artur Malabarba's message of "Fri, 27 Feb 2015 16:50:57 -0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5233=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5233> : inlines <2336> : streams <1398805> : uri <1869174> X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > Perhaps the "replace" family of commands ought to ignore the region if it's > empty? It should obey use-empty-active-region. > Or at least notify the user? It definitely shouldn't fail with an "unrelated" error. Stefan From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Mar 2015 20:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: Teika Kazura , 13178@debbugs.gnu.org, Artur Malabarba Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142532739026271 (code B ref 13178); Mon, 02 Mar 2015 20:17:01 +0000 Received: (at 13178) by debbugs.gnu.org; 2 Mar 2015 20:16:30 +0000 Received: from localhost ([127.0.0.1]:33169 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSWlS-0006pe-29 for submit@debbugs.gnu.org; Mon, 02 Mar 2015 15:16:30 -0500 Received: from ps18281.dreamhost.com ([69.163.222.226]:60978 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSWlO-0006pS-Dw for 13178@debbugs.gnu.org; Mon, 02 Mar 2015 15:16:28 -0500 Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 3024F395209B82; Mon, 2 Mar 2015 12:16:23 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> Date: Mon, 02 Mar 2015 22:14:17 +0200 In-Reply-To: (Stefan Monnier's message of "Mon, 02 Mar 2015 12:23:40 -0500") Message-ID: <87ioejw412.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> Perhaps the "replace" family of commands ought to ignore the region if it's >> empty? > > It should obey use-empty-active-region. This patch allows query-replace commands to obey use-empty-active-region: diff --git a/lisp/replace.el b/lisp/replace.el index e0636e0..8b62b54 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -312,15 +312,15 @@ (defun query-replace (from-string to-string &optional delimited start end backwa (if current-prefix-arg (if (eq current-prefix-arg '-) " backward" " word") "") - (if (and transient-mark-mode mark-active) " in region" "")) + (if (use-region-p) " in region" "")) nil))) (list (nth 0 common) (nth 1 common) (nth 2 common) ;; These are done separately here ;; so that command-history will record these expressions ;; rather than the values they had this time. - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-beginning)) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-end)) (nth 3 common)))) (perform-replace from-string to-string t nil delimited nil nil start end backward)) @@ -392,15 +392,15 @@ (defun query-replace-regexp (regexp to-string &optional delimited start end back (if (eq current-prefix-arg '-) " backward" " word") "") " regexp" - (if (and transient-mark-mode mark-active) " in region" "")) + (if (use-region-p) " in region" "")) t))) (list (nth 0 common) (nth 1 common) (nth 2 common) ;; These are done separately here ;; so that command-history will record these expressions ;; rather than the values they had this time. - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-beginning)) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-end)) (nth 3 common)))) (perform-replace regexp to-string t t delimited nil nil start end backward)) @@ -469,9 +469,9 @@ (defun query-replace-regexp-eval (regexp to-expr &optional delimited start end) ;; and the user might enter a single token. (replace-match-string-symbols to) (list from (car to) current-prefix-arg - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-beginning)) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-end)))))) (perform-replace regexp (cons 'replace-eval-replacement to-expr) t 'literal delimited nil nil start end)) @@ -507,9 +507,9 @@ (defun map-query-replace-regexp (regexp to-strings &optional n start end) (list from to (and current-prefix-arg (prefix-numeric-value current-prefix-arg)) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-beginning)) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-end))))) (let (replacements) (if (listp to-strings) @@ -571,12 +571,12 @@ (defun replace-string (from-string to-string &optional delimited start end backw (if (eq current-prefix-arg '-) " backward" " word") "") " string" - (if (and transient-mark-mode mark-active) " in region" "")) + (if (use-region-p) " in region" "")) nil))) (list (nth 0 common) (nth 1 common) (nth 2 common) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-beginning)) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-end)) (nth 3 common)))) (perform-replace from-string to-string nil nil delimited nil nil start end backward)) @@ -645,12 +645,12 @@ (defun replace-regexp (regexp to-string &optional delimited start end backward) (if (eq current-prefix-arg '-) " backward" " word") "") " regexp" - (if (and transient-mark-mode mark-active) " in region" "")) + (if (use-region-p) " in region" "")) t))) (list (nth 0 common) (nth 1 common) (nth 2 common) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-beginning)) - (if (and transient-mark-mode mark-active) + (if (use-region-p) (region-end)) (nth 3 common)))) (perform-replace regexp to-string nil t delimited nil nil start end backward)) @@ -816,7 +816,7 @@ (defun keep-lines (regexp &optional rstart rend interactive) (unless (or (bolp) (eobp)) (forward-line 0)) (point-marker))))) - (if (and interactive transient-mark-mode mark-active) + (if (and interactive (use-region-p)) (setq rstart (region-beginning) rend (progn (goto-char (region-end)) @@ -885,7 +885,7 @@ (defun flush-lines (regexp &optional rstart rend interactive) (progn (goto-char (min rstart rend)) (setq rend (copy-marker (max rstart rend)))) - (if (and interactive transient-mark-mode mark-active) + (if (and interactive (use-region-p)) (setq rstart (region-beginning) rend (copy-marker (region-end))) (setq rstart (point) @@ -935,7 +935,7 @@ (defun how-many (regexp &optional rstart rend interactive) (setq rend (max rstart rend))) (goto-char rstart) (setq rend (point-max))) - (if (and interactive transient-mark-mode mark-active) + (if (and interactive (use-region-p)) (setq rstart (region-beginning) rend (region-end)) (setq rstart (point) From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Mar 2015 21:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Juri Linkov Cc: Teika Kazura , 13178@debbugs.gnu.org, Stefan Monnier Reply-To: bruce.connor.am@gmail.com Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.14253330682666 (code B ref 13178); Mon, 02 Mar 2015 21:52:01 +0000 Received: (at 13178) by debbugs.gnu.org; 2 Mar 2015 21:51:08 +0000 Received: from localhost ([127.0.0.1]:33185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSYF2-0000gw-7b for submit@debbugs.gnu.org; Mon, 02 Mar 2015 16:51:08 -0500 Received: from mail-oi0-f43.google.com ([209.85.218.43]:44682) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSYF0-0000gS-6I for 13178@debbugs.gnu.org; Mon, 02 Mar 2015 16:51:06 -0500 Received: by mail-oi0-f43.google.com with SMTP id z81so29655667oif.2 for <13178@debbugs.gnu.org>; Mon, 02 Mar 2015 13:51:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=zZczipjIvdwSDS9CMV87y5nrpfrtgQETSX+RKc3TwGU=; b=I+3OQpU1lrjj0AYWTFwj0Gly1ebRqJ4aUKzK+T/eawqIcge83n1Zd9gK70Aehoj4ea 0RqGT5+qtQZZA+7b1e8sDJPa+e8W8qZ5amgYxTmE7HtGg6E+AKk8949pF3yG2nCS6KNP lVeNHJxhmnHxFmbqI8YYi1RDXtKswHrLcW39ZwWVIrWtJCLEKy6T9s8B53EkAH0jUYbS VcQVAK7P3NjAW9/9sB+IRSVyX6f7d8FTxUB1RYm8tZwYAl2cB5PRk+0Ew7uVxgTX7fk3 bC3zoI2wr7OO37SV6eVRxfgJahUCesSTL+NAfpo7sUQjzmacqInqc01zJUFi4HuNgDnW MJ+Q== MIME-Version: 1.0 X-Received: by 10.202.97.130 with SMTP id v124mr19737355oib.34.1425333060608; Mon, 02 Mar 2015 13:51:00 -0800 (PST) Received: by 10.76.130.17 with HTTP; Mon, 2 Mar 2015 13:51:00 -0800 (PST) In-Reply-To: <87ioejw412.fsf@mail.linkov.net> References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> <87ioejw412.fsf@mail.linkov.net> Date: Mon, 2 Mar 2015 18:51:00 -0300 X-Google-Sender-Auth: _dmbj9YvA1saSUVJi_pO6uVhBcg Message-ID: From: Artur Malabarba Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >> It should obey use-empty-active-region. > > This patch allows query-replace commands to obey use-empty-active-region: Looks good to me. From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Teika Kazura Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 Mar 2015 23:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13178@debbugs.gnu.org Cc: monnier@iro.umontreal.ca, bruce.connor.am@gmail.com, juri@linkov.net Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142542550020502 (code B ref 13178); Tue, 03 Mar 2015 23:32:01 +0000 Received: (at 13178) by debbugs.gnu.org; 3 Mar 2015 23:31:40 +0000 Received: from localhost ([127.0.0.1]:34336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSwHr-0005Kb-Nl for submit@debbugs.gnu.org; Tue, 03 Mar 2015 18:31:39 -0500 Received: from mout.gmx.com ([74.208.4.200]:58987) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSwHo-0005KL-Nj for 13178@debbugs.gnu.org; Tue, 03 Mar 2015 18:31:37 -0500 Received: from localhost ([123.218.135.231]) by mail.gmx.com (mrgmxus002) with ESMTPSA (Nemesis) id 0M9ajh-1YL0TX42Ln-00D09g; Wed, 04 Mar 2015 00:31:29 +0100 Date: Wed, 04 Mar 2015 08:31:03 +0900 (JST) Message-Id: <20150304.083103.1686913135825312962.teika@gmx.com> From: Teika Kazura In-Reply-To: References: <87ioejw412.fsf@mail.linkov.net> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:XVnhcn9be8XgjtqIiV0DI9Px5eGCD2GYtsK3Exzr3v8/yQNz6QH XQbnJtGv8M/b31iNXHU4eV4xz55Jha80ZkTlisFUkPjazEgAHm2lqpPzwhtixMyaHg3Isr0 yldNHenX2W0RnduYX+CA9zFO/0xcHGRy4V1vJvH9KpkrEiOPT4wQGv5gAdNOxGX8Dy6Vuuq l5Z7tp6oxCf86uFgWcZqA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Docs of `use-empty-active-region' and `use-region-p' use the word "empty", but in fact the predicate is (> (region-end) (region-beginning)). It's confusing. (And also the Emacs Info, "Operating on the Region" section.) For replace.el, the condition is correct (= what users expect.) Although I don't know other cases, maybe the explanation "empty" is too simplistic? (Sorry that I don't come up with a concise replacement description for that case.) Thank you very much Emacs developers. And of course to Drew Adams for your kind reply and wide range, long time contributions. From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Artur Malabarba Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 04 Mar 2015 01:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Teika Kazura Cc: 13178@debbugs.gnu.org, Stefan Monnier , juri@linkov.net Reply-To: bruce.connor.am@gmail.com Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142543182330058 (code B ref 13178); Wed, 04 Mar 2015 01:18:02 +0000 Received: (at 13178) by debbugs.gnu.org; 4 Mar 2015 01:17:03 +0000 Received: from localhost ([127.0.0.1]:34370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSxvq-0007ok-Ur for submit@debbugs.gnu.org; Tue, 03 Mar 2015 20:17:03 -0500 Received: from mail-oi0-f42.google.com ([209.85.218.42]:35477) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YSxvo-0007oA-6r for 13178@debbugs.gnu.org; Tue, 03 Mar 2015 20:17:01 -0500 Received: by oifz81 with SMTP id z81so2967752oif.2 for <13178@debbugs.gnu.org>; Tue, 03 Mar 2015 17:16:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Kss4a9mSB+yRP31gwS2I8r95mZL66JnAei6jhLOYhVc=; b=xbrtt4TX7Rt/lbggOpiTNCP2Eid3y7yD6OUBfZFceWfVOGM7rnEpcfjVXHfQY7PaLa Tb8eYUfPznUOP4aikmMz4zV66z0qtA5rXSIuBydYWyV0hFGGB3gt/HWDGEEE81RIK/6W ykQr97G1u9LoQ6mNgyY1uSmezn4bWkRfUKqSW1i8YdETW2KyTK1poFuaXD/2vWoHWoz7 EtaWtNRyddxRFcGr4YoTSz2X18ixK7GBL7CL/6sFOWWMRvMknm60E3rQErotqTM4Aeu1 JrnFONExIXrObzLQMaajyj6ILPihYrhfVqFIBIY5bIhS4HyVpFfXB3g5hHcEicqrtoyf tj+Q== MIME-Version: 1.0 X-Received: by 10.202.90.3 with SMTP id o3mr1064374oib.99.1425431814577; Tue, 03 Mar 2015 17:16:54 -0800 (PST) Received: by 10.76.130.17 with HTTP; Tue, 3 Mar 2015 17:16:54 -0800 (PST) Received: by 10.76.130.17 with HTTP; Tue, 3 Mar 2015 17:16:54 -0800 (PST) In-Reply-To: <20150304.083103.1686913135825312962.teika@gmx.com> References: <87ioejw412.fsf@mail.linkov.net> <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> <20150304.083103.1686913135825312962.teika@gmx.com> Date: Wed, 4 Mar 2015 01:16:54 +0000 X-Google-Sender-Auth: 0QCmSsSADUvtM9buv4NPgBNJpMQ Message-ID: From: Artur Malabarba Content-Type: multipart/alternative; boundary=001a113d5edcf5a36405106c34f3 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --001a113d5edcf5a36405106c34f3 Content-Type: text/plain; charset=UTF-8 On Mar 3, 2015 11:31 PM, "Teika Kazura" wrote: > > Docs of `use-empty-active-region' and `use-region-p' use the word "empty", but in fact the predicate is (> (region-end) (region-beginning)). It's confusing. What's confusing about that? Isn't that a non empty region? --001a113d5edcf5a36405106c34f3 Content-Type: text/html; charset=UTF-8


On Mar 3, 2015 11:31 PM, "Teika Kazura" <teika@gmx.com> wrote:
>
> Docs of `use-empty-active-region' and `use-region-p' use the word "empty", but in fact the predicate is (> (region-end) (region-beginning)). It's confusing.

What's confusing about that? Isn't that a non empty region?

--001a113d5edcf5a36405106c34f3-- From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Teika Kazura Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Mar 2015 00:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13178@debbugs.gnu.org Cc: monnier@iro.umontreal.ca, bruce.connor.am@gmail.com, juri@linkov.net Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142551529612122 (code B ref 13178); Thu, 05 Mar 2015 00:29:02 +0000 Received: (at 13178) by debbugs.gnu.org; 5 Mar 2015 00:28:16 +0000 Received: from localhost ([127.0.0.1]:35367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTJeB-00039Q-T3 for submit@debbugs.gnu.org; Wed, 04 Mar 2015 19:28:16 -0500 Received: from mout.gmx.com ([74.208.4.201]:62625) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YTJeA-00039E-82 for 13178@debbugs.gnu.org; Wed, 04 Mar 2015 19:28:14 -0500 Received: from localhost ([123.222.69.251]) by mail.gmx.com (mrgmxus002) with ESMTPSA (Nemesis) id 0MOfgG-1YNHlP0LJe-006AaR; Thu, 05 Mar 2015 01:28:01 +0100 Date: Thu, 05 Mar 2015 09:16:10 +0900 (JST) Message-Id: <20150305.091610.1471986007054133322.teika@gmx.com> From: Teika Kazura In-Reply-To: References: <20150304.083103.1686913135825312962.teika@gmx.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:K1E6CZY52EsxLkRuDcVj+4ohATg7BD6yPtbeyD9NF85CAA742CY uDloAD/QTGCsSm9LszOtG3I9moqiAUR9GvUTUsWjiUG6IP1Ta0Ic9m56lvVwnMYCtH+cMwD ZB1Fbw8Z0VG9EfP/x4bXC0XVV/poVBkFtVmGpbN20qmFJv7fvBIfMBanBV2e9WHEYyJK8UT zK3kKOpV7krotGokyVYfA== X-UI-Out-Filterresults: notjunk:1; X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) I was wrong. I'm sorry. > What's confusing about that? Isn't that a non empty region? From unknown Sun Jun 22 07:54:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13178: Query-replace fails soon after narrow-to-region Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Mar 2015 19:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13178 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Artur Malabarba Cc: Teika Kazura , 13178@debbugs.gnu.org, Stefan Monnier Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.14261901009235 (code B ref 13178); Thu, 12 Mar 2015 19:55:02 +0000 Received: (at 13178) by debbugs.gnu.org; 12 Mar 2015 19:55:00 +0000 Received: from localhost ([127.0.0.1]:44277 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW9C7-0002Ot-VW for submit@debbugs.gnu.org; Thu, 12 Mar 2015 15:55:00 -0400 Received: from ps18281.dreamhost.com ([69.163.222.226]:46484 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW9C6-0002Ok-RF for 13178@debbugs.gnu.org; Thu, 12 Mar 2015 15:54:59 -0400 Received: from localhost.linkov.net (ps18281.dreamhostps.com [69.163.222.226]) by ps18281.dreamhostps.com (Postfix) with ESMTP id CC8EA302A8923F; Thu, 12 Mar 2015 12:54:56 -0700 (PDT) From: Juri Linkov Organization: LINKOV.NET References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> <87ioejw412.fsf@mail.linkov.net> Date: Thu, 12 Mar 2015 21:53:56 +0200 In-Reply-To: (Artur Malabarba's message of "Mon, 2 Mar 2015 18:51:00 -0300") Message-ID: <87egouc7qj.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >>> It should obey use-empty-active-region. >> >> This patch allows query-replace commands to obey use-empty-active-region: > > Looks good to me. bug#13178 could be handled together with bug#19829 and bug#20070. From unknown Sun Jun 22 07:54:20 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Teika Kazura Subject: bug#13178: closed (Re: bug#13178: Query-replace fails soon after narrow-to-region) Message-ID: References: <87twopsc39.fsf@mail.linkov.net> <20121214.130320.1173151390202861752.teika@lavabit.com> X-Gnu-PR-Message: they-closed 13178 X-Gnu-PR-Package: emacs Reply-To: 13178@debbugs.gnu.org Date: Fri, 13 Nov 2015 23:42:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1447458123-8452-1" This is a multi-part message in MIME format... ------------=_1447458123-8452-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #13178: Query-replace fails soon after narrow-to-region which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 13178@debbugs.gnu.org. --=20 13178: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13178 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1447458123-8452-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 13178-done) by debbugs.gnu.org; 13 Nov 2015 23:41:38 +0000 Received: from localhost ([127.0.0.1]:37549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxNyM-0002Bj-9Q for submit@debbugs.gnu.org; Fri, 13 Nov 2015 18:41:38 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:33022 helo=homiemail-a75.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZxNyK-0002Ba-Qi for 13178-done@debbugs.gnu.org; Fri, 13 Nov 2015 18:41:37 -0500 Received: from homiemail-a75.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTP id 334D25EC07C for <13178-done@debbugs.gnu.org>; Fri, 13 Nov 2015 15:41:36 -0800 (PST) Received: from localhost.linkov.net (m83-191-160-148.cust.tele2.ee [83.191.160.148]) (Authenticated sender: jurta@jurta.org) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTPA id 6ECB55EC079 for <13178-done@debbugs.gnu.org>; Fri, 13 Nov 2015 15:41:35 -0800 (PST) From: Juri Linkov To: 13178-done@debbugs.gnu.org Subject: Re: bug#13178: Query-replace fails soon after narrow-to-region Organization: LINKOV.NET References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> <87ioejw412.fsf@mail.linkov.net> <87egouc7qj.fsf@mail.linkov.net> Date: Sat, 14 Nov 2015 01:39:54 +0200 In-Reply-To: <87egouc7qj.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 12 Mar 2015 21:53:56 +0200") Message-ID: <87twopsc39.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 13178-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >>>> It should obey use-empty-active-region. >>> >>> This patch allows query-replace commands to obey use-empty-active-region: >> >> Looks good to me. > > bug#13178 could be handled together with bug#19829 and bug#20070. This is fixed by bug#19829. ------------=_1447458123-8452-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 14 Dec 2012 04:05:12 +0000 Received: from localhost ([127.0.0.1]:41644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjMWN-0001z0-O3 for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:05:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33542) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TjMWL-0001yt-LO for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:05:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjMVP-0004lF-Fa for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:04:14 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMVP-0004lB-CQ for submit@debbugs.gnu.org; Thu, 13 Dec 2012 23:04:11 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMVM-0001F4-NG for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:04:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjMVJ-0004kn-TC for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:04:08 -0500 Received: from karen.lavabit.com ([72.249.41.33]:45688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjMVJ-0004kb-PP for bug-gnu-emacs@gnu.org; Thu, 13 Dec 2012 23:04:05 -0500 Received: from a.earth.lavabit.com (a.earth.lavabit.com [192.168.111.10]) by karen.lavabit.com (Postfix) with ESMTP id AD93911BC8B; Thu, 13 Dec 2012 22:04:04 -0600 (CST) Received: from localhost (p1143-ipad308hodogaya.kanagawa.ocn.ne.jp [124.85.82.143]) by lavabit.com with ESMTP id LDBKFOSRH1QR; Thu, 13 Dec 2012 22:04:04 -0600 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=xG2G0bI9wRT7jcJcERnMBuJJjk7uCxUCRVohhXcFJ1t7kx34Ekl5pj7qY7nvrYrc3dE3fWKdFq8EuJAjwDxfCRqqJn36tD/gFGyfwqsRZrynkT6RaoioE/r886g3vGgTNAuer9KgxNMw9cni31bSIp7qJOmLmnpEHPm9USvEcfw=; h=Date:Message-Id:To:Subject:From:Mime-Version:Content-Type:Content-Transfer-Encoding; Date: Fri, 14 Dec 2012 13:03:20 +0900 (JST) Message-Id: <20121214.130320.1173151390202861752.teika@lavabit.com> To: bug-gnu-emacs@gnu.org Subject: Query-replace fails soon after narrow-to-region From: Teika Kazura Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hi, Emacs developers. In Emacs 24.1, query-replace soon after narrow-to-region fails. More precisely, minibuffer says "Replaced 0 occurrences", and the query-replace finishes even if there're matches. I don't think it's a recent regresion. Steps to reproduce: 0. emacs -Q 1. Open a buffer. 2. Set mark, and do narrow-to-region 3. Move to the top of the narrowed buffer. 4. Do query-replace. 5. minibuffer says "Replaced 0 occurrences", and the query-replace finishes. If you do query-replace again, then it starts correctly. It seems that some extra commands between each step hinder to reproduce. Probably you have to enable narrow-to-region beforehand, and query-replace history is necessary, so that "M-% " can invoke a query-replace. In fact, it was already reported in bug #8952: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8952 but as a "wishlist", mixed with several other things. So I dare to submit a separate entry. I've been bothered by this bug for years, but I didn't know how to reproduce it. Thank you in advance. Best regards, Teika (Teika kazura) ------------=_1447458123-8452-1--