emacs-diffs
[Top][All Lists]
Advanced

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

master 8c215fd: Add buttons to definition in help--describe-command


From: Lars Ingebrigtsen
Subject: master 8c215fd: Add buttons to definition in help--describe-command
Date: Mon, 1 Nov 2021 10:42:40 -0400 (EDT)

branch: master
commit 8c215fd4c9142ae28a2adf7d810d7da25b0cc3c1
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Add buttons to definition in help--describe-command
    
    * lisp/help-mode.el (help-make-xrefs): Don't add buttons to
    keymaps, because they're pre-buttonized.
    * lisp/help.el (help--describe-command): Make buttons out of the
    definitions.
---
 lisp/help-mode.el | 23 +----------------------
 lisp/help.el      |  5 ++++-
 2 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index ebb14cb..792f2e5 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -644,28 +644,7 @@ that."
                           "\\<M-x\\s-+\\(\\sw\\(\\sw\\|\\s_\\)*\\sw\\)" nil t)
                     (let ((sym (intern-soft (match-string 1))))
                       (if (fboundp sym)
-                          (help-xref-button 1 'help-function sym)))))
-                ;; Look for commands in whole keymap substitutions:
-                (save-excursion
-                  ;; Make sure to find the first keymap.
-                  (goto-char (point-min))
-                  ;; Find a header and the column at which the command
-                  ;; name will be found.
-                  (while (re-search-forward "^Key +Binding\n.*\n"
-                                            nil t)
-                    (while (looking-at 
"\\([^\t\n]+\\)\\(\t+\\|\n\t+\\)\\([^\n\t ]+\\)")
-                      (let ((key (match-string 1))
-                            (symbol (intern-soft (match-string 3))))
-                        (when (and (fboundp symbol)
-                                   (kbd-valid-p key))
-                          (help-xref-button 3 'help-function symbol))
-                        (goto-char (match-end 0))
-                        (forward-line)
-                        ;; Skip empty line.
-                        (while (and (not (eobp))
-                                    (or (eolp)
-                                        (looking-at-p " *(this binding")))
-                          (forward-line)))))))
+                          (help-xref-button 1 'help-function sym))))))
             (set-syntax-table stab))
           ;; Delete extraneous newlines at the end of the docstring
           (goto-char (point-max))
diff --git a/lisp/help.el b/lisp/help.el
index 19cd773..acd8a12 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1349,7 +1349,10 @@ Return nil if the key sequence is too long."
                                          font-lock-face nil)))
     (setq help--previous-description-column description-column)
     (cond ((symbolp definition)
-           (insert (symbol-name definition) "\n"))
+           (insert-text-button (symbol-name definition)
+                               'type 'help-function
+                               'help-args (list definition))
+           (insert "\n"))
           ((or (stringp definition) (vectorp definition))
            (insert "Keyboard Macro\n"))
           ((keymapp definition)



reply via email to

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