In <mailman.1698.1181180879.32220.help-gnu-emacs@gnu.org>
Juraj Kubelka wrote:
Is it possible to call lisp function asynchronous?
It is possible but rather difficult to do it in earnest. Good
examples are in emacs-w3m (http://emacs-w3m.namazu.org/).
I would like to use it with this intention: I have defined overlay on
a region. And after few seconds I would like to delete this overlay.
#'(lambda (overlay)
(sleep-for 2)
(delete-overlay overlay))
But I do not know how to call it without waiting for response
(funcall
delete-overlay overlay).
Can you help me? Or is there better solution for it?
A timer seems to answer such a purpose. For example:
#'(lambda (overlay)
(run-at-time 2 nil #'delete-overlay overlay))