GNU bug report logs - #14645
Keep highlighting face foreground

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> jurta.org>

Date: Mon, 17 Jun 2013 23:08:02 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


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 14645 <at> debbugs.gnu.org
Subject: bug#14645: Keep highlighting face foreground
Date: Thu, 13 Aug 2020 13:35:13 +0200
Juri Linkov <juri <at> jurta.org> writes:

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

If I'm reading this correctly, something similar has been added in the
intervening years:

  (let ((pattern (list (lambda (limit)
                         (let ((case-fold-search case-fold)
                               (search-spaces-regexp spaces-regexp))
                           (re-search-forward regexp limit t)))
                       (list subexp (list 'quote face) 'prepend)))

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

Previous Next


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