i***@sxemacs.org
2016-09-14 08:08:21 UTC
http://issues.sxemacs.org/show_bug.cgi?id=184
Bug ID: 184
Summary: font-lock-add-keywords gives corrupted
font-lock-keywords, Lisp file out of sync with XEmacs
Product: SXEmacs
Version: 22.1.16
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Core Lisp
Assignee: ***@sxemacs.org
Reporter: ***@keelhaul.me.uk
QA Contact: sxemacs-***@sxemacs.org
Simple test case: Load a plain test file
(setq font-lock-keywords '(("\\bthe\\b" . font-lock-keyword-face)))
Toggle font lock mode, this correctly fontifies the buffer with each occurence
of "the" highlighted. The font-lock-keywords have been compiled (which in this
simple case changes little apart from adding the t at the beginning to indicate
so):
font-lock-keywords
=> (t ("\\bthe\\b" (0 font-lock-keyword-face)))
Then try to add another highlighting keyword:
(font-lock-add-keywords nil '(("\\bis\\b" . font-lock-function-name-face)))
Now toggling font lock gives the message "Fontifying buffer...
aborted.aborted." and font-lock-keywords is now corrupted:
font-lock-keywords
=> (t ("\\bis\\b" (0 font-lock-function-name-face))
("\\bthe\\b" (0 font-lock-keyword-face))
(0 (font-lock-keyword-face)))
The file lisp/font-lock.el appears to be out of date with the corresponding
file included with XEmacs. SXEmacs' version includes the header comment:
;; Copyright (C) 1996, 2000, 2001 Ben Wing.
wherease XEmacs (version 21.5.34) has:
;; Copyright (C) 1996, 2000, 2001, 2002, 2004 Ben Wing.
There are lots of differences between these two files, some of them only
whitespace, but the essential difference in the font-lock-add-keywords function
is:
@@ -988,7 +988,7 @@ see the variables `c-font-lock-extra-types',
`c++-font-lock-extra-types',
(let ((was-compiled (eq (car font-lock-keywords) t)))
;; Bring back the user-level (uncompiled) keywords.
(if was-compiled
- (setq font-lock-keywords (cadr font-lock-keywords)))
+ (setq font-lock-keywords (cdr font-lock-keywords)))
;; Now modify or replace them.
(if (eq how 'set)
(setq font-lock-keywords keywords)
Applying this patch and rebuilding SXEmacs gives correct results:
(setq font-lock-keywords '(("\\bthe\\b" . font-lock-keyword-face)))
(font-lock-add-keywords nil '(("\\bis\\b" . font-lock-function-name-face)))
font-lock-keywords
=> (t ("\\bis\\b" (0 font-lock-function-name-face))
("\\bthe\\b" (0 font-lock-keyword-face)))
and the buffer is fontified correctly.
It is not possible to simply replace font-lock.el with the newer XEmacs
version, because it has other dependencies (e.g. on lisp-mode.el).
Bug ID: 184
Summary: font-lock-add-keywords gives corrupted
font-lock-keywords, Lisp file out of sync with XEmacs
Product: SXEmacs
Version: 22.1.16
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Core Lisp
Assignee: ***@sxemacs.org
Reporter: ***@keelhaul.me.uk
QA Contact: sxemacs-***@sxemacs.org
Simple test case: Load a plain test file
(setq font-lock-keywords '(("\\bthe\\b" . font-lock-keyword-face)))
Toggle font lock mode, this correctly fontifies the buffer with each occurence
of "the" highlighted. The font-lock-keywords have been compiled (which in this
simple case changes little apart from adding the t at the beginning to indicate
so):
font-lock-keywords
=> (t ("\\bthe\\b" (0 font-lock-keyword-face)))
Then try to add another highlighting keyword:
(font-lock-add-keywords nil '(("\\bis\\b" . font-lock-function-name-face)))
Now toggling font lock gives the message "Fontifying buffer...
aborted.aborted." and font-lock-keywords is now corrupted:
font-lock-keywords
=> (t ("\\bis\\b" (0 font-lock-function-name-face))
("\\bthe\\b" (0 font-lock-keyword-face))
(0 (font-lock-keyword-face)))
The file lisp/font-lock.el appears to be out of date with the corresponding
file included with XEmacs. SXEmacs' version includes the header comment:
;; Copyright (C) 1996, 2000, 2001 Ben Wing.
wherease XEmacs (version 21.5.34) has:
;; Copyright (C) 1996, 2000, 2001, 2002, 2004 Ben Wing.
There are lots of differences between these two files, some of them only
whitespace, but the essential difference in the font-lock-add-keywords function
is:
@@ -988,7 +988,7 @@ see the variables `c-font-lock-extra-types',
`c++-font-lock-extra-types',
(let ((was-compiled (eq (car font-lock-keywords) t)))
;; Bring back the user-level (uncompiled) keywords.
(if was-compiled
- (setq font-lock-keywords (cadr font-lock-keywords)))
+ (setq font-lock-keywords (cdr font-lock-keywords)))
;; Now modify or replace them.
(if (eq how 'set)
(setq font-lock-keywords keywords)
Applying this patch and rebuilding SXEmacs gives correct results:
(setq font-lock-keywords '(("\\bthe\\b" . font-lock-keyword-face)))
(font-lock-add-keywords nil '(("\\bis\\b" . font-lock-function-name-face)))
font-lock-keywords
=> (t ("\\bis\\b" (0 font-lock-function-name-face))
("\\bthe\\b" (0 font-lock-keyword-face)))
and the buffer is fontified correctly.
It is not possible to simply replace font-lock.el with the newer XEmacs
version, because it has other dependencies (e.g. on lisp-mode.el).
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are receiving this mail because:
You are the QA Contact for the bug.