emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Asynchronous org-agenda-redo


From: Ihor Radchenko
Subject: Asynchronous org-agenda-redo
Date: Thu, 12 Dec 2019 16:18:25 +0800

I am thinking if it is possible to implement org-agenda-redo
asynchronously.

Rebuilding agenda should normally not affect any buffer except agenda
buffer. So, it should be sufficient to block any agenda modifying
commands in the agenda buffer, redo the agenda buffer in separate
thread, and replace the old agenda with the calculated one.
Then, emacs should remain responsive while updating agenda (except for
modifying the agenda buffer).

For example, this naive code kind of works (forgetting that buffer-local
variables will not be passed to the thread):

(define-advice org-agenda-redo (:around (oldfun &optional all) make-async)
  (make-thread oldfun "org-agenda-redo"))

The problem is that emacs does not become responsive...

Another approach would be using async.el package, which allows calling
arbitrary function in subordinate emacs process. Then, the main emacs
instance should not be "frozen" (I use same approach for tangling and it
works fine).  

However, the question is how to pass the .org and agenda buffers to this
subordinate process. Opening the .org files there is not a good option
since it would give too much overhead to this asynchronous agenda.

Any suggestions? Alternative ideas?

Best,
Ihor




reply via email to

[Prev in Thread] Current Thread [Next in Thread]