From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#71117: 30.0.50; output of describe-function Date: Tue, 28 May 2024 15:42:30 -0400 Message-ID: References: <24a8c119-5b86-46f0-bbf0-e9d9d5b77713@easy-emacs.de> <87ikz5g2ou.fsf@gmail.com> <86sey966x1.fsf@gnu.org> <87ikz5v65p.fsf@gmail.com> <86h6ep5cbq.fsf@gnu.org> <86ikyxu7br.fsf@gnu.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="40515"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71117@debbugs.gnu.org, andreas.roehler@easy-emacs.de, kevin.legouguec@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 28 21:43:24 2024 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 1sC2jC-000AEP-PF for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 May 2024 21:43:22 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sC2il-0005hc-Rn; Tue, 28 May 2024 15:42:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sC2ik-0005gz-2g for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 15:42:54 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sC2ij-00059D-QY for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 15:42:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sC2is-0001s0-U9 for bug-gnu-emacs@gnu.org; Tue, 28 May 2024 15:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 May 2024 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71117 X-GNU-PR-Package: emacs Original-Received: via spool by 71117-submit@debbugs.gnu.org id=B71117.17169253707145 (code B ref 71117); Tue, 28 May 2024 19:43:02 +0000 Original-Received: (at 71117) by debbugs.gnu.org; 28 May 2024 19:42:50 +0000 Original-Received: from localhost ([127.0.0.1]:54372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sC2if-0001r9-TQ for submit@debbugs.gnu.org; Tue, 28 May 2024 15:42:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sC2id-0001qr-2W for 71117@debbugs.gnu.org; Tue, 28 May 2024 15:42:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sC2iN-00057w-Jr; Tue, 28 May 2024 15:42:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=fDlkO/YUBKvR9zmzI23l0aMLWqC7ONiU86xf3bWpHD0=; b=fFU18cM3F+7w0DRMBSV7 R36mjHpxVanuiri0qewkFDkVjk69NXzgSHSgOj3JuYRo+LEN95/Ro2DmIi4Vgehdff0MkVRHSrazz j6Els15rrZVRzkvVM7h7H/cW6zlgqiOO9Ai+jDBFoY9xPpv77+N3dgogizwMRRfhlwRcwusKbvBSr u+jPpdjGkoacX+tzaIxULdoaQi8WMr/9Q+Cgtiq7WkduRHRS8PtNGWqBotNCWGw+Znd+PbLJSBnEu NfY/gLvdklPFzc9Oxw5YZZ1xU9yA55qTZGhqFiDBEqBUe49pm2LdXxAhu2SUmLyqiYgA6FgpQlf3h YT/7gG4qMoKFhg==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sC2iN-0003zH-0b; Tue, 28 May 2024 15:42:31 -0400 In-Reply-To: <86ikyxu7br.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 May 2024 21:20:24 +0300") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286120 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: K=C3=A9vin Le Gouguec , >> 71117@debbugs.gnu.org, >> andreas.roehler@easy-emacs.de >> Date: Tue, 28 May 2024 13:44:33 -0400 >>=20 >> >> Were you thinking of a command that specifically targets the symbol f= rom >> >> a displayed *Help* buffer, so the user would do e.g. >> >>=20 >> >> C-h v VAR RET ; shows *Help* for VAR >> >> C-h SOMETHING ; finds source for VAR >> >>=20 >> >> where C-h SOMETHING's implementation would do (a smarter version of) >> >> (with-current-buffer "*Help*" >> >> (help-view-source)) >> >>=20 >> >> ? >> > >> > Yes, exactly. >>=20 >> Something like the attached? >>=20 >> It makes C-h z FUNCTION find the source for FUNCTION. > > I might be mistaken, but I don't think this is what I had in mind. You are not. > My use case is exactly like described above: I type "C-h v" or "C-h > f", which displays the *Help* buffer in the other window. Then I want > to go to the source where the variable or function are defined, but > without the need to switch to the window showing *Help*. The attached is my understanding of what we want (still using C-h z). K=C3=A9vin's mail make me suspect I've been too naive but anyway =F0=9F=98= =85... Thanks Andrea --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-help-find-source-and-bind-it-to-C-h-z.patch >From 569eb50994cd0841dcfbc970d574d945aa43b064 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Tue, 28 May 2024 21:06:21 +0200 Subject: [PATCH] Add 'help-find-source' and bind it to C-h z * lisp/help-fns.el (help-find-source): New function. * lisp/help.el (help-map): Bind 'help-find-source' to C-h z. (help-for-help): Add 'help-find-source'. --- lisp/help-fns.el | 9 +++++++++ lisp/help.el | 2 ++ 2 files changed, 11 insertions(+) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index a202c2d247e..74760197c8b 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -298,6 +298,15 @@ describe-function ;; Return the text we displayed. (buffer-string)))))) +;;;###autoload +(defun help-find-source () + "Switch to a buffer visiting the source of what is being described in *Help*." + (interactive) + (if-let ((help-buffer (get-buffer "*Help*"))) + (with-current-buffer help-buffer + (help-view-source)) + (error "No *Help* buffer found"))) + ;;;###autoload (defun describe-command (command) "Display the full documentation of COMMAND (a symbol). diff --git a/lisp/help.el b/lisp/help.el index 616a45328fd..aa835008358 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -114,6 +114,7 @@ help-map "R" #'info-display-manual "s" #'describe-syntax "t" #'help-with-tutorial + "z" #'help-find-source "v" #'describe-variable "w" #'where-is "x" #'describe-command @@ -418,6 +419,7 @@ 'help "Search documentation of functions, variables, and other items") ("describe-command" "Show help for command") ("describe-function" "Show help for function") + ("help-find-source" "Show the source for what's being described in *Help*") ("describe-variable" "Show help for variable") ("describe-symbol" "Show help for function or variable")) ("Manuals" -- 2.34.1 --=-=-=--