GNU bug report logs - #6227
Color isearch regexp submatches differently

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Thu, 20 May 2010 11:13:01 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 6227 <at> debbugs.gnu.org
Subject: Re: bug#6227: Color isearch regexp submatches differently
Date: Thu, 10 Jun 2010 23:41:40 +0200
On Thu, Jun 10, 2010 at 10:52 PM, Juri Linkov <juri <at> jurta.org> wrote:
>>> I agree, your approach is probably better. But check for more
>>> submatches. Maybe upto the value of some variable, say
>>> isearch-max-submatch-num.
>>
>> Good idea.
>
> Maybe something like this:

Yes,

> +(defcustom search-highlight-submatches 0

but set I suggest a default of 100. The loop costs essentially nothing
for non-submatches and this is on command level.

> +    (let ((i 0) ov)
> +      (while (<= i search-highlight-submatches)
> +       (when (match-beginning i)
> +         (setq ov (make-overlay (match-beginning i) (match-end i)))
> +         (overlay-put ov 'face (intern-soft (format "isearch-%d" i)))
> +         (overlay-put ov 'priority 1002)
> +         (push ov isearch-submatches-overlays))
> +       (setq i (1+ i))))))




This bug report was last modified 4 years and 321 days ago.

Previous Next


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