Allow using a single anonymous face in enriced-mode
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 Aug 2021 20:29:38 +0000 (22:29 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 11 Aug 2021 20:29:38 +0000 (22:29 +0200)
* lisp/format.el (format-annotate-single-property-change): Allow
using a single anonymous face (bug#33682).

lisp/format.el

index 1e87d252844fb52a5cf70a45bcaf980549acbf63..71cf885d417d90ba15e66ec51579eeecb5026399 100644 (file)
@@ -1013,6 +1013,12 @@ either strings, or lists of the form (PARAMETER VALUE)."
                                    prop-alist (car old) nil))
                              close)
                      old (cdr old)))
+              ;; If the font is on the format (:background "red"),
+              ;; then we have a single face.  We're assuming a list of
+              ;; faces, so transform.
+              (when (and (listp new)
+                         (keywordp (car new)))
+                (setq new (list new)))
              (while new
                (setq open
                      (append (cdr (format-annotate-atomic-property-change