diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 48cf435f97..24b7ffaa2a 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -46,6 +46,7 @@ help-mode-map (define-key map "\r" 'help-follow) (define-key map "s" 'help-view-source) (define-key map "i" 'help-goto-info) + (define-key map "c" 'help-customize) map) "Keymap for Help mode.") @@ -63,7 +64,9 @@ help-mode-menu ["View Source" help-view-source :help "Go to the source file for the current help item"] ["Goto Info" help-goto-info - :help "Go to the info node for the current help item"])) + :help "Go to the info node for the current help item"] + ["Customize" help-customize + :help "Customize variable or face"])) (defvar help-mode-tool-bar-map (let ((map (make-sparse-keymap))) @@ -746,6 +749,16 @@ help-goto-info (info-lookup-symbol (plist-get help-mode--current-data :symbol) 'emacs-lisp-mode)) +(defun help-customize () + "Customize variable or face." + (interactive nil help-mode) + (let ((sym (plist-get help-mode--current-data :symbol))) + (unless (or (boundp sym) (facep sym)) + (user-error "No variable or face to customize")) + (cond + ((boundp sym) (customize-variable sym)) + ((facep sym) (customize-face sym))))) + (defun help-do-xref (_pos function args) "Call the help cross-reference function FUNCTION with args ARGS. Things are set up properly so that the resulting help-buffer has