emacs-diffs
[Top][All Lists]
Advanced

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

scratch/eldoc-async b235e37: Adjust describe-char-eldoc to new eldoc-doc


From: Joo Tvora
Subject: scratch/eldoc-async b235e37: Adjust describe-char-eldoc to new eldoc-documentation-functions protocol
Date: Tue, 7 Jul 2020 08:35:21 -0400 (EDT)

branch: scratch/eldoc-async
commit b235e378d7192bb3dd4bf84cc52d68089befd93b
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Adjust describe-char-eldoc to new eldoc-documentation-functions protocol
    
    * lisp/descr-text.el (describe-char-eldoc): Adjust to new
    eldoc-documentation-functions protocol.
---
 lisp/descr-text.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 22cfccb..776ce76 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -919,7 +919,7 @@ condition, the function may return string longer than 
WIDTH, see
            (t name)))))))
 
 ;;;###autoload
-(defun describe-char-eldoc ()
+(defun describe-char-eldoc (_callback &rest _)
   "Return a description of character at point for use by ElDoc mode.
 
 Return nil if character at point is a printable ASCII
@@ -934,7 +934,12 @@ This function can be used as a value of
   (let ((ch (following-char)))
     (when (and (not (zerop ch)) (or (< ch 32) (> ch 127)))
       ;; TODO: investigate if the new `eldoc-documentation-functions'
-      ;; API could significantly improve this.
+      ;; API could significantly improve this.  JT@2020-07-07: Indeed,
+      ;; instead of returning a string tailored here for the echo area
+      ;; exclusively, we could call the (now unused) argument
+      ;; _CALLBACK with hints on how to shorten the string if needed,
+      ;; or with multiple usable strings which Eldoc picks according
+      ;; to its space contraints.
       (describe-char-eldoc--format
        ch
        (unless (eq eldoc-echo-area-use-multiline-p t)



reply via email to

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