emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c04eccd667f 1/2: Add 'help-find-source' and bind it to C-h 4 s


From: Andrea Corallo
Subject: master c04eccd667f 1/2: Add 'help-find-source' and bind it to C-h 4 s
Date: Wed, 29 May 2024 10:40:06 -0400 (EDT)

branch: master
commit c04eccd667f425e9b253e8178130c7e00c659df9
Author: Andrea Corallo <acorallo@gnu.org>
Commit: Andrea Corallo <acorallo@gnu.org>

    Add 'help-find-source' and bind it to C-h 4 s
    
    * 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 f2257cb9398..1ffe1b16588 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -298,6 +298,15 @@ handling of autoloaded functions."
           ;; 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..2feb178ff6c 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -114,6 +114,7 @@ buffer.")
   "R"    #'info-display-manual
   "s"    #'describe-syntax
   "t"    #'help-with-tutorial
+  "4 s"  #'help-find-source
   "v"    #'describe-variable
   "w"    #'where-is
   "x"    #'describe-command
@@ -418,6 +419,7 @@ Do not call this in the scope of `with-help-window'."
         "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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]