changeset 79653:f99fcd1db425

(font-lock-prepend-text-property, font-lock-append-text-property): Canonicalize the face and font-lock-face properties.
author Richard M. Stallman <rms@gnu.org>
date Sat, 29 Dec 2007 19:12:22 +0000
parents ec8eb07f75bf
children f08acdd4b6ef
files lisp/font-lock.el
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/font-lock.el	Sat Dec 29 19:10:34 2007 +0000
+++ b/lisp/font-lock.el	Sat Dec 29 19:12:22 2007 +0000
@@ -1295,6 +1295,12 @@
     (while (/= start end)
       (setq next (next-single-property-change start prop object end)
 	    prev (get-text-property start prop object))
+      ;; Canonicalize old forms of face property.
+      (and (memq prop '(face font-lock-face))
+	   (listp prev)
+	   (or (keywordp (car prev))
+	       (memq (car prev) '(foreground-color background-color)))
+	   (setq prev (list prev)))
       (put-text-property start next prop
 			 (append val (if (listp prev) prev (list prev)))
 			 object)
@@ -1309,6 +1315,12 @@
     (while (/= start end)
       (setq next (next-single-property-change start prop object end)
 	    prev (get-text-property start prop object))
+      ;; Canonicalize old forms of face property.
+      (and (memq prop '(face font-lock-face))
+	   (listp prev)
+	   (or (keywordp (car prev))
+	       (memq (car prev) '(foreground-color background-color)))
+	   (setq prev (list prev)))
       (put-text-property start next prop
 			 (append (if (listp prev) prev (list prev)) val)
 			 object)