emacs-diffs
[Top][All Lists]
Advanced

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

master f339cc3: Add a better interactive spec to `facemenu-add-face'


From: Lars Ingebrigtsen
Subject: master f339cc3: Add a better interactive spec to `facemenu-add-face'
Date: Tue, 13 Jul 2021 18:13:01 -0400 (EDT)

branch: master
commit f339cc3b81e28cabfd583c862b5011ac40acf935
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add a better interactive spec to `facemenu-add-face'
    
    * lisp/facemenu.el (facemenu-add-face): Use `read-face-name'
    (bug#18369) by copying over the interactive spec from
    facemenu-set-face.
---
 lisp/facemenu.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 8631be9..7229d61 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -718,7 +718,13 @@ they are used to set the face information.
 As a special case, if FACE is `default', then the region is left with NO face
 text property.  Otherwise, selecting the default face would not have any
 effect.  See `facemenu-remove-face-function'."
-  (interactive "*xFace: \nr")
+  (interactive (list (progn
+                      (barf-if-buffer-read-only)
+                      (read-face-name "Use face" (face-at-point t)))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-beginning))
+                    (if (and mark-active (not current-prefix-arg))
+                        (region-end))))
   (cond
    ((and (eq face 'default)
          (not (eq facemenu-remove-face-function t)))



reply via email to

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