unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch
@ 2012-02-26 10:03 Dani Moncayo
  2012-02-27 10:57 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Dani Moncayo @ 2012-02-26 10:03 UTC (permalink / raw)
  To: 10887

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch
  2012-02-26 10:03 bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch Dani Moncayo
@ 2012-02-27 10:57 ` Juri Linkov
  2012-02-27 13:22   ` Dani Moncayo
  2012-03-11 10:29   ` Juri Linkov
  0 siblings, 2 replies; 5+ messages in thread
From: Juri Linkov @ 2012-02-27 10:57 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 10887

> 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 ()






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch
  2012-02-27 10:57 ` Juri Linkov
@ 2012-02-27 13:22   ` Dani Moncayo
  2012-03-11 10:29   ` Juri Linkov
  1 sibling, 0 replies; 5+ messages in thread
From: Dani Moncayo @ 2012-02-27 13:22 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 10887

>> 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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch
  2012-02-27 10:57 ` Juri Linkov
  2012-02-27 13:22   ` Dani Moncayo
@ 2012-03-11 10:29   ` Juri Linkov
  2012-09-06  8:54     ` Juri Linkov
  1 sibling, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2012-03-11 10:29 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 10887

> 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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch
  2012-03-11 10:29   ` Juri Linkov
@ 2012-09-06  8:54     ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2012-09-06  8:54 UTC (permalink / raw)
  To: Dani Moncayo; +Cc: 10887-done

> 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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-09-06  8:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-26 10:03 bug#10887: 24.0.93; lazy-highlighting in `query-replace' after a word-type Isearch Dani Moncayo
2012-02-27 10:57 ` Juri Linkov
2012-02-27 13:22   ` Dani Moncayo
2012-03-11 10:29   ` Juri Linkov
2012-09-06  8:54     ` Juri Linkov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).