From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#36767: 26.1; request: add more quick keys to the *Help* buffer Date: Thu, 17 Jun 2021 23:34:36 +0300 Organization: LINKOV.NET Message-ID: <87eed0nsez.fsf@mail.linkov.net> References: <87mtrrq7t7.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30445"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 36767@debbugs.gnu.org, ndame To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 17 22:36:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ltykF-0007oa-Uu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 22:36:11 +0200 Original-Received: from localhost ([::1]:55378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltykE-00082h-Su for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 16:36:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltyk6-0007vg-8Y for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 16:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltyk5-0006QV-UT for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 16:36:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ltyk5-0007tt-MB for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 16:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jun 2021 20:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36767 X-GNU-PR-Package: emacs Original-Received: via spool by 36767-submit@debbugs.gnu.org id=B36767.162396212030320 (code B ref 36767); Thu, 17 Jun 2021 20:36:01 +0000 Original-Received: (at 36767) by debbugs.gnu.org; 17 Jun 2021 20:35:20 +0000 Original-Received: from localhost ([127.0.0.1]:55216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltyjP-0007sy-QC for submit@debbugs.gnu.org; Thu, 17 Jun 2021 16:35:20 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:54589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltyjM-0007sd-A2 for 36767@debbugs.gnu.org; Thu, 17 Jun 2021 16:35:18 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 264F1FF805; Thu, 17 Jun 2021 20:35:07 +0000 (UTC) In-Reply-To: <87mtrrq7t7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 15 Jun 2021 20:52:36 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208678 Archived-At: --=-=-= Content-Type: text/plain >> 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=help-customize.patch 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 --=-=-=--