Re: [PATCH] 3 improvements to ob-screen

2020-07-15 Thread Ken Mankoff


On 2020-07-15 at 20:12 -07, Kyle Meyer  wrote...
> Well, applied, but not pushed yet. In the second patch, the session
> name is no longer passed to string-match; it was in the original patch
> at . I'll fix it up
> locally before pushing.

Argh - I apologize for introducing that bug. Thank you for catching it and 
accepting the patches. I'll look at the tweaks you made to the commit messages 
to learn what is preferred for my next contribution.

  -k.



Re: [PATCH] Make org-eldoc work with Emacs 28

2020-07-15 Thread Kyle Meyer
Basil L. Contovounesios writes:

> "James N. V. Cash"  writes:
>
>> This patch makes it continue to work by setting the new variable
>> eldoc-documentation-strategy, which puts eldoc in
>> "backwards-compatability" mode.
>
> How involved would it be to make org-eldoc work in
> non-"backwards-compatibility" mode?

I think we can do that, while still supporting Org's minimum Emacs
version, by following python.el.  Here's what it does:

  (with-no-warnings
;; supress warnings about eldoc-documentation-function being obsolete
(if (null eldoc-documentation-function)
;; Emacs<25
(set (make-local-variable 'eldoc-documentation-function)
 #'python-eldoc-function)
  (if (boundp 'eldoc-documentation-functions)
  (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil 
t)
(add-function :before-until (local 'eldoc-documentation-function)
  #'python-eldoc-function

And then...

>> -  (if (boundp 'eldoc-documentation-functions)
>> -  (add-hook 'eldoc-documentation-functions
>> -#'org-eldoc-documentation-function nil t)
>> -(setq-local eldoc-documentation-function
>> -#'org-eldoc-documentation-function)))
>> +  (cond
>> +   ((boundp 'eldoc-documentation-strategy)
>> +(setq-local eldoc-documentation-strategy
>> +#'org-eldoc-documentation-function))
>> +   ((boundp 'eldoc-documentation-functions)
>> +(add-hook 'eldoc-documentation-functions
>> +  #'org-eldoc-documentation-function nil t))
>
> Both eldoc-documentation-strategy and eldoc-documentation-functions are
> new in Emacs 28, so if one is defined, then so is the other.
>
> More importantly, functions added to eldoc-documentation-functions must
> take at least one argument, so org-eldoc-documentation-function is not a
> suitable function in its current state.

... org-eldoc-documentation-function's signature could be changed to
(&rest _ignored), like python-eldoc-function's.



Re: [PATCH] 3 improvements to ob-screen

2020-07-15 Thread Kyle Meyer
Kyle Meyer writes:

> Ken Mankoff writes:
>
>> On 2020-07-14 at 20:08 -07, Kyle Meyer  wrote...
>>> Could you add a changelog entry to the body of this commit message and
>>> the others?
>>
>> I made the changes you requested. Updated patches attached.
>
> Thank you.  Applied, with a few minor tweaks to the commit messages and
> deleting trailing white space in the NEWS entry of patch 2.

Well, applied, but not pushed yet.  In the second patch, the session
name is no longer passed to string-match; it was in the original patch
at .  I'll fix it up
locally before pushing.



Re: [PATCH] 3 improvements to ob-screen

2020-07-15 Thread Kyle Meyer
Ken Mankoff writes:

> On 2020-07-14 at 20:08 -07, Kyle Meyer  wrote...
>> Could you add a changelog entry to the body of this commit message and
>> the others?
>
> I made the changes you requested. Updated patches attached.

Thank you.  Applied, with a few minor tweaks to the commit messages and
deleting trailing white space in the NEWS entry of patch 2.



Re: [PATCH] Make org-eldoc work with Emacs 28

2020-07-15 Thread Basil L. Contovounesios
"James N. V. Cash"  writes:

> This patch makes it continue to work by setting the new variable
> eldoc-documentation-strategy, which puts eldoc in
> "backwards-compatability" mode.

How involved would it be to make org-eldoc work in
non-"backwards-compatibility" mode?

> From 5c04048c0d1ed3f80c7dd3e6477e12fc8e760675 Mon Sep 17 00:00:00 2001
> From: "James N. V. Cash" 
> Date: Fri, 10 Jul 2020 11:56:23 -0400
> Subject: [PATCH] Make org-eldoc work with Emacs 28's new eldoc API
>
> Still using backward-compatability to use the old style of
> function. The new way is to make the documentation function take a
> callback, but this approach means the fewest changes.
> ---
>  contrib/lisp/org-eldoc.el | 14 +-
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
> index 72b10a1fb..060674b24 100644
> --- a/contrib/lisp/org-eldoc.el
> +++ b/contrib/lisp/org-eldoc.el
> @@ -161,11 +161,15 @@
>  (defun org-eldoc-load ()
>"Set up org-eldoc documentation function."
>(interactive)
> -  (if (boundp 'eldoc-documentation-functions)
> -  (add-hook 'eldoc-documentation-functions
> - #'org-eldoc-documentation-function nil t)
> -(setq-local eldoc-documentation-function
> - #'org-eldoc-documentation-function)))
> +  (cond
> +   ((boundp 'eldoc-documentation-strategy)
> +(setq-local eldoc-documentation-strategy
> + #'org-eldoc-documentation-function))
> +   ((boundp 'eldoc-documentation-functions)
> +(add-hook 'eldoc-documentation-functions
> +   #'org-eldoc-documentation-function nil t))

Both eldoc-documentation-strategy and eldoc-documentation-functions are
new in Emacs 28, so if one is defined, then so is the other.

More importantly, functions added to eldoc-documentation-functions must
take at least one argument, so org-eldoc-documentation-function is not a
suitable function in its current state.

> +   (t (setq-local eldoc-documentation-function
> +   #'org-eldoc-documentation-function

Thanks,

-- 
Basil



Re: heads up: org-eldoc (contrib) may not work with recent Emacs (28.0.x)

2020-07-15 Thread Basil L. Contovounesios
Eric S Fraga  writes:

> I am not entirely sure but I believe that recent changes in Emacs's
> eldoc.el make org-eldoc (found in the contrib directory for org) no
> longer work.  At first glance, an argument is now required for
> org-eldoc-documentation-function but this only postpones the error...

Thanks, a patch for this is being discussed in the following thread:
https://lists.gnu.org/archive/html/emacs-orgmode/2020-07/msg00157.html

-- 
Basil



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 'attached)...

At least the hooks and org-attach-tag would expect that the file is
attached already.

Best,
Ihor

stardiviner  writes:

> 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-attach.el
> @@ -110,6 +110,12 @@ (defcustom org-attach-method 'cp
> (const :tag "Hard Link" ln)
> (const :tag "Symbol Link" lns)))
>  
> +(defcustom org-attach-url-function 'url-copy-file
> +  "The download file function to use in org-attach-url."
> +  :type '(choice (const 'url-copy-file))
> +  :safe #'functionp
> +  :group 'org-attach)
> +
>  (defcustom org-attach-expert nil
>"Non-nil means do not show the splash buffer with the attach dispatcher."
>:group 'org-attach
> @@ -503,7 +509,12 @@ (defun org-attach-attach (file &optional visit-dir 
> method)
> ((eq method 'cp) (copy-file file attach-file))
> ((eq method 'ln) (add-name-to-file file attach-file))
> ((eq method 'lns) (make-symbolic-link file attach-file))
> -   ((eq method 'url) (url-copy-file file attach-file)))
> +   ((eq method 'url) (make-thread
> +   (lambda ()
> + ;; (url-copy-file file attach-file)
> + ;; FIXME This seems does not really download file. 
> Don't know why.
> + (apply org-attach-url-function '(file attach-file)))
> +   "org-attach-url downloading")))
>(run-hook-with-args 'org-attach-after-change-hook attach-dir)
>(org-attach-tag)
>(cond ((eq org-attach-store-link-p 'attached)
> #+end_src
>
> 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, it is not
>> unreasonable to expect the user to know what size is the contents he
>> is willing to attach to an Org node.
>>
>>> I hope to make "org-attach-url" download file asynchronously. But function
>>> org-attach-attach hardcoded this function for 'url method. Here is a patch 
>>> to
>>> make it into an option.
>>
>> (FWIW, I could not find the patch.)
>>
>> I think you are on the right track when trying to enhance the 'url
>> package.  Maybe url-copy-file should be asynchronous and url could
>> provide url-copy-file-synchronously (to mimic the url-retrieve and
>> url-retrieve-synchronously pair)?
>>
>> Until Emacs has a function to copy a URL's contents asynchronously,
>> I'd rather not add this functionality in Org.
>
>
> -- 
> [ stardiviner ]
>I try to make every word tell the meaning that I want to express.
>
>Blog: https://stardiviner.github.io/
>IRC(freenode): stardiviner, Matrix: stardiviner
>GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
>

-- 
Ihor Radchenko,
PhD,
Center for Advancing Materials Performance from the Nanoscale (CAMP-nano)
State Key Laboratory for Mechanical Behavior of Materials, Xi'an Jiaotong 
University, Xi'an, China
Email: yanta...@gmail.com, ihor_radche...@alumni.sutd.edu.sg



Re: Superscript and non-blank character

2020-07-15 Thread Bo Grimes
Ian is a "steely-eyed rocket man"!  I thanked him off-list in order not 
to clutter it up, which led to several more exchanges. I wanted to add 
my final reply to him to the list in case others find it helpful in the 
future.


Begin quote:

I couldn't get it to work, but...it may have been that instead of 
closing the file I was testing on I was rather doing M-x eval-buffer.  
It kept giving me errors about entities or something.


However, after reading your links on local variables and more digging 
around on forums I decided to try footers before trying it in init.el.  
Thus, I arrived at:


> # Local Variables:
> # mode: org
> # org-match-substring-regexp: 
"\\(\\)\\([_^]\\)\\(\\(?:{\\([^{}]*?\\|\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?\\|\\(?:[^{}]*?{\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?}\\)+[^{}]*?\\)}\\)\\|\\(?:(\\([^()]*?\\|\\(?:[^()]*?([^()]*?)\\)+[^()]*?\\|\\(?:[^()]*?(\\(?:[^()]*?([^()]*?)\\)+[^()]*?)\\)+[^()]*?\\))\\)\\|\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)"

> # org-pretty-entities: t
> # End

This also did not work when I evaluated the buffer.  After carefully 
rereading your last reply and noticing "The test is to save it with an 
.org extension and open it. When you try to open it, emacs should ask 
you if you want to load 'values that may not be safe'" I deduced I 
should close the file and re-open it (duh!).


This time I got the prompt you mentioned, and after accepting the risk, 
Viola! Rather than attempt it the original way, I think I will keep it 
as a footer where it is less distracting to me.



On 7/14/20 7:51 AM, ian martins wrote:

Bo, you can try this. I don't know what else it will break, so I did it as
a file local. alternatively you could set `org-match-substring-regexp' in
your init.

---
;;; -*- org-match-substring-regexp:
"\\(\\)\\([_^]\\)\\(\\(?:{\\([^{}]*?\\|\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?\\|\\(?:[^{}]*?{\\(?:[^{}]*?{[^{}]*?}\\)+[^{}]*?}\\)+[^{}]*?\\)}\\)\\|\\(?:(\\([^()]*?\\|\\(?:[^()]*?([^()]*?)\\)+[^()]*?\\|\\(?:[^()]*?(\\(?:[^()]*?([^()]*?)\\)+[^()]*?)\\)+[^()]*?\\))\\)\\|\\(?:\\*\\|[+-]?[[:alnum:].,\\]*[[:alnum:]]\\)\\)";
org-pretty-entities: t; -*-

here are some verses where there's a space after the verse number:

^1 In the beginning God created the heavens and the earth. ^2 Now the earth
was formless and empty, darkness was over the surface of the deep, and the
Spirit of God was hovering over the waters.

if you don't want the space after the verse number, you can use curlys:

^{3}And God said, “Let there be light,” and there was light. ^{4}God saw
that the light was good, and he separated the light from the darkness.
^{5}God called the light “day,” and the darkness he called “night.” And
there was evening, and there was morning—the first day.

On Fri, Jul 10, 2020 at 8:33 PM Bo Grimes  wrote:


Emacs 26.3, Org-mode 9.1.9, Kubuntu 20.04, 5.4.0-39-generic

Hi,

I've tried my hardest to find an answer in the manuals (print book and
on-line), this list, Reddit, and Stack Exchange with no luck.  I use Emacs
for org-mode, and I don't code or know Elisp.  I have no use for or
interest in learning LaTeX.  I never use subscript, and I only use
superscript in poetry/prose (mostly quotes, not original), and I don't
foresee (but admit I may) a need to export.

I understand that:

^2H is not recognized as superscript _on purpose_. Per Org syntax, you
have to add a non-blank character before the caret. Otherwise, there would
be ambiguity between underline (e.g., _under_) and subscript (_under). And
superscript syntax follows subscript's. [1]

That makes sense to me as a default [2], given that so many org-mode users
use both in math, science, and literate coding context, so I wouldn't think
to suggest it to be changed.  All I want to know is how I can change it for
*me*.

I would like to org-toggle-pretty-entities in a buffer and see superscript
before, say, a poetry line or Bible verse I'm quoting in a note or journal
entry, and not see the non-blank character.

Can this be done via customize or with an Elisp snippet in init.el?

Thanks!

[1] https://lists.gnu.org/archive/html/emacs-orgmode/2014-06/msg01022.html

[2] Though I wish it were made explicit in the manuals
https://orgmode.org/manual/Subscripts-and-Superscripts.html#Subscripts-and-Superscripts
(Org Mode 9 Reference Manual p 132). It took me a while to figure out why
it wasn't working at all.







Why is Babel-C trimming its output?

2020-07-15 Thread Michaël Cadilhac
Hello,

Quick question here: in ob-C.el, before returning the output of a C
file, there's this line:

(setq results (org-trim (org-remove-indentation results)))

That seems quite arbitrary; is it on purpose?  I have a C file that
outputs some sort of list of formatted numbers, e.g.:

  0  -17.8
 404.4
 80   26.7
120   48.9

and only the first line gets trimmed, leading to a faulty output.

This does not seem to be a universal thing in Babel; for instance:

#+begin_src emacs-lisp :exports both :results value raw
  " 0\n 1\n2\n"
#+end_src

…results in:

#+RESULTS:
 0
 1
2

But the same thing in C:

#+begin_src C :exports both :results output raw
  printf (" 0\n 1\n2\n");
#+end_src

…results in:
#+RESULTS:
0
 1
2

Cheers,
M.



Re: [PATCH] 3 improvements to ob-screen

2020-07-15 Thread Ken Mankoff

On 2020-07-14 at 20:08 -07, Kyle Meyer  wrote...
> Could you add a changelog entry to the body of this commit message and
> the others?

I made the changes you requested. Updated patches attached.

  -k.

>From d7b7555969ce0e58653c5b5a78d9a4a0bebbacdf Mon Sep 17 00:00:00 2001
From: "Kenneth D. Mankoff" 
Date: Tue, 14 Jul 2020 13:29:36 -0700
Subject: [PATCH 1/3] ob-screen: Execute last line in block (send newline)

* lisp/ob-screen.el (org-babel-screen-session-write-temp-file): insert
newline after body.
---
 lisp/ob-screen.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index 75a2dc691..3edc2c265 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -108,6 +108,7 @@ In case you want to use a different screen than one selected by your $PATH")
   (let ((tmpfile (org-babel-temp-file "screen-")))
 (with-temp-file tmpfile
   (insert body)
+  (insert "\n")
 
   ;; org-babel has superfluous spaces
   (goto-char (point-min))
-- 
2.25.1

>From 05dcb2a9f9acb6d15c88ac67d9268243b620cf5e Mon Sep 17 00:00:00 2001
From: "Kenneth D. Mankoff" 
Date: Tue, 14 Jul 2020 13:41:35 -0700
Subject: [PATCH 2/3] ob-screen: Respect :session name. Don't prepend
 'org-babel-session-'

* lisp/ob-screen.el (org-babel-prep-session:screen): Remove concat of
"org-babel-session-" string onto session name when creating session.

* lisp/ob-screen.el (org-babel-screen-session-socketname): Remove
concat of "org-babel-session-" string onto session name searching for
existing screen session.
---
 etc/ORG-NEWS  | 7 +++
 lisp/ob-screen.el | 6 ++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index c366f61e0..623fa9dc3 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -380,6 +380,13 @@ From ~org-enable-priority-commands~ to ~org-priority-enable-commands~.
 From ~org-show-priority~ to ~org-priority-show~.
 
 ** Miscellaneous
+*** =ob-screen.el=: Respect screen =:session= name
+
+Screen babel session are now named based on the =:session= header 
+argument (defaults to ~default~). 
+
+Previously all session names had  ~org-babel-session-~ prepended.
+
 *** Forward/backward paragraph functions in line with the rest of Emacs
 ~org-forward-paragraph~ and ~org-backward-paragraph~, bound to
 ~~ and ~~ functions mimic more closely behaviour of
diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index 3edc2c265..fe4698203 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -62,8 +62,7 @@ In case you want to use a different screen than one selected by your $PATH")
  (process-name (concat "org-babel: terminal (" session ")")))
 (apply 'start-process process-name "*Messages*"
terminal `("-T" ,(concat "org-babel: " session) "-e" ,org-babel-screen-location
-		  "-c" "/dev/null" "-mS" ,(concat "org-babel-session-" session)
-		  ,cmd))
+		  "-c" "/dev/null" "-mS" ,session ,cmd))
 ;; XXX: Is there a better way than the following?
 (while (not (org-babel-screen-session-socketname session))
   ;; wait until screen session is available before returning
@@ -97,8 +96,7 @@ In case you want to use a different screen than one selected by your $PATH")
 			 nil
 			 (mapcar
 			  (lambda (x)
-			(when (string-match
-   (concat "org-babel-session-" session) x)
+			(when (string-match x)
 			  x))
 			  sockets)
 (when match-socket (car (split-string match-socket)
-- 
2.25.1

>From d99c637f1cade54ab2f66b72ec32026a15aa03de Mon Sep 17 00:00:00 2001
From: "Kenneth D. Mankoff" 
Date: Tue, 14 Jul 2020 13:48:52 -0700
Subject: [PATCH 3/3] ob-screen: accept :screenrc header argument

* lisp/ob-screen.el (org-babel-default-header-args:screen): Add
default header argument `:screenrc' and value "/dev/null".

* lisp/ob-screen.el (org-babel-prep-session:screen): Use header
argument in variable `screenrc' and not hard-coded value.
---
 etc/ORG-NEWS  | 6 ++
 lisp/ob-screen.el | 6 --
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 623fa9dc3..5fb2af22e 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -229,6 +229,12 @@ directory configured for ClojureScript will /not/ work.
 Babel Java blocks recognize header argument =:cmdargs= and pass its
 value in call to =java=.
 
+*** =ob-screen.el=: Screen now accepts =:screenrc= header argument
+
+Screen blocks now recognize the =:screenrc= header argument and pass
+its value to the screen command via the "-c" option. The default
+remains =/dev/null= (i.e. a clean screen session)
+
 *** =RET= and =C-j= now obey ~electric-indent-mode~
 
 Since Emacs 24.4, ~electric-indent-mode~ is enabled by default.  In
diff --git a/lisp/ob-screen.el b/lisp/ob-screen.el
index fe4698203..021fef60d 100644
--- a/lisp/ob-screen.el
+++ b/lisp/ob-screen.el
@@ -40,7 +40,8 @@
 In case you want to use a different screen than one selected by your $PATH")
 
 (defvar org-babel-default-header-args:screen
-  '((:results . "s

make org-refile auto-recache when needed?

2020-07-15 Thread Adam Spiers

Hi all,

I note that when org-refile-use-cache is enabled and the cache becomes
stale, attempting to refile results in this error message (originating
from `org-refile-check-position'):

Invalid refile position, please clear the cache with `C-0 C-c C-w' before 
refiling

Is there any reason why it couldn't just automatically rebuild the
cache when needed?  If it did that then I struggle to imagine why
anyone would ever *not* want the cache enabled, because in the worst
case org-refile would just behave the same as when the cache is
disabled, and in the best case it would perform a lot faster.

Cheers,
Adam



Re: :STYLE: habit causes position in agenda view to change

2020-07-15 Thread Adam Spiers

On Tue, Jul 14, 2020 at 11:33:03PM -0400, Kyle Meyer wrote:

Adam Spiers writes:


I've noticed that adding the :STYLE: habit property to a TODO causes
its position in the agenda view to change; it jumps to the bottom of
the day.  Is there any way to prevent that?


Try customizing org-agenda-sorting-strategy (in particular, dropping
habit-down from agenda's values).


Perfect, thanks so much Kyle!



[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-attach.el
@@ -110,6 +110,12 @@ (defcustom org-attach-method 'cp
  (const :tag "Hard Link" ln)
  (const :tag "Symbol Link" lns)))
 
+(defcustom org-attach-url-function 'url-copy-file
+  "The download file function to use in org-attach-url."
+  :type '(choice (const 'url-copy-file))
+  :safe #'functionp
+  :group 'org-attach)
+
 (defcustom org-attach-expert nil
   "Non-nil means do not show the splash buffer with the attach dispatcher."
   :group 'org-attach
@@ -503,7 +509,12 @@ (defun org-attach-attach (file &optional visit-dir method)
((eq method 'cp) (copy-file file attach-file))
((eq method 'ln) (add-name-to-file file attach-file))
((eq method 'lns) (make-symbolic-link file attach-file))
-   ((eq method 'url) (url-copy-file file attach-file)))
+   ((eq method 'url) (make-thread
+ (lambda ()
+   ;; (url-copy-file file attach-file)
+   ;; FIXME This seems does not really download file. 
Don't know why.
+   (apply org-attach-url-function '(file attach-file)))
+ "org-attach-url downloading")))
   (run-hook-with-args 'org-attach-after-change-hook attach-dir)
   (org-attach-tag)
   (cond ((eq org-attach-store-link-p 'attached)
#+end_src

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, it is not
> unreasonable to expect the user to know what size is the contents he
> is willing to attach to an Org node.
>
>> I hope to make "org-attach-url" download file asynchronously. But function
>> org-attach-attach hardcoded this function for 'url method. Here is a patch to
>> make it into an option.
>
> (FWIW, I could not find the patch.)
>
> I think you are on the right track when trying to enhance the 'url
> package.  Maybe url-copy-file should be asynchronous and url could
> provide url-copy-file-synchronously (to mimic the url-retrieve and
> url-retrieve-synchronously pair)?
>
> Until Emacs has a function to copy a URL's contents asynchronously,
> I'd rather not add this functionality in Org.


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3