From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Rick Frankel <rick@rickster.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Drag images from Firefox to org-mode
Date: Fri, 18 Oct 2013 17:39:50 +0200 [thread overview]
Message-ID: <87vc0upozd.fsf@yahoo.fr> (raw)
In-Reply-To: <9265ea6f8a8b76ddf5d77de837d057a8@mail.rickster.com> (Rick Frankel's message of "Fri, 18 Oct 2013 10:44:37 -0400")
Rick Frankel <rick@rickster.com> writes:
> On 2013-10-18 01:29, Nicolas Richard wrote:
>> Rick Frankel <rick@rickster.com> writes:
>> One small problem, should be =(1+ (point))=, as the above leaves a
>> blank newline at the head of the jpg, making it invalid.
>>
>> Oops, yes [Initially I had (search-forward "\n\n"), which worked
>> fine,... then changed my mind and didn't test. Silly me.]
>>
>> Your code downloaded two images easily, but
>> (signal :error (cdr err))))
>> signals a weird error for me (something like: "error in
>> process filter: if: peculiar error: http, 404"). I suggest:
>>
>> (error "Error fetching URL %s: %s" url (cdr err))
>
> That seems fine. I was just following the suggestion in the doc string
> for `url-retrieve'.
Indeed, it is bizarre because err contains e.g. (error http 404), which is
claimed to be of the form ERROR-SYMBOL . DATA, but (car DATA) must be
a string according to (info "(elisp) Signaling Errors") :
,----
| For `error', the error message is
| the CAR of DATA (that must be a string).
`----
> BTW, did you know that org already has a function which works
> perfectly for this purpose (well, it's synchronous, but otherwise...)
> `org-feed-get-feed'?
No, I didn't know that (but I think doing things asynchronously has
added value).
> (let ((err (plist-get status :error)))
> (if err (error
> "\"%s\" %s." url
> (downcase (nth 2 (assq (nth 2 err) url-http-codes))))))
Nice
--
Nico.
next prev parent reply other threads:[~2013-10-18 15:39 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 10:04 Drag images from Firefox to org-mode Oleh
2013-10-16 13:48 ` Torsten Wagner
2013-10-16 14:22 ` Xebar Saram
2013-10-16 15:52 ` Oleh
2013-10-16 17:28 ` Marcin Borkowski
2013-10-17 11:49 ` Samuel Loury
2013-10-17 3:42 ` Eric Abrahamsen
2013-10-17 12:04 ` Carsten Dominik
2013-10-17 12:43 ` Nicolas Richard
2013-10-17 14:04 ` Rick Frankel
2013-10-17 14:48 ` Nicolas Richard
2013-10-17 16:51 ` Rick Frankel
2013-10-18 5:29 ` Nicolas Richard
2013-10-18 14:44 ` Rick Frankel
2013-10-18 15:39 ` Nicolas Richard [this message]
2013-10-18 9:24 ` Oleh
2013-10-18 9:28 ` Carsten Dominik
2013-10-18 9:33 ` Oleh
2013-10-18 9:47 ` Nicolas Richard
2013-10-18 10:04 ` Oleh
2013-10-18 10:23 ` Nicolas Richard
[not found] ` <CAA01p3obTUXshcS-m=iB2KOADAx9eNpj8PK_F5O1x5dLtCobcA@mail.gmail.com>
2013-10-18 11:00 ` Nicolas Richard
2013-10-18 11:06 ` Oleh
2013-10-18 15:03 ` Rick Frankel
2013-10-18 15:36 ` Nicolas Richard
2013-10-18 15:44 ` Rick Frankel
2013-10-18 18:24 ` Rick Frankel
2013-10-18 19:22 ` Oleh
2013-10-18 20:45 ` Rick Frankel
2013-10-19 10:34 ` Oleh
2013-10-20 20:42 ` Nicolas Richard
2013-10-21 7:24 ` Oleh
2013-10-23 17:13 ` Rick Frankel
2013-10-23 18:26 ` Oleh
2013-10-23 18:59 ` Torsten Wagner
2013-10-23 20:01 ` Torsten Wagner
2013-10-24 6:47 ` Christian Moe
2014-01-04 15:01 ` Oleh
2014-01-04 15:17 ` Bastien
2013-10-18 10:44 ` Nicolas Richard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vc0upozd.fsf@yahoo.fr \
--to=theonewiththeevillook@yahoo.fr \
--cc=emacs-orgmode@gnu.org \
--cc=rick@rickster.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).