emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Chao Lu <loochao.list@gmail.com>
To: Oleh <ohwoeowho@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: org-download.el
Date: Sun, 18 Jan 2015 22:29:53 -0500	[thread overview]
Message-ID: <CAD54YEbZ7PHNYesKZTwWMn5U8fVoPPT+HpbGHrk7SMMZLYDM1g@mail.gmail.com> (raw)
In-Reply-To: <CAA01p3pVG5v8CEYXQAg1=Ox2o5Uf3EGnMw-EjZ+01is+ZSOmvg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2656 bytes --]

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 <http://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 <http://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 <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-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
>

[-- Attachment #2: Type: text/html, Size: 3726 bytes --]

  parent reply	other threads:[~2015-01-19  3:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13  7:49 org-download.el Chao Lu
2015-01-13  8:47 ` org-download.el briangpowell .
2015-01-13  8:58   ` org-download.el Rainer M Krug
2015-01-13 16:47     ` org-download.el Chao Lu
2015-01-15 12:11 ` org-download.el Oleh
2015-01-18 10:04   ` org-download.el Chao Lu
2015-01-18 11:10     ` org-download.el Oleh
2015-01-18 19:31       ` org-download.el Oleh
2015-01-19  3:29       ` Chao Lu [this message]
2015-01-19  8:28         ` org-download.el Oleh

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=CAD54YEbZ7PHNYesKZTwWMn5U8fVoPPT+HpbGHrk7SMMZLYDM1g@mail.gmail.com \
    --to=loochao.list@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ohwoeowho@gmail.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).