Function: describe-char-eldoc
describe-char-eldoc is an autoloaded and byte-compiled function
defined in descr-text.el.gz.
Signature
(describe-char-eldoc CALLBACK &rest _)
Documentation
Return a description of character at point for use by ElDoc mode.
Return nil if character at point is a printable ASCII
character (i.e. codepoint between 32 and 127 inclusively).
Otherwise return a description formatted by
describe-char-eldoc--format function taking into account value
of eldoc-echo-area-use-multiline-p variable and width of
minibuffer window for width limit.
This function can be used as a value of
eldoc-documentation-functions variable.
Probably introduced at or before Emacs version 25.1.
Source Code
;; Defined in /usr/src/emacs/lisp/descr-text.el.gz
;;;###autoload
(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
character (i.e. codepoint between 32 and 127 inclusively).
Otherwise return a description formatted by
`describe-char-eldoc--format' function taking into account value
of `eldoc-echo-area-use-multiline-p' variable and width of
minibuffer window for width limit.
This function can be used as a value of
`eldoc-documentation-functions' variable."
(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. 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 constraints.
(describe-char-eldoc--format
ch
(unless (eq eldoc-echo-area-use-multiline-p t)
(1- (window-width (minibuffer-window))))))))