[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Calling eldoc-message directly
From: |
Clément Pit-Claudel |
Subject: |
Calling eldoc-message directly |
Date: |
Tue, 8 May 2018 20:57:49 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
Hi emacs-devel,
The changelog for Emacs 27.1 says "For ElDoc support, you should set
'eldoc-documentation-function' instead of calling 'eldoc-message' directly".
At least one of my packages calls eldoc-message directly, and I'm not sure how
to get rid of it.
In that package, I use a server process to get information about the current
buffer. I can use it to asynchronously retrieve documentation about
identifiers, among other things. This pattern seems pretty common (I think
that's how tide, elpy, cider, and multiple other modes work).
I currently have an eldoc-documentation-function that sends an asynchronous
query, waits for a few milliseconds in the hope to get a quick answer, and
otherwise registers a callback that calls eldoc-message directly. That
callback checks that the buffer hasn't been modified and that the point hasn't
moved, and if so calls eldoc-message.
Can someone recommend a proper implementation, not based on eldoc-message? (I
have vague recollections of a related thread on emacs-devel, but I can't seem
to find it)
Thanks,
Clément.
- Calling eldoc-message directly,
Clément Pit-Claudel <=