diff options
author | Richard M. Stallman <rms@gnu.org> | 2007-12-29 19:12:30 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2007-12-29 19:12:30 +0000 |
commit | 4fed1740bd3d843e21f18b4eac599c203f5378fa (patch) | |
tree | f9d8bcf2e0c3b6d12610c52bc0167a7f3c1f2ccf | |
parent | 20d29b0bbc8650957cf62643ff8e6683709693c5 (diff) | |
download | emacs-4fed1740bd3d843e21f18b4eac599c203f5378fa.tar.gz |
(font-lock-prepend-text-property, font-lock-append-text-property):
Canonicalize the face and font-lock-face properties.
-rw-r--r-- | lisp/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/font-lock.el | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5da1bb7b6c6..0ab19236752 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2007-12-29 Richard Stallman <rms@gnu.org> + * font-lock.el (font-lock-prepend-text-property) + (font-lock-append-text-property): Canonicalize the face and + font-lock-face properties. + * faces.el (facep): Doc fix. * startup.el (fancy-startup-tail, fancy-about-text) diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 6bc5fd8716f..bc7e7f1e325 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1295,6 +1295,12 @@ Optional argument OBJECT is the string or buffer containing the text." (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 @@ Optional argument OBJECT is the string or buffer containing the text." (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) |