aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleh Krehel2020-09-17 20:43:34 +0200
committerLars Ingebrigtsen2020-09-17 20:43:40 +0200
commit65b7d465a5e5afaa5332cb8d24b0834ebb7633fc (patch)
treea639e8646a2dad2589c5edd1a24f403cb06c359c
parent8b61e20e4edb9d2f67134bc9f3739f936aafb01c (diff)
downloademacs-65b7d465a5e5afaa5332cb8d24b0834ebb7633fc.tar.gz
emacs-65b7d465a5e5afaa5332cb8d24b0834ebb7633fc.zip
Make face names clickable in Customize buffers
* lisp/cus-edit.el (custom-face-value-create): Make the face name a clickable button (bug#20664).
-rw-r--r--lisp/cus-edit.el27
1 files changed, 14 insertions, 13 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 6d0ec5d1486..9626b3cf810 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3560,19 +3560,20 @@ the present value is saved to its :shown-value property instead."
3560 (widget-put widget :buttons buttons)) 3560 (widget-put widget :buttons buttons))
3561 3561
3562 ;; Draw an ordinary `custom-face' widget 3562 ;; Draw an ordinary `custom-face' widget
3563 (let ((opoint (point))) 3563 ;; Visibility indicator.
3564 ;; Visibility indicator. 3564 (push (widget-create-child-and-convert
3565 (push (widget-create-child-and-convert 3565 widget 'custom-visibility
3566 widget 'custom-visibility 3566 :help-echo "Hide or show this face."
3567 :help-echo "Hide or show this face." 3567 :on "Hide" :off "Show"
3568 :on "Hide" :off "Show" 3568 :on-glyph "down" :off-glyph "right"
3569 :on-glyph "down" :off-glyph "right" 3569 :action 'custom-toggle-hide-face
3570 :action 'custom-toggle-hide-face 3570 (not hiddenp))
3571 (not hiddenp)) 3571 buttons)
3572 buttons) 3572 ;; Face name (tag).
3573 ;; Face name (tag). 3573 (insert " ")
3574 (insert " " tag) 3574 (insert-text-button tag
3575 (widget-specify-sample widget opoint (point))) 3575 'action (lambda (&rest _x)
3576 (find-face-definition symbol)))
3576 (insert 3577 (insert
3577 (cond ((eq custom-buffer-style 'face) " ") 3578 (cond ((eq custom-buffer-style 'face) " ")
3578 ((string-match-p "face\\'" tag) ":") 3579 ((string-match-p "face\\'" tag) ":")