]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix reading faces with a default value that is a symbol
authorPo Lu <luangruo@yahoo.com>
Mon, 9 May 2022 12:23:20 +0000 (20:23 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 9 May 2022 12:23:40 +0000 (20:23 +0800)
* lisp/faces.el (read-face-name): Don't try to intern face if it
is already a symbol.

lisp/faces.el

index 1ada05a7b8bf17009d5caa726d04e5af7dc883bb..2d4b7761be6e40bc7cab6bac0523d86591b14fb1 100644 (file)
@@ -1148,13 +1148,18 @@ returned.  Otherwise, DEFAULT is returned verbatim."
                            nil t nil 'face-name-history default))
               ;; Ignore elements that are not faces
               ;; (for example, because DEFAULT was "all faces")
-              (if (facep face) (push (intern face) faces)))
+              (if (facep face) (push (if (stringp face)
+                                         (intern face)
+                                       face)
+                                     faces)))
             (nreverse faces))
         (let ((face (completing-read
                      prompt
                      (completion-table-in-turn nonaliasfaces aliasfaces)
                      nil t nil 'face-name-history defaults)))
-          (if (facep face) (intern face)))))))
+          (when (facep face) (if (stringp face)
+                                 (intern face)
+                               face)))))))
 
 ;; Not defined without X, but behind window-system test.
 (defvar x-bitmap-file-path)