summaryrefslogtreecommitdiff
path: root/lisp/font-lock.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2000-03-18 01:33:13 +0000
committerGerd Moellmann <gerd@gnu.org>2000-03-18 01:33:13 +0000
commitbdb25c9734862738eafab1e8523406d2595c6f6e (patch)
tree9227a2a3865e155ed8f42365280d1ffdd15fbcdc /lisp/font-lock.el
parent525371f1384c36e752da713c8c9dfe6f9c290b7f (diff)
downloademacs-bdb25c9734862738eafab1e8523406d2595c6f6e.tar.gz
(font-lock-apply-syntactic-highlight): if VALUE
is a string, convert it to a syntax cell using string-to-syntax.
Diffstat (limited to 'lisp/font-lock.el')
-rw-r--r--lisp/font-lock.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 91775206f3a..46823558240 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -532,9 +532,10 @@ the differences are listed below. MATCH-HIGHLIGHT should be of the form:
(MATCH SYNTAX OVERRIDE LAXMATCH)
-where SYNTAX can be of the form (SYNTAX-CODE . MATCHING-CHAR), the name of a
-syntax table, or an expression whose value is such a form or a syntax table.
-OVERRIDE cannot be `prepend' or `append'.
+where SYNTAX can be of the form (SYNTAX-CODE . MATCHING-CHAR) (see
+also `string-to-syntax'), the name of a syntax table, or an expression
+whose value is such a form or a syntax table. OVERRIDE cannot be
+`prepend' or `append'.
For example, an element of the form highlights syntactically:
@@ -1391,8 +1392,10 @@ see `font-lock-syntactic-keywords'."
(start (match-beginning match)) (end (match-end match))
(value (nth 1 highlight))
(override (nth 2 highlight)))
- (unless (numberp (car-safe value))
- (setq value (eval value)))
+ (cond ((stringp value)
+ (setq value (string-to-syntax value)))
+ ((not (numberp (car-safe value)))
+ (setq value (eval value))))
(cond ((not start)
;; No match but we might not signal an error.
(or (nth 3 highlight)