[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 65b7d46 3/3: Make face names clickable in Customize buffers
From: |
Lars Ingebrigtsen |
Subject: |
master 65b7d46 3/3: Make face names clickable in Customize buffers |
Date: |
Thu, 17 Sep 2020 14:43:47 -0400 (EDT) |
branch: master
commit 65b7d465a5e5afaa5332cb8d24b0834ebb7633fc
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Make face names clickable in Customize buffers
* lisp/cus-edit.el (custom-face-value-create): Make the face name
a clickable button (bug#20664).
---
lisp/cus-edit.el | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 6d0ec5d..9626b3c 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."
(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) ":")