From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Lu Subject: Re: org-download.el Date: Sun, 18 Jan 2015 22:29:53 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d043c7efa8aa188050cf8ef06 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD32K-00025R-Lj for emacs-orgmode@gnu.org; Sun, 18 Jan 2015 22:29:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YD32I-00035a-Qa for emacs-orgmode@gnu.org; Sun, 18 Jan 2015 22:29:56 -0500 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:58259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD32I-00035W-GI for emacs-orgmode@gnu.org; Sun, 18 Jan 2015 22:29:54 -0500 Received: by mail-wi0-f171.google.com with SMTP id l15so4256002wiw.4 for ; Sun, 18 Jan 2015 19:29:53 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Oleh Cc: emacs-orgmode --f46d043c7efa8aa188050cf8ef06 Content-Type: text/plain; charset=UTF-8 Hi Oleh, Thanks a lot for the detailed instruction again, and the screencast is a good job as well! I just did the testing. Please see below. 1. Have you made any customizations to `org-download`? It's easier for me to proceed with the defaults. *-- No, all I did is (require 'org-download)* 2. As I'm testing now, I can get a "Wrong type argument: number-or-marker-p, nil" error if the org-mode file in question is empty or the cursor is before the first heading. Is this the case for you? I'll fix this case soon anyway. -- *Not really, I made a test.org then insert some heading, then tried (org-download-yank) with the web address on top of kill-ring, which did not trig the download events as well.* 3. If this doesn't work, try the following simplified function: (defun org-download-yank-1 () (interactive) (let ((filename "./foo.png")) (org-download--image "https://www.google.nl/images/srpr/logo11w.png" filename) (insert (format "[[%s]]" filename)) (org-display-inline-images))) *-- This one works! The google logo gets into my test.org buffer, which is a good signal~* Please let me know if there's any further instruction. And thanks for the help~~ Best, Chao On Sun, Jan 18, 2015 at 6:10 AM, Oleh wrote: > > Thanks for the detailed instruction. I just checked following your > advice, > > by copying the address of the image (and by looking at the browser-ring, > I > > can make sure the address has been there), then M-x org-download-yank, > > returns error: "if: Wrong type argument: number-or-marker-p, nil". > > > > Also I tried (org-download-yank "the-address-to-the-image"), which does > not > > work either. > > > > Do you have any insight? Thanks. > > Alright, we're getting somewhere now. > > 1. Have you made any customizations to `org-download`? It's easier for > me to proceed with the defaults. > 2. As I'm testing now, I can get a "Wrong type argument: > number-or-marker-p, nil" error if the org-mode file in question is > empty or the cursor is before the first heading. Is this the case for > you? > I'll fix this case soon anyway. > 3. If this doesn't work, try the following simplified function: > > (defun org-download-yank-1 () > (interactive) > (let ((filename "./foo.png")) > (org-download--image > "https://www.google.nl/images/srpr/logo11w.png" > filename) > (insert (format "[[%s]]" filename)) > (org-display-inline-images))) > > If this one doesn't work as well, I can proceed from there. > > regards, > Oleh > --f46d043c7efa8aa188050cf8ef06 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Oleh,

Thanks a lot for the detai= led instruction again, and the screencast is a good job as well! I just did= the testing. Please see below.

1. Have you made any customizations = to `org-download`? It's easier for
me to proceed with the defaults.

-- No, all I did is (requi= re 'org-download)

2. As I'm testing now, I can get a "Wrong type argument:
=C2=A0 =C2=A0number-or-marker-p, nil" error if the org-mode file in qu= estion is
=C2=A0 =C2=A0empty or the cursor is before the first heading. Is this the c= ase for you?
=C2=A0 =C2=A0I'll fix this case soon anyway.
-- Not re= ally, I made a test.org then insert some he= ading, then tried (org-download-yank) with the web address on top of kill-r= ing, which did not trig the download events as well.

3. If this doesn't work, try the following simplified function:

=C2=A0 =C2=A0 (defun org-download-yank-1 ()
=C2=A0 =C2=A0 =C2=A0 (interactive)
=C2=A0 =C2=A0 =C2=A0 (let ((filename "./foo.png"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-download--image
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"https://www.google.nl/images/srpr/= logo11w.png"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0filename)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (insert (format "[[%s]]" filename)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-display-inline-images)))

-- This one works! The google logo gets into my test.org buffer, which is a good signal~

Ple= ase let me know if there's any further instruction. And thanks for the = help~~

Best,

Chao


O= n Sun, Jan 18, 2015 at 6:10 AM, Oleh <ohwoeowho@gmail.com>= wrote:
> Thanks for = the detailed instruction. I just checked following your advice,
> by copying the address of the image (and by looking at the browser-rin= g, I
> can make sure the address has been there), then M-x org-download-yank,=
> returns error: "if: Wrong type argument: number-or-marker-p, nil&= quot;.
>
> Also I tried (org-download-yank "the-address-to-the-image"),= which does not
> work either.
>
> Do you have any insight? Thanks.

Alright, we're getting somewhere now.

1. Have you made any customizations to `org-download`? It's easier for<= br> me to proceed with the defaults.
2. As I'm testing now, I can get a "Wrong type argument:
=C2=A0 =C2=A0number-or-marker-p, nil" error if the org-mode file in qu= estion is
=C2=A0 =C2=A0empty or the cursor is before the first heading. Is this the c= ase for you?
=C2=A0 =C2=A0I'll fix this case soon anyway.
3. If this doesn't work, try the following simplified function:

=C2=A0 =C2=A0 (defun org-download-yank-1 ()
=C2=A0 =C2=A0 =C2=A0 (interactive)
=C2=A0 =C2=A0 =C2=A0 (let ((filename "./foo.png"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-download--image
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"https://www.google.nl/images/srpr/= logo11w.png"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0filename)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (insert (format "[[%s]]" filename)) =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-display-inline-images)))

If this one doesn't work as well, I can proceed from there.

regards,
Oleh

--f46d043c7efa8aa188050cf8ef06--