emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master f478082: Refrain from splicing anonymous faces in t


From: Stefan Monnier
Subject: [Emacs-diffs] master f478082: Refrain from splicing anonymous faces in text properties
Date: Mon, 29 Apr 2019 17:29:55 -0400 (EDT)

branch: master
commit f478082f9ff22ff41fbd9616ebea75757f9a0311
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    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.
---
 lisp/font-lock.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 1475911..d0f7096 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -1096,7 +1096,7 @@ accessible portion of the current buffer."
   (lambda (beg end)
     (unless font-lock-fontified
       (save-excursion
-        (font-lock-fontify-region (or beg (point-min)) (or end (point-max))))))
+        (font-lock-fontify-region beg end))))
   "Function to make sure a region has been fontified.
 Called with two arguments BEG and END.")
 
@@ -1392,7 +1392,12 @@ delimit the region to fontify."
 Arguments PROP and VALUE specify the property and value to prepend to the value
 already in place.  The resulting property values are always lists.
 Optional argument OBJECT is the string or buffer containing the text."
-  (let ((val (if (listp value) value (list value))) next prev)
+  (let ((val (if (and (listp value) (not (keywordp (car value))))
+                 ;; Already a list of faces.
+                 value
+               ;; A single face (e.g. a plist of face properties).
+               (list value)))
+        next prev)
     (while (/= start end)
       (setq next (next-single-property-change start prop object end)
            prev (get-text-property start prop object))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]