[N.B. I posted this on comp.emacs.xemacs a week ago. A cc of any
discussion would be appreciated. Thanks.]
Xemacs 21.4.4
If font-lock-syntactic-keywords (that's the thing with which font-lock
applies individual syntax codes to some characters in a buffer, with the
intention of later fontifying these accordingly) is set, then...
... it (font-lock-syntactic-keywords) passes into the function
font-lock-compile-keywords, where its value is overwrites
font-lock-keywords, because of an unfortunate setq. This visible effect
of this is to disable keyword fontification.
The following patch fixes it (at least, it does for me :-). I had a
quick peep at the latest (about a week ago) CVS version. The bug hadn't
been fixed there yet, either.
Incidentally, <
http://www.xemacs.org/lists/index.html> doesn't seem to
state explicitly what the addresses of the mailing lists are. I have
assumed that xemacs-beta(a)xemacs.org is correct (I'm not expecting a
bounce), but I think an explicit address would be helpful.
2002-09-20 Alan Mackenzie <acm(a)muc.de>
* font-lock.el: Remove spurious setq from font-lock-compile-keywords.
*** font-lock-21.4.4.el Fri Sep 20 18:00:32 2002
--- font-lock.el Fri Sep 20 19:53:08 2002
***************
*** 1597,1603 ****
(let* ((case-fold-search font-lock-keywords-case-fold-search)
(keywords (cdr (if (eq (car-safe font-lock-keywords) t)
font-lock-keywords
! (font-lock-compile-keywords))))
(bufname (buffer-name))
(progress 5) (old-progress 5)
(iter 0)
--- 1597,1604 ----
(let* ((case-fold-search font-lock-keywords-case-fold-search)
(keywords (cdr (if (eq (car-safe font-lock-keywords) t)
font-lock-keywords
! (setq font-lock-keywords
! (font-lock-compile-keywords font-lock-keywords)))))
(bufname (buffer-name))
(progress 5) (old-progress 5)
(iter 0)
***************
*** 1671,1684 ****
;; Various functions.
! (defun font-lock-compile-keywords (&optional keywords)
! ;; Compile `font-lock-keywords' into the form (t KEYWORD ...) where KEYWORD
! ;; is the (MATCHER HIGHLIGHT ...) shown in the variable's doc string.
! (let ((keywords (or keywords font-lock-keywords)))
! (setq font-lock-keywords
! (if (eq (car-safe keywords) t)
! keywords
! (cons t (mapcar 'font-lock-compile-keyword keywords))))))
(defun font-lock-compile-keyword (keyword)
(cond ((nlistp keyword) ; Just MATCHER
--- 1672,1685 ----
;; Various functions.
! (defun font-lock-compile-keywords (keywords)
! ;; Compile `font-lock-\(syntactic-\)?keywords' into the form (t KEYWORD ...)
! ;; where KEYWORD is the (MATCHER HIGHLIGHT ...) shown in the variable's doc
! ;; string.
! ;; (setq font-lock-keywords NO! NO! KEYWORDS is sometimes f-l-syntactic-k
! (if (eq (car-safe keywords) t)
! keywords
! (cons t (mapcar 'font-lock-compile-keyword keywords))))
(defun font-lock-compile-keyword (keyword)
(cond ((nlistp keyword) ; Just MATCHER
--
Alan Mackenzie (Munich, Germany)
acm(a)muc.de