emacs-orgmode
[Top][All Lists]
Advanced

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

Re: Asynchronous org-agenda-redo


From: Adam Porter
Subject: Re: Asynchronous org-agenda-redo
Date: Thu, 12 Dec 2019 06:17:18 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Be sure to read the Emacs Lisp manual regarding threads.  They are
cooperative, so functions called as threads must yield back to the main
thread for Emacs to do anything else before the function returns.

If you're feeling adventurous, you could experiment with adding yields
in relevant agenda functions.  But that wouldn't be suitable for merging
into Org, because that yielding also decreases performance generally.

As long as Elisp threads are cooperative, they are of very limited use.

Generating agendas with async.el in a separate Emacs process is an
interesting idea, but probably generally impractical for a few reasons:

1.  The process would have to load the same Org buffers, which takes
    time, especially in large buffers.  Depending on configuration, it
    can take some time, indeed.
2.  The process would also have to load the same packages (or, at least,
    all the necessary ones, which depends on configuration), which takes
    time.
3.  Ensuring that configuration and state between the main Emacs process
    and the separate, agenda-generating process is not necessarily
    simple.  Consider as well that if a buffer had unsaved changes,
    those would not be readable by the other process, which would lead
    to invalid results.  One could force the buffers to be saved first,
    but that may not always be desirable, as saving buffers can have
    side effects.

If your agenda buffers are taking too long to refresh, you might
consider org-ql's views/saved-searches as an alternative.  The built-in
caching in org-ql significantly improves performance, especially when
refreshing views.




reply via email to

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