unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 36767@debbugs.gnu.org, ndame <emacsuser@freemail.hu>
Subject: bug#36767: 26.1; request: add more quick keys to the *Help* buffer
Date: Thu, 17 Jun 2021 23:34:36 +0300	[thread overview]
Message-ID: <87eed0nsez.fsf@mail.linkov.net> (raw)
In-Reply-To: <87mtrrq7t7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 15 Jun 2021 20:52:36 +0200")

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

>> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: help-customize.patch --]
[-- Type: text/x-diff, Size: 1488 bytes --]

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

  reply	other threads:[~2021-06-17 20:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22 19:53 bug#36767: 26.1; request: add more quick keys to the *Help* buffer ndame
2019-07-22 20:49 ` Drew Adams
2019-07-28  0:10   ` Basil L. Contovounesios
2021-06-15 18:52 ` Lars Ingebrigtsen
2021-06-17 20:34   ` Juri Linkov [this message]
2021-06-18  6:02     ` Eli Zaretskii
2021-06-18  7:20       ` Robert Pluim
2021-06-18 10:58         ` Eli Zaretskii
2021-06-18 14:21           ` bug#36767: [External] : " Drew Adams
2021-06-18 14:32           ` Stephen Berman
2021-06-18 14:45             ` Eli Zaretskii
2021-06-18 16:02               ` Stephen Berman
2021-06-18 18:25                 ` Eli Zaretskii
2021-06-19  9:08               ` martin rudalics
2021-06-19  9:27                 ` Eli Zaretskii
2021-06-20  9:21                   ` martin rudalics
2021-06-18 16:21             ` bug#36767: [External] : " Drew Adams
2021-06-18 14:12         ` Drew Adams
2021-06-18 19:14       ` Juri Linkov
2021-06-18 19:21         ` Eli Zaretskii
2021-06-19 23:15           ` Juri Linkov
     [not found]       ` <AM9PR09MB49779C8B93EFFB329EB8E5A596A29@AM9PR09MB4977.eurprd09.prod.outlook.com>
     [not found]         ` <83y27nvnb4.fsf@gnu.org>
     [not found]           ` <AM9PR09MB497767EDF180DE0C3EE15F4396A39@AM9PR09MB4977.eurprd09.prod.outlook.com>
     [not found]             ` <83ilyrvgda.fsf@gnu.org>
     [not found]               ` <AM9PR09MB497720FA603D3B7FC4D4739196A39@AM9PR09MB4977.eurprd09.prod.outlook.com>
2021-09-23 20:54                 ` Lars Ingebrigtsen
2021-06-19 11:58     ` Lars Ingebrigtsen
2021-06-19 12:22       ` Eli Zaretskii
2021-06-19 23:15       ` Juri Linkov
     [not found]   ` <AM9PR09MB4977DAFB86D88A4714C1C64196A29@AM9PR09MB4977.eurprd09.prod.outlook.com>
     [not found]     ` <87pmt0qomh.fsf@gnus.org>
     [not found]       ` <AM9PR09MB4977CCFA194C77F1ADF0015C96A29@AM9PR09MB4977.eurprd09.prod.outlook.com>
2021-09-23 20:42         ` Lars Ingebrigtsen
2021-09-23 23:09           ` bug#36767: [External] : " Drew Adams
     [not found]       ` <AM9PR09MB49770845B0C1B7CBB331E68A96A39@AM9PR09MB4977.eurprd09.prod.outlook.com>
2021-09-23 20:52         ` Lars Ingebrigtsen
2021-09-26  9:11           ` martin rudalics
2021-09-26  9:40             ` Lars Ingebrigtsen
2021-09-26  9:55             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eed0nsez.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=36767@debbugs.gnu.org \
    --cc=emacsuser@freemail.hu \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).