Commit bdb25c97 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(font-lock-apply-syntactic-highlight): if VALUE

is a string, convert it to a syntax cell using string-to-syntax.
parent 525371f1
...@@ -532,9 +532,10 @@ the differences are listed below. MATCH-HIGHLIGHT should be of the form: ...@@ -532,9 +532,10 @@ the differences are listed below. MATCH-HIGHLIGHT should be of the form:
(MATCH SYNTAX OVERRIDE LAXMATCH) (MATCH SYNTAX OVERRIDE LAXMATCH)
where SYNTAX can be of the form (SYNTAX-CODE . MATCHING-CHAR), the name of a where SYNTAX can be of the form (SYNTAX-CODE . MATCHING-CHAR) (see
syntax table, or an expression whose value is such a form or a syntax table. also `string-to-syntax'), the name of a syntax table, or an expression
OVERRIDE cannot be `prepend' or `append'. 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: For example, an element of the form highlights syntactically:
...@@ -1391,8 +1392,10 @@ see `font-lock-syntactic-keywords'." ...@@ -1391,8 +1392,10 @@ see `font-lock-syntactic-keywords'."
(start (match-beginning match)) (end (match-end match)) (start (match-beginning match)) (end (match-end match))
(value (nth 1 highlight)) (value (nth 1 highlight))
(override (nth 2 highlight))) (override (nth 2 highlight)))
(unless (numberp (car-safe value)) (cond ((stringp value)
(setq value (eval value))) (setq value (string-to-syntax value)))
((not (numberp (car-safe value)))
(setq value (eval value))))
(cond ((not start) (cond ((not start)
;; No match but we might not signal an error. ;; No match but we might not signal an error.
(or (nth 3 highlight) (or (nth 3 highlight)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment