diff options
| author | Stefan Monnier | 2019-04-29 17:29:47 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-04-29 17:29:47 -0400 |
| commit | f478082f9ff22ff41fbd9616ebea75757f9a0311 (patch) | |
| tree | 8320a26678151bd9795cbe344dbd9b17c5e32926 | |
| parent | 071a6927a89bc013d5e026e446d4ee503c59bc7b (diff) | |
| download | emacs-f478082f9ff22ff41fbd9616ebea75757f9a0311.tar.gz emacs-f478082f9ff22ff41fbd9616ebea75757f9a0311.zip | |
Refrain from splicing anonymous faces in text properties
* lisp/font-lock.el (font-lock-prepend-text-property): Distinguish
list of faces from property lists.
(font-lock-ensure-function): Remove redundant code.
| -rw-r--r-- | lisp/font-lock.el | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 1475911195a..d0f7096ab8b 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el | |||
| @@ -1096,7 +1096,7 @@ accessible portion of the current buffer." | |||
| 1096 | (lambda (beg end) | 1096 | (lambda (beg end) |
| 1097 | (unless font-lock-fontified | 1097 | (unless font-lock-fontified |
| 1098 | (save-excursion | 1098 | (save-excursion |
| 1099 | (font-lock-fontify-region (or beg (point-min)) (or end (point-max)))))) | 1099 | (font-lock-fontify-region beg end)))) |
| 1100 | "Function to make sure a region has been fontified. | 1100 | "Function to make sure a region has been fontified. |
| 1101 | Called with two arguments BEG and END.") | 1101 | Called with two arguments BEG and END.") |
| 1102 | 1102 | ||
| @@ -1392,7 +1392,12 @@ delimit the region to fontify." | |||
| 1392 | Arguments PROP and VALUE specify the property and value to prepend to the value | 1392 | Arguments PROP and VALUE specify the property and value to prepend to the value |
| 1393 | already in place. The resulting property values are always lists. | 1393 | already in place. The resulting property values are always lists. |
| 1394 | Optional argument OBJECT is the string or buffer containing the text." | 1394 | Optional argument OBJECT is the string or buffer containing the text." |
| 1395 | (let ((val (if (listp value) value (list value))) next prev) | 1395 | (let ((val (if (and (listp value) (not (keywordp (car value)))) |
| 1396 | ;; Already a list of faces. | ||
| 1397 | value | ||
| 1398 | ;; A single face (e.g. a plist of face properties). | ||
| 1399 | (list value))) | ||
| 1400 | next prev) | ||
| 1396 | (while (/= start end) | 1401 | (while (/= start end) |
| 1397 | (setq next (next-single-property-change start prop object end) | 1402 | (setq next (next-single-property-change start prop object end) |
| 1398 | prev (get-text-property start prop object)) | 1403 | prev (get-text-property start prop object)) |