From: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Calling eldoc-message directly
Date: Tue, 8 May 2018 20:57:49 -0400 [thread overview]
Message-ID: <2aba18fe-4424-6b08-b5e0-e590c039a4de@gmail.com> (raw)
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.
next reply other threads:[~2018-05-09 0:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-09 0:57 Clément Pit-Claudel [this message]
2018-05-09 17:26 ` Calling eldoc-message directly João Távora
2018-05-10 2:01 ` Stefan Monnier
2018-05-10 2:43 ` Clément Pit-Claudel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2aba18fe-4424-6b08-b5e0-e590c039a4de@gmail.com \
--to=cpitclaudel@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.