summaryrefslogtreecommitdiff
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2005-12-30 04:38:52 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2005-12-30 04:38:52 +0000
commitaf3d4246e08b6a8831cdd912486e5458c7fa4643 (patch)
tree41e39f3e5ac7191c1cdcbca7a9c63ca378e781d5 /lisp/font-lock.el
parentb515436461f26f6be42b89612a9a9a8243271516 (diff)
downloademacs-af3d4246e08b6a8831cdd912486e5458c7fa4643.tar.gz
(font-lock-compile-keywords): Signal an error when
font-lock-set-defaults hasn't been called.
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index ca0848bd561..c05de2bc0b5 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1507,6 +1507,13 @@ Here each COMPILED is of the form (MATCHER HIGHLIGHT ...) as shown in the
`font-lock-keywords' doc string.
If REGEXP is non-nil, it means these keywords are used for
`font-lock-keywords' rather than for `font-lock-syntactic-keywords'."
+ (if (not font-lock-set-defaults)
+ ;; This should never happen. But some external packages sometimes
+ ;; call font-lock in unexpected and incorrect ways. It's important to
+ ;; stop processing at this point, otherwise we may end up changing the
+ ;; global value of font-lock-keywords and break highlighting in many
+ ;; other buffers.
+ (error "Font-lock trying to use keywords before setting them up"))
(if (eq (car-safe keywords) t)
keywords
(setq keywords