Skip to content

Commit f339cc3

Browse files
committed
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.
1 parent a5d1bd6 commit f339cc3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lisp/facemenu.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,13 @@ they are used to set the face information.
718718
As a special case, if FACE is `default', then the region is left with NO face
719719
text property. Otherwise, selecting the default face would not have any
720720
effect. See `facemenu-remove-face-function'."
721-
(interactive "*xFace: \nr")
721+
(interactive (list (progn
722+
(barf-if-buffer-read-only)
723+
(read-face-name "Use face" (face-at-point t)))
724+
(if (and mark-active (not current-prefix-arg))
725+
(region-beginning))
726+
(if (and mark-active (not current-prefix-arg))
727+
(region-end))))
722728
(cond
723729
((and (eq face 'default)
724730
(not (eq facemenu-remove-face-function t)))

0 commit comments

Comments
 (0)