[Top][All Lists]

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

Re: font-lock-add-keywords in hi-lock.el

From: Juri Linkov
Subject: Re: font-lock-add-keywords in hi-lock.el
Date: Thu, 15 Dec 2005 12:11:05 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

>> Was this patch expected to fix the broken Gnus highlighting me and
>> others have reported?
> No, we fixed this one on November 24th.

Yes, Gnus highlighting was fixed already, and my patch is not intended to
fix it.  My patch fixes highlighting in normal font-lock supporting modes.
The fix in hi-lock-set-pattern installed on November 24th tries to emulate
font-lock's machinery on special buffers like Gnus summary and article
buffers.  This emulation is not as persistent as font-lock, i.e. it doesn't
refontify the buffer after its contents changes.  This limitation doesn't
affect font-lock supporting buffers, because faces added on the font-lock
supporting buffer by hi-lock-set-pattern get immediately overwritten by
font-lock keywords.  So font-lock supporting buffers just ignore font-lock
emulation in hi-lock-set-pattern.  I currently don't see a solution how to
make special buffers to support correct font-lock refontification.

However, I see there is one significant difference between font-lock
fontification and its emulation in hi-lock-set-pattern.  It ignores
the value of font-lock-keywords-case-fold-search.  This can be fixed
by the following patch:

Index: lisp/hi-lock.el
RCS file: /sources/emacs/emacs/lisp/hi-lock.el,v
retrieving revision 1.35
diff -c -r1.35 hi-lock.el
*** lisp/hi-lock.el     10 Dec 2005 11:47:28 -0000      1.35
--- lisp/hi-lock.el     15 Dec 2005 09:59:54 -0000
*** 526,536 ****
        (push pattern hi-lock-interactive-patterns)
        (let ((buffer-undo-list t)
            (inhibit-read-only t)
!           (mod (buffer-modified-p)))
          (goto-char (point-min))
          (while (re-search-forward regexp (point-max) t)
--- 543,554 ----
        (push pattern hi-lock-interactive-patterns)
        (let ((buffer-undo-list t)
            (inhibit-read-only t)
!           (mod (buffer-modified-p))
!           (case-fold-search font-lock-keywords-case-fold-search))
          (goto-char (point-min))
          (while (re-search-forward regexp (point-max) t)

Juri Linkov

reply via email to

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