summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-10-27 11:32:14 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-10-27 11:32:14 +0100
commit7d429d7ef0dc864ddb869593d4938926248624a8 (patch)
tree5da01b7967b180d20cc13999ac0505757181396e /lisp
parent8d3ed5f815de0e12fb11f809d295c2820643295d (diff)
downloademacs-7d429d7ef0dc864ddb869593d4938926248624a8.tar.gz
emacs-7d429d7ef0dc864ddb869593d4938926248624a8.tar.bz2
emacs-7d429d7ef0dc864ddb869593d4938926248624a8.zip
Add a link to inherited faces in Customize
* lisp/cus-edit.el (cus--face-link): New function (bug#44154). (face): Use the function to format the link.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/cus-edit.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 85c197b400f..ed0117e067b 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3739,6 +3739,15 @@ the present value is saved to its :shown-value property instead."
(widget-put widget :children children)
(custom-face-state-set widget))))))
+(defun cus--face-link (widget _format)
+ (let ((face (intern (widget-get widget :value))))
+ (widget-create-child-and-convert
+ widget 'face-link
+ :button-face 'link
+ :tag "link"
+ :action (lambda (&rest _x)
+ (customize-face face)))))
+
(defvar custom-face-menu nil
"If non-nil, an alist of actions for the `custom-face' widget.
@@ -4008,7 +4017,7 @@ restoring it to the state of a face that has never been customized."
(define-widget 'face 'symbol
"A Lisp face name (with sample)."
- :format "%{%t%}: (%{sample%}) %v"
+ :format "%f %{%t%}: (%{sample%}) %v"
:tag "Face"
:value 'default
:sample-face-get 'widget-face-sample-face-get
@@ -4018,6 +4027,7 @@ restoring it to the state of a face that has never been customized."
obarray #'facep 'strict)
:prompt-match 'facep
:prompt-history 'widget-face-prompt-value-history
+ :format-handler 'cus--face-link
:validate (lambda (widget)
(unless (facep (widget-value widget))
(widget-put widget