GNU bug report logs - #77121
[PATCH] Make isearch highlight overlays non-sticky (non-advance) at both ends

Previous Next

Package: emacs;

Reported by: Sora Takai <SoraTakai <at> protonmail.com>

Date: Wed, 19 Mar 2025 16:56:03 UTC

Severity: normal

Tags: patch

Merged with 77120

Fixed in version 31.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Sora Takai <SoraTakai <at> protonmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 77121 <at> debbugs.gnu.org
Subject: bug#77121: [PATCH] Make isearch highlight overlays non-sticky (non-advance) at both ends
Date: Fri, 21 Mar 2025 09:31:34 +0000
Thanks for taking a look, Juri.

These are the steps to reproduce it:

1. Evaluate

;; Enable lazy-highlight
(setq isearch-lazy-highlight t)

2. Evaluate

;; Keep lay-highlights even after isearch finishes
(setq lazy-highlight-cleanup nil)

3. On some writable buffer, evaluate

(progn
  (insert "emacs")
  (beginning-of-buffer))

4. M-x isearch-forward RET emacs RET

5. Evaluate `(backward-word)` (M-b)

6. Type "GNU "

7. With this patch, you won't get the same lazy highlight color inherited on "GNU " string ('non-sticky' behavior); without it, you will inherit the same highlight color on additional "GNU " string ('sticky' behavior).

8. Now the opposite end: evaluate `(beginning-of-buffer)` and do (4) again.

9. Type " rocks."

10. with this patch, you won't get the same lazy highlight color inherited on " rocks." string; without it, you'll get the same highlight color.


On Friday, March 21st, 2025 at 4:50 PM, Juri Linkov <juri <at> linkov.net> wrote:

> > > > here is a simple patch to make isearch highlights non-sticky at both ends (i.e. no front and rear
> > > > advance on overlays), thereby making them more intuitive and less bothersome for further editing.
> > > > Currently, every isearch overlay, including lazy highlights, inherits isearch highlight color when you
> > > > type characters at front and rear positions. By applying this patch, users will no longer get that color
> > > > stickiness when editing around isearch highlights, which makes them more 'self-contained'.
> > > 
> > > Sorry, here is an updated patch. I think this is enough since it is for the most part lazy-highlights with (setq
> > > isearch-lazy-highlight t) and (setq lazy-highlight-cleanup nil) that matter for editing.
> > 
> > Thanks.
> > 
> > Juri, any comments or suggestions?
> 
> 
> It would be nice to have a step-by-step recipe for this case
> since I don't understand how to reproduce this problem.




This bug report was last modified 86 days ago.

Previous Next


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