>From bea177aff8de195d428106003fab8b8498e7aae8 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Wed, 27 May 2015 15:06:42 +0200 Subject: [PATCH] Allow to follow to face definition in Customize * lisp/cus-edit.el (custom-face-value-create): Make the face name into a button that calls `find-face-definition'. (Bug#20664) --- lisp/cus-edit.el | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 1d9a9d6..246f08e 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3483,19 +3483,22 @@ 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))) + (let (opoint) + ;; 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) + (setq opoint (point)) + ;; Face name (tag). + (insert " " tag) + (make-button opoint (point) + 'follow-link t + 'action (lambda (&rest _x) (find-face-definition symbol)))) (insert (cond ((eq custom-buffer-style 'face) " ") ((string-match-p "face\\'" tag) ":") -- 1.8.4