From: Andrea Corallo Date: Tue, 28 May 2024 19:06:21 +0000 (+0200) Subject: Add 'help-find-source' and bind it to C-h 4 s X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~1314 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c04eccd667f425e9b253e8178130c7e00c659df9;p=emacs.git 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'. --- 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"