]> git.eshelyaron.com Git - emacs.git/commitdiff
Add buttons to definition in help--describe-command
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 1 Nov 2021 14:42:30 +0000 (15:42 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 1 Nov 2021 14:42:30 +0000 (15:42 +0100)
* 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
lisp/help.el

index ebb14cb474e9b57b98a1f524494a74d0e49980e5..792f2e5af33857bcd5a1b7f94b56f2b291fa3aa5 100644 (file)
@@ -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))
index 19cd773f423939d35d7de7b289cf43b2c1906b8e..acd8a123ab558c4d89e9439889eda8245478daed 100644 (file)
@@ -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)