GNU bug report logs - #10887
24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Sun, 26 Feb 2012 10:07:02 UTC

Severity: normal

Found in version 24.0.93

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10887 in the body.
You can then email your comments to 10887 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10887; Package emacs. (Sun, 26 Feb 2012 10:07:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dani Moncayo <dmoncayo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 26 Feb 2012 10:07:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.93;
	lazy-highlighting in `query-replace' after a word-type Isearch
Date: Sun, 26 Feb 2012 11:03:35 +0100
Recipe from "emacs -Q":
1. aa bb RET RET aa RET bb RET
2. C-s M-s w aa bb RET
3. M-<
4. M-% aa bb RET xx RET

I observe that the "aa<RET>bb" part is lazy-highlighted, but obviously
it should not be, because the query-replace will never get there (it's
doing a normal search, not a word-type one).



In GNU Emacs 24.0.93.1 (i386-mingw-nt6.1.7601)
 of 2012-02-14 on DANI-PC
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --with-gcc (4.6)'


-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10887; Package emacs. (Mon, 27 Feb 2012 11:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 10887 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10887 <at> debbugs.gnu.org
Subject: Re: bug#10887: 24.0.93;
	lazy-highlighting in `query-replace' after a word-type Isearch
Date: Mon, 27 Feb 2012 12:57:27 +0200
> Recipe from "emacs -Q":
> 1. aa bb RET RET aa RET bb RET
> 2. C-s M-s w aa bb RET
> 3. M-<
> 4. M-% aa bb RET xx RET
>
> I observe that the "aa<RET>bb" part is lazy-highlighted, but obviously
> it should not be, because the query-replace will never get there (it's
> doing a normal search, not a word-type one).

Thanks for the report.  For 24.1 it could be fixed with the patch below.
(In 24.2 for the true "word-replace" `replace-highlight' may need a new
argument `word' that will use isearch word mode for lazy-highlighting.)

=== modified file 'lisp/replace.el'
--- lisp/replace.el	2012-02-24 22:46:57 +0000
+++ lisp/replace.el	2012-02-27 10:54:20 +0000
@@ -2117,13 +2114,13 @@ (defun replace-highlight (match-beg matc
   (if query-replace-lazy-highlight
       (let ((isearch-string string)
 	    (isearch-regexp regexp)
+	    ;; Set isearch-word to nil because word-replace is regexp-based,
+	    ;; so `isearch-search-fun' should not use `word-search-forward'.
+	    (isearch-word nil)
 	    (search-whitespace-regexp nil)
 	    (isearch-case-fold-search case-fold)
 	    (isearch-forward t)
 	    (isearch-error nil))
-	;; Set isearch-word to nil because word-replace is regexp-based,
-	;; so `isearch-search-fun' should not use `word-search-forward'.
-	(if (and isearch-word isearch-regexp) (setq isearch-word nil))
 	(isearch-lazy-highlight-new-loop range-beg range-end))))
 
 (defun replace-dehighlight ()





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10887; Package emacs. (Mon, 27 Feb 2012 13:26:03 GMT) Full text and rfc822 format available.

Message #11 received at 10887 <at> debbugs.gnu.org (full text, mbox):

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 10887 <at> debbugs.gnu.org
Subject: Re: bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a
	word-type Isearch
Date: Mon, 27 Feb 2012 14:22:57 +0100
>> Recipe from "emacs -Q":
>> 1. aa bb RET RET aa RET bb RET
>> 2. C-s M-s w aa bb RET
>> 3. M-<
>> 4. M-% aa bb RET xx RET
>>
>> I observe that the "aa<RET>bb" part is lazy-highlighted, but obviously
>> it should not be, because the query-replace will never get there (it's
>> doing a normal search, not a word-type one).
>
> Thanks for the report.  For 24.1 it could be fixed with the patch below.

I've done a quick test, and it seems to work.  Thanks.

> (In 24.2 for the true "word-replace" `replace-highlight' may need a new
> argument `word' that will use isearch word mode for lazy-highlighting.)

I'm looking forward for this true "word-replace".  :)

-- 
Dani Moncayo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10887; Package emacs. (Sun, 11 Mar 2012 11:01:01 GMT) Full text and rfc822 format available.

Message #14 received at 10887 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10887 <at> debbugs.gnu.org
Subject: Re: bug#10887: 24.0.93;
	lazy-highlighting in `query-replace' after a word-type Isearch
Date: Sun, 11 Mar 2012 12:29:36 +0200
> Thanks for the report.  For 24.1 it could be fixed with the patch below.
> (In 24.2 for the true "word-replace" `replace-highlight' may need a new
> argument `word' that will use isearch word mode for lazy-highlighting.)

Patch committed now.

I'm not closing this report to leave it as a reminder to add the
argument `word' in 24.2.  This also depends on using `word-search-regexp'
in `perform-replace' as proposed in bug#10885.




Reply sent to Juri Linkov <juri <at> jurta.org>:
You have taken responsibility. (Thu, 06 Sep 2012 08:58:02 GMT) Full text and rfc822 format available.

Notification sent to Dani Moncayo <dmoncayo <at> gmail.com>:
bug acknowledged by developer. (Thu, 06 Sep 2012 08:58:03 GMT) Full text and rfc822 format available.

Message #19 received at 10887-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> jurta.org>
To: Dani Moncayo <dmoncayo <at> gmail.com>
Cc: 10887-done <at> debbugs.gnu.org
Subject: Re: bug#10887: 24.0.93;
	lazy-highlighting in `query-replace' after a word-type Isearch
Date: Thu, 06 Sep 2012 11:54:31 +0300
> I'm not closing this report to leave it as a reminder to add the
> argument `word' in 24.2.  This also depends on using `word-search-regexp'
> in `perform-replace' as proposed in bug#10885.

After adding this argument to `replace-highlight' in bug#10885,
this report can be closed now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 04 Oct 2012 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.