>> Do you mean something like this?
>>
>> (while (re-search-forward org-link-any-re end t)
>>   ;; Make overlay ov here
>>   ;; Find path, link and preview-func here
>>
>>   (push (list ov preview-func path link) previews-remaining))
>>
>> (dolist (preview-data-chunk (seq-partition previews-remaining 6))
>>   (run-with-idle-timer
>> ...
>> Where the chunk size (6) and the idle time (0.10 seconds) will be
>> customizable.
>
> Yes.

Okay.  There's one more issue to resolve.  An asynchronous preview will
return t but no preview is placed yet.  If the preview then fails when
the callback runs, we will have an overlay without a preview that hasn't
been cleaned up.  How do you suggest handling this case?

The only thing I can think of is that the async preview-func should call
org-link-preview-clear on the failed preview by itself, and we should
include this expectation in the org-link-parameters documentation.

Karthik

Reply via email to