summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2020-07-07 13:35:07 +0100
committerJoão Távora <joaotavora@gmail.com>2020-07-08 11:25:33 +0100
commitb3efd5c22886743da3ea4b3abea6ca880db3d594 (patch)
tree5795b8ac4d6aba0a4ddfed7c5af07d008e52c0fe /lisp
parentbba3bea247675df234353f0c2cd8af7da23bc6b8 (diff)
downloademacs-b3efd5c22886743da3ea4b3abea6ca880db3d594.tar.gz
Adjust describe-char-eldoc to new eldoc-documentation-functions protocol
* lisp/descr-text.el (describe-char-eldoc): Adjust to new eldoc-documentation-functions protocol.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/descr-text.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 22cfccb1fb2..776ce7618d5 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)