Make face names clickable in Customize buffers

* lisp/cus-edit.el (custom-face-value-create): Make the face name
a clickable button (bug#20664).
This commit is contained in:
Oleh Krehel 2020-09-17 20:43:34 +02:00 committed by Lars Ingebrigtsen
parent 8b61e20e4e
commit 65b7d465a5

View file

@ -3560,19 +3560,20 @@ the present value is saved to its :shown-value property instead."
(widget-put widget :buttons buttons))
;; Draw an ordinary `custom-face' widget
(let ((opoint (point)))
;; Visibility indicator.
(push (widget-create-child-and-convert
widget 'custom-visibility
:help-echo "Hide or show this face."
:on "Hide" :off "Show"
:on-glyph "down" :off-glyph "right"
:action 'custom-toggle-hide-face
(not hiddenp))
buttons)
;; Face name (tag).
(insert " " tag)
(widget-specify-sample widget opoint (point)))
;; Visibility indicator.
(push (widget-create-child-and-convert
widget 'custom-visibility
:help-echo "Hide or show this face."
:on "Hide" :off "Show"
:on-glyph "down" :off-glyph "right"
:action 'custom-toggle-hide-face
(not hiddenp))
buttons)
;; Face name (tag).
(insert " ")
(insert-text-button tag
'action (lambda (&rest _x)
(find-face-definition symbol)))
(insert
(cond ((eq custom-buffer-style 'face) " ")
((string-match-p "face\\'" tag) ":")