unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Unknown <unknown@unknown.invalid>
To: 45750@debbugs.gnu.org
Subject: bug#45750: 28.0.50; [PATCH] Minor shortdoc link improvements
Date: Sun, 10 Jan 2021 00:27:35 +0100	[thread overview]
Message-ID: <m1r1mtg07s.fsf@yahoo.es> (raw)
In-Reply-To: m1r1mtg07s.fsf.ref@yahoo.es

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]


Tags: patch


Attached is a patch with a couple of minor improvements for the shortdoc
feature:

- Links now show help-echo and are activated with the mouse in a similar
  way to the rest of the *Help* buttons.

- When a function is marked as :no-manual, instead of showing no link,
  we now show a link to open the function's description.  That still
  provides a bit more information than the shortdoc and may be a better
  fallback than showing no link.

Thanks.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Minor-improvements-for-the-shortdoc-feature.patch --]
[-- Type: text/x-patch, Size: 2442 bytes --]

From 1860b01b0ca10a67f56a109aa0087ec39be8df34 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= <mardani29@yahoo.es>
Date: Sat, 9 Jan 2021 23:51:01 +0100
Subject: [PATCH] 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 698467e939..39e69f5aab 100644
--- a/lisp/emacs-lisp/shortdoc.el
+++ b/lisp/emacs-lisp/shortdoc.el
@@ -1126,12 +1126,21 @@ shortdoc--display-function
     (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"))
       (insert-text-button
        (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 afbb5e3649..d559221a82 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -713,7 +713,9 @@ help-fns--mention-shortdoc-groups
            (insert-text-button
             (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")))
          groups)
         (insert (if (= (length groups) 1)
                     " group.\n"
--
2.28.0

       reply	other threads:[~2021-01-09 23:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m1r1mtg07s.fsf.ref@yahoo.es>
2021-01-09 23:27 ` Unknown [this message]
2021-01-10 12:45   ` bug#45750: 28.0.50; [PATCH] Minor shortdoc link improvements Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1r1mtg07s.fsf@yahoo.es \
    --to=unknown@unknown.invalid \
    --cc=45750@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).