Prevent infloop in Eldoc message truncation algorithm

The truncation algorithm still has a long way to go for very narrow
frame sizes.  It should become a generic mechanism that would allows
one to truncate a string so that fits in N possibly truncated screen
lines of a full-width window.

* lisp/emacs-lisp/eldoc.el (eldoc-handle-docs): Tweak
This commit is contained in:
João Távora 2020-07-09 17:51:38 +01:00
parent 19cf8e5be7
commit ffb99d8490

View file

@ -479,7 +479,7 @@ Honor most of `eldoc-echo-area-use-multiline-p'."
(count-screen-lines (point-min) (point) t (minibuffer-window)))
while (> needed (if truncated (1- available) available))
do (goto-char (line-end-position (if truncated 0 -1)))
(while (bolp) (goto-char (line-end-position 0)))
(while (and (not (bobp)) (bolp)) (goto-char (line-end-position 0)))
finally
(unless (and truncated
eldoc-prefer-doc-buffer