emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Drag images from Firefox to org-mode


From: Rick Frankel
Subject: Re: [O] Drag images from Firefox to org-mode
Date: Fri, 18 Oct 2013 11:03:01 -0400
User-agent: Roundcube Webmail/0.9.0

On 2013-10-18 07:00, Nicolas Richard wrote:
[re-adding address@hidden to cc, I don't know when it got lost]

Le 18/10/2013 12:44, Oleh a écrit :
I attach the downloaded google logo.

I missed an email here... can you send me the url to the image you are
having problems with? I just tried the google png on the home page
(logo11w.png), and have no problems. Also, please try the updated
version of fetch-image (in another thread, duplicated below).

FYI, I am use Emacs. 24.3 with the included url.el.


rick

#+BEGIN_SRC emacs-lisp
(defun fetch-image (url &optional destdir)
(url-retrieve
url
(lambda (status url destdir)
(let ((err (plist-get status :error)))
(if err (error
"\"%s\" %s." url
(downcase (nth 2 (assq (nth 2 err) url-http-codes))))))
(delete-region
(point-min)
(progn
(re-search-forward "^$" nil 'move)
(1+ (point))))
(write-file
(expand-file-name (file-name-nondirectory url) destdir))
(when (display-graphic-p) (pop-to-buffer (current-buffer))))
`(,url ,destdir) nil t))
#+END_SRC



reply via email to

[Prev in Thread] Current Thread [Next in Thread]