Mercurial > emacs
comparison lisp/font-lock.el @ 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 | 7c8949dbfa0d |
children | 73661ddc7ac7 6a0c500ca3a9 |
comparison
equal
deleted
inserted
replaced
79652:ec8eb07f75bf | 79653:f99fcd1db425 |
---|---|
1293 Optional argument OBJECT is the string or buffer containing the text." | 1293 Optional argument OBJECT is the string or buffer containing the text." |
1294 (let ((val (if (listp value) value (list value))) next prev) | 1294 (let ((val (if (listp value) value (list value))) next prev) |
1295 (while (/= start end) | 1295 (while (/= start end) |
1296 (setq next (next-single-property-change start prop object end) | 1296 (setq next (next-single-property-change start prop object end) |
1297 prev (get-text-property start prop object)) | 1297 prev (get-text-property start prop object)) |
1298 ;; Canonicalize old forms of face property. | |
1299 (and (memq prop '(face font-lock-face)) | |
1300 (listp prev) | |
1301 (or (keywordp (car prev)) | |
1302 (memq (car prev) '(foreground-color background-color))) | |
1303 (setq prev (list prev))) | |
1298 (put-text-property start next prop | 1304 (put-text-property start next prop |
1299 (append val (if (listp prev) prev (list prev))) | 1305 (append val (if (listp prev) prev (list prev))) |
1300 object) | 1306 object) |
1301 (setq start next)))) | 1307 (setq start next)))) |
1302 | 1308 |
1307 Optional argument OBJECT is the string or buffer containing the text." | 1313 Optional argument OBJECT is the string or buffer containing the text." |
1308 (let ((val (if (listp value) value (list value))) next prev) | 1314 (let ((val (if (listp value) value (list value))) next prev) |
1309 (while (/= start end) | 1315 (while (/= start end) |
1310 (setq next (next-single-property-change start prop object end) | 1316 (setq next (next-single-property-change start prop object end) |
1311 prev (get-text-property start prop object)) | 1317 prev (get-text-property start prop object)) |
1318 ;; Canonicalize old forms of face property. | |
1319 (and (memq prop '(face font-lock-face)) | |
1320 (listp prev) | |
1321 (or (keywordp (car prev)) | |
1322 (memq (car prev) '(foreground-color background-color))) | |
1323 (setq prev (list prev))) | |
1312 (put-text-property start next prop | 1324 (put-text-property start next prop |
1313 (append (if (listp prev) prev (list prev)) val) | 1325 (append (if (listp prev) prev (list prev)) val) |
1314 object) | 1326 object) |
1315 (setq start next)))) | 1327 (setq start next)))) |
1316 | 1328 |