Thanks, Rick and Nico, I've merged the code.

All except the last bit from Rick: I can't think of any sensible
way to enter an image URL except pasting it.
And since link will be in the clipboard at some point, why not use
it straight away without prompting.

Maybe URL can be prompted for when called with a prefix arg,
but I don't know how to do that yet.

regards,
Oleh


On Fri, Oct 18, 2013 at 8:24 PM, Rick Frankel <rick@rickster.com> wrote:
On 2013-10-18 11:36, Nicolas Richard wrote:
Note that using
(let ((coding-system-for-write 'no-conversion))
(write-region nil nil filename nil nil nil 'confirm))
instead of
(write-file ...)
seemed to fix the problem for Oleh.

Attached is a patch against Nico's url-retrieve-alt which cleans-up
some issues w/ the defcustoms and make the interactive version of
`org-download-image' prompt for a url instead of attempting to use the
clipboard (which kept throwing errors for me). At least in my environment
(Chrome -> cygwin emacs on Windows NT),DND doesn't work on windows.

It also uses url-parse to get the image file name, as images with
cache-busters were failing to download (e.g.
http://example.com/image.jpg?20120101).

Again, sorry I can't do a branch and pull request, don't have push
access to github from here.

rick