[Top][All Lists]

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

master e62f719 1/2: Minor shortdoc link improvements

From: Lars Ingebrigtsen
Subject: master e62f719 1/2: Minor shortdoc link improvements
Date: Sun, 10 Jan 2021 08:17:04 -0500 (EST)

branch: master
commit e62f71988f8e75de676ea5e0775c97eab1d8793a
Author: Daniel Martín <mardani29@yahoo.es>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Minor shortdoc link improvements
    * lisp/emacs-lisp/shortdoc.el (shortdoc--display-function): Use
    describe-function as a fallback link when a function is not documented
    in any Info manual.  Also make the link respond to mouse-1, like the
    rest of *Help* links, and add a proper help-echo property.
    * lisp/help-fns.el (help-fns--mention-shortdoc-groups): Same link
    improvement as described before, this time for the shortdoc groups
 lisp/emacs-lisp/shortdoc.el | 13 +++++++++++--
 lisp/help-fns.el            |  4 +++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/shortdoc.el b/lisp/emacs-lisp/shortdoc.el
index 698467e..39e69f5 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -1126,12 +1126,21 @@ There can be any number of :example/:result elements."
     (insert (propertize "("
                         'shortdoc-function t))
     (if (plist-get data :no-manual)
-        (insert (symbol-name function))
+        (insert-text-button
+         (symbol-name function)
+         'face 'button
+         'action (lambda (_)
+                   (describe-function function))
+         'follow-link t
+         'help-echo (purecopy "mouse-1, RET: describe function"))
        (symbol-name function)
        'face 'button
        'action (lambda (_)
-                 (info-lookup-symbol function 'emacs-lisp-mode))))
+                 (info-lookup-symbol function 'emacs-lisp-mode))
+       'follow-link t
+       'help-echo (purecopy "mouse-1, RET: show \
+function's documentation in the Info manual")))
     (setq arglist-start (point))
     (insert ")\n")
     ;; Doc string.
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index afbb5e3..d559221 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -713,7 +713,9 @@ FILE is the file where FUNCTION was probably defined."
             (symbol-name group)
             'action (lambda (_)
-                      (shortdoc-display-group group))))
+                      (shortdoc-display-group group))
+            'follow-link t
+            'help-echo (purecopy "mouse-1, RET: show documentation group")))
         (insert (if (= (length groups) 1)
                     " group.\n"

reply via email to

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