Subject: bug#77169: closed (Re: bug#77169: [PATCH] New Eldoc function `help-at-pt-eldoc-function')

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 29 Mar 2025 10:54:02 +0000

Your bug report

#77169: [PATCH] New Eldoc function `help-at-pt-eldoc-function'

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
77169: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77169
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#77169: [PATCH] New Eldoc function `help-at-pt-eldoc-function'
From: Eli Zaretskii <[email-masked]>
To: Daniel Mendler <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 29 Mar 2025 13:53:36 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: Daniel Mendler <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Wed, 26 Mar 2025 16:19:05 +0100
> 
> Howard Melman <[email-masked]> writes:
> 
> > Daniel Mendler via "Bug reports for GNU Emacs, the Swiss
> > army knife of text editors" <[email-masked]> writes:
> >
> >>>> Okay. I have attached an updated version of the patch to this mail. I
> >>>> have added a customization option (off by default) and a NEWS entry.
> >
> >> +(defcustom eldoc-help-at-pt nil
> >> +  "If non-nil, sow `help-at-pt-kbd-string' at point via Eldoc.
> >
> > s/sow/show/
> 
> Fixed. Updated patch attached to this mail.

Thanks, installed on master, and closing the bug.

Subject: [PATCH] New Eldoc function `help-at-pt-eldoc-function'
From: Daniel Mendler <[email-masked]>
To: [email-masked]
Date: Sat, 22 Mar 2025 10:40:18 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Tags: patch

This patch proposes the addition of a new Eldoc function
`help-at-pt-eldoc-function'.

Show help-at-pt string via Eldoc as an alternative to the
`help-at-pt-display-when-idle' timer.  The help-at-pt timer competes
with Eldoc for the echo area, such that using both does not work well.
The new `help-at-pt-eldoc-function' is meant to be added to
`eldoc-documentation-functions'.

>From d3d2717d98e82ec2ac80054a08d8e7b5d215f0e4 Mon Sep 17 00:00:00 2001
From: Daniel Mendler <[email-masked]>
Date: Sat, 22 Mar 2025 10:29:45 +0100
Subject: [PATCH] New Eldoc function `help-at-pt-eldoc-function'

Show help-at-pt string via Eldoc as an alternative to the
`help-at-pt-display-when-idle' timer.  The help-at-pt timer competes
with Eldoc for the echo area, such that using both does not work well.

The new `help-at-pt-eldoc-function' is meant to be added to
`eldoc-documentation-functions':

(add-to-list 'eldoc-documentation-functions 'help-at-pt-eldoc-function)

* lisp/help-at-pt.el (help-at-pt-eldoc-function): New Eldoc function.

* TODO: Should the new function be added to
`eldoc-documentation-functions' by default, such that tooltip messages
are automatically shown in the echo area when moving point over text
with the `help-echo' property or overlay?
* TODO: Should the `help-at-pt-timer' mechanism be deprecated in favor
of Eldoc?
---
 lisp/help-at-pt.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lisp/help-at-pt.el b/lisp/help-at-pt.el
index 68054016dc5..6a266114610 100644
--- a/lisp/help-at-pt.el
+++ b/lisp/help-at-pt.el
@@ -81,6 +81,13 @@ help-at-pt-kbd-string
 	(echo (help-at-pt-string)))
     (if (and kbd (not (eq kbd t))) kbd echo)))
 
+;;;###autoload
+(defun help-at-pt-eldoc-function (&rest _)
+  "Show help at point via Eldoc.
+Intended for `eldoc-documentation-functions' (which see)."
+  (when-let* ((help (help-at-pt-kbd-string)))
+    (format "Help: %s" (substitute-command-keys help))))
+
 (declare-function widget-describe "wid-edit" (&optional widget-or-pos))
 (declare-function widget-at "wid-edit" (&optional pos))
 
-- 
2.47.2