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

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

2020-05-24 Thread stardiviner
Bastien writes: > Hi, > > stardiviner writes: > >> I found when network is bad and slow, or the download file is big, the >> org-attach-url will suspend Emacs for a long time. User might have to cancel >> downloading, and start again later. > > Indeed, this might be annoying. At the same time,

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

2020-05-24 Thread Bastien
Hi, stardiviner writes: > I found when network is bad and slow, or the download file is big, the > org-attach-url will suspend Emacs for a long time. User might have to cancel > downloading, and start again later. Indeed, this might be annoying. At the same time, it is not unreasonable to expe

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

2020-04-29 Thread stardiviner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 I found when network is bad and slow, or the download file is big, the org-attach-url will suspend Emacs for a long time. User might have to cancel downloading, and start again later. I hope to make "org-attach-url" download file asynchronously. Bu