bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6227: Color isearch regexp submatches differently


From: Juri Linkov
Subject: bug#6227: Color isearch regexp submatches differently
Date: Sun, 23 May 2010 02:44:04 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

>> We already have highlighting like that: lisp/emacs-lisp/re-builder.el
>> uses faces `reb-match-1', `reb-match-2', `reb-match-3' to highlight
>> regexp subexpressions.  I think this should be used by isearch.
>
> That sounds right to me.
>
> Also Drew suggestion to not color submatches in lazy marking seems right.

(add-hook 'isearch-update-post-hook
          (lambda ()
            (require 're-builder)
            (when isearch-regexp
              (let ((reb-regexp isearch-string)
                    (reb-target-buffer (current-buffer))
                    (reb-target-window (selected-window)))
                (reb-update-overlays)))))

(add-hook 'isearch-mode-end-hook
          (lambda ()
            (let ((reb-target-buffer (current-buffer)))
              (reb-delete-overlays))))

-- 
Juri Linkov
http://www.jurta.org/emacs/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]