GNU bug report logs - #36767
26.1; request: add more quick keys to the *Help* buffer

Previous Next

Package: emacs;

Reported by: ndame <emacsuser <at> freemail.hu>

Date: Mon, 22 Jul 2019 20:31:01 UTC

Severity: wishlist

Found in version 26.1

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 36767 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 36767 <at> debbugs.gnu.org, ndame <emacsuser <at> freemail.hu>
Subject: Re: bug#36767: 26.1; request: add more quick keys to the *Help* buffer
Date: Thu, 17 Jun 2021 23:34:36 +0300
[Message part 1 (text/plain, inline)]
>> The Help buffer shows a link to the source code where the symbol is
>> defined. Add the currently unbound key 's' to quickly visit the source
>> code without having to navigate to the link.
>>
>> Also, the user may want to read more about the symbol if it is
>> a built in one, so add a quick way to visit the Info page
>> of the symbol which Help is shown. The currently unbound key 'i' is
>> suitable for this purpose.
>
> Makes sense to me -- you can tab to the button, and `C-h S' works, but
> both are more fiddly, so I've added these commands to Emacs 28.

Another missing key is a way to easily customize a variable or a face.
Currently it's a hassle to navigate to the [Customize] button,
whereas with a key when point is on a variable name
it would be possible to type just 'C-h v RET c' to customize it.

> Which was unexpectedly quite a lot of work, since the *Help* buffers
> don't really seem to have any data available to say what they're about.

Since you've already done all the hard work,
it was very easy to add a new command:

[help-customize.patch (text/x-diff, inline)]
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

This bug report was last modified 3 years and 239 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.