Re: [QUESTION] Re: [PATCH] make org-attach-url download function as an option

2020-07-16 Thread Ihor Radchenko
> Indeed, as long as org-attach introduced new async actions. Those hooks will > have problem if they requires files is downloading finished. Also > `make-thread' > does not have process sentinel. That's also an problem. > > Does anyone have better idea? You can wrap the call to org-attach-url-fu

Re: [QUESTION] Re: [PATCH] make org-attach-url download function as an option

2020-07-16 Thread stardiviner
Ihor Radchenko writes: > I do not know an answer to your question, but would like to point out > that make-thread will return immidietealy and all the following code > will run before the download finishes: > > (run-hook-with-args 'org-attach-after-change-hook attach-dir) > (org-attach-tag) > (

Re: [QUESTION] Re: [PATCH] make org-attach-url download function as an option

2020-07-15 Thread Ihor Radchenko
I do not know an answer to your question, but would like to point out that make-thread will return immidietealy and all the following code will run before the download finishes: (run-hook-with-args 'org-attach-after-change-hook attach-dir) (org-attach-tag) (cond ((eq org-attach-store-link-p 'attac

[QUESTION] Re: [PATCH] make org-attach-url download function as an option

2020-07-15 Thread stardiviner
I got solution for async org-attach-url now. Use `make-thread` for async downloading is simple. Here is the code prototype, but it has a problem, seems `apply` part code does not really downloading file. I don't know why. Does anybody knows the reason? #+begin_src diff modified lisp/org-attac