emacs-diffs
[Top][All Lists]
Advanced

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

master 031c2e4679 1/2: Add a *Help* command that'll take you to the lisp


From: Lars Ingebrigtsen
Subject: master 031c2e4679 1/2: Add a *Help* command that'll take you to the lispref manual
Date: Mon, 24 Jan 2022 07:02:15 -0500 (EST)

branch: master
commit 031c2e46791925d70018945c9cb2c7c7f2c35efe
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add a *Help* command that'll take you to the lispref manual
    
    * doc/emacs/help.texi (Help Mode): Document it.
    * lisp/help-mode.el (help-mode-map): Add an `I' keystroke.
    (help-goto-lispref-info): New command.
    
    * lisp/info-look.el (:mode): Add an entry for the lispref manual.
---
 doc/emacs/help.texi | 3 +++
 lisp/help-mode.el   | 9 +++++++++
 lisp/info-look.el   | 7 +++++++
 3 files changed, 19 insertions(+)

diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 5a458209d2..1f743ccd88 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -478,6 +478,9 @@ View the source of the current help topic (if any)
 (@code{help-view-source}).
 @item i
 Look up the current topic in the manual(s) (@code{help-goto-info}).
+@item I
+Look up the current topic in the Emacs Lisp manual
+(@code{help-goto-lispref-info}).
 @item c
 Customize the variable or the face (@code{help-customize}).
 @end table
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index 894b2a50aa..5fb5dcfb19 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -45,6 +45,7 @@
     (define-key map [XF86Forward] 'help-go-forward)
     (define-key map "\C-c\C-c" 'help-follow-symbol)
     (define-key map "s" 'help-view-source)
+    (define-key map "I" 'help-goto-lispref-info)
     (define-key map "i" 'help-goto-info)
     (define-key map "c" 'help-customize)
     map)
@@ -819,6 +820,14 @@ The help buffers are divided into \"pages\" by the ^L 
character."
   (info-lookup-symbol (plist-get help-mode--current-data :symbol)
                       'emacs-lisp-mode))
 
+(defun help-goto-lispref-info ()
+  "View the Emacs Lisp manual *info* node of the current help item."
+  (interactive nil help-mode)
+  (unless help-mode--current-data
+    (error "No symbol to look up in the current buffer"))
+  (info-lookup-symbol (plist-get help-mode--current-data :symbol)
+                      'emacs-lisp-only))
+
 (defun help-customize ()
   "Customize variable or face whose doc string is shown in the current buffer."
   (interactive nil help-mode)
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 64f16df4dc..42e758360e 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -1010,6 +1010,13 @@ Return nil if there is nothing appropriate in the buffer 
near point."
              ("(cl)Function Index"    nil "^ -+ .*: " "\\( \\|$\\)")
              ("(cl)Variable Index"    nil "^ -+ .*: " "\\( \\|$\\)")))
 
+(info-lookup-maybe-add-help
+ :mode 'emacs-lisp-only
+ :regexp "[^][()`'‘’,\" \t\n]+"
+ :doc-spec '(("(elisp)Index"          nil "^ -+ .*: " "\\( \\|$\\)")
+             ("(cl)Function Index"    nil "^ -+ .*: " "\\( \\|$\\)")
+             ("(cl)Variable Index"    nil "^ -+ .*: " "\\( \\|$\\)")))
+
 (mapc
  (lambda (elem)
    (let* ((prefix (car elem)))



reply via email to

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