From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#13178: Query-replace fails soon after narrow-to-region Date: Fri, 27 Feb 2015 07:01:52 -0800 (PST) Message-ID: <4c17eddd-79fb-4939-98d2-5f929e5f1c7c@default> References: <20121214.130320.1173151390202861752.teika@lavabit.com> <20150227.171230.1758903055908506043.teika@gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1425049410 1575 80.91.229.3 (27 Feb 2015 15:03:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Feb 2015 15:03:30 +0000 (UTC) To: Teika Kazura , 13178@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Feb 27 16:03:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YRMRg-0006MU-VR for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Feb 2015 16:03:17 +0100 Original-Received: from localhost ([::1]:37026 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRMRg-0001MH-HJ for geb-bug-gnu-emacs@m.gmane.org; Fri, 27 Feb 2015 10:03:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRMRY-0001EU-3G for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2015 10:03:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YRMRS-00062A-Ek for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2015 10:03:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56510) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YRMRS-00061x-Cn for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2015 10:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YRMRR-0004ih-NC for bug-gnu-emacs@gnu.org; Fri, 27 Feb 2015 10:03:01 -0500 X-Loop: help-debbugs@gnu.org 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: Original-Received: via spool by 13178-submit@debbugs.gnu.org id=B13178.142504932818085 (code B ref 13178); Fri, 27 Feb 2015 15:03:01 +0000 Original-Received: (at 13178) by debbugs.gnu.org; 27 Feb 2015 15:02:08 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 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)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99869 Archived-At: > 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.