- Add eldoc-box--last-point
- eldoc-box--display sets eldoc-box-hover-mode to t in doc buffer
- eldoc-box--maybe-cleanup checks more things to decide whether to
clear frame
- eldoc-box--eldoc-message-function sets eldoc-box--last-point to
(point)
* eldoc-box.el (eldoc-box--maybe-cleanup): Set timer var to nil
unconditionally.
(eldoc-box--eldoc-message-function): Rescheduler timer here.
(eldoc-box-hover-mode): Simplify.
(eldoc-box--maybe-cancel-timer, eldoc-box--enabled-buffer-list):
Not needed.
Uses a :before-until advice on the local value of
eldoc-message-function instead of setting it directly. Thus, when we
give up because of eldoc-box-only-multi-line (or some other future
criteria), other :before-until handlers can kick in.
* eldoc-box.el (eldoc-box--eldoc-message-function): Control return of
t or nil.
(eldoc-box-hover-mode): Use add-function and
remove-function.
Don't cancel and create new timers naively.
Only cancel timer (and set to nil) when there is no live buffer
with eldoc-box-hover-mode enabled;
and only create new timer when none exists.
Add cleanup function and a idle timer
Why a timer? ElDoc is mainly use in minibuffer,
where the text is constantly being flushed by other commands
so ElDoc doesn't try very hard to cleanup
Originally I have (when str (display)), but that leaves childdrame
unchanged.
To work around that I added (eldoc-box-quit-frame).
Now childframes are cleared up nicely but it lagging.
(when (stringp str) (display)) works. (although I don't know why (when
str) doesn't, even though eldoc-messaeg passes nil to message function)