changeset 28192:6d1e3113c08e

(font-lock-apply-syntactic-highlight): if VALUE is a string, convert it to a syntax cell using string-to-syntax.
author Gerd Moellmann <gerd@gnu.org>
date Sat, 18 Mar 2000 01:33:13 +0000
parents b65709e0ea05
children 89fb4e786f9c
files lisp/font-lock.el
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/font-lock.el	Sat Mar 18 01:06:46 2000 +0000
+++ b/lisp/font-lock.el	Sat Mar 18 01:33:13 2000 +0000
@@ -532,9 +532,10 @@
 
  (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 @@
 	 (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)