branch: elpa/magit
commit 1625d76712e8fcff0a608f5e276506c8710b7a27
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    magit--add-face-text-property: Better support string as OBJECT
    
    Allow BEG and END to be nil in that case.  Also return the OBJECT.
---
 lisp/magit-section.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/magit-section.el b/lisp/magit-section.el
index eed4e21b504..56993a4f673 100644
--- a/lisp/magit-section.el
+++ b/lisp/magit-section.el
@@ -2267,6 +2267,9 @@ Configuration'."
 
 (defun magit--add-face-text-property (beg end face &optional append object)
   "Like `add-face-text-property' but for `font-lock-face'."
+  (when (stringp object)
+    (unless beg (setq beg 0))
+    (unless end (setq end (length object))))
   (while (< beg end)
     (let* ((pos (next-single-property-change beg 'font-lock-face object end))
            (val (get-text-property beg 'font-lock-face object))
@@ -2276,7 +2279,8 @@ Configuration'."
                              (append val (list face))
                            (cons face val))
                          object)
-      (setq beg pos))))
+      (setq beg pos)))
+  object)
 
 (defun magit--propertize-face (string face)
   (propertize string 'face face 'font-lock-face face))

Reply via email to