[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#14645: Keep highlighting face foreground
From: |
Juri Linkov |
Subject: |
bug#14645: Keep highlighting face foreground |
Date: |
Thu, 20 Jun 2013 02:14:18 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) |
I was going to propose a similar change to use `add-face-text-property'
in hi-lock, but it turned out to be much simpler because hi-lock
is based on font-lock that already has `font-lock-prepend-text-property'
that does the same:
=== modified file 'lisp/hi-lock.el'
--- lisp/hi-lock.el 2013-06-03 08:51:50 +0000
+++ lisp/hi-lock.el 2013-06-19 23:12:05 +0000
@@ -715,7 +690,7 @@ (defun hi-lock-set-pattern (regexp face)
"Highlight REGEXP with face FACE."
;; Hashcons the regexp, so it can be passed to remove-overlays later.
(setq regexp (hi-lock--hashcons regexp))
- (let ((pattern (list regexp (list 0 (list 'quote face) t))))
+ (let ((pattern (list regexp (list 0 (list 'quote face) 'prepend))))
;; Refuse to highlight a text that is already highlighted.
(unless (assoc regexp hi-lock-interactive-patterns)
(push pattern hi-lock-interactive-patterns)