1

Not sure what's going on here. This is my capture template:

  ("j" "Capture RSS to Incoming"
   entry
   (file+headline "~/Org/jay.org" "Incoming")
   "* %c :RSS:\n%(org-link-unescape \"%i\")"
   :immediate-finish t)

When I call it with this:

(org-protocol-capture "j/aaa/bbb/cccddd")

I get what I'd expect, a line like

* [[aaa][bbb]] :RSS:
  cccddd

but when I call it with this:

(org-protocol-capture "j/aaa/bbb/ccc%0Addd")

I get the error:

byte-code: Capture abort: (end-of-file)

So somehow it seems it does not like the initial content, %i, to have multiple lines. Can anyone clue me in to what I'm doing wrong?

1

Multi-line content seems to be supported. Which version of emacs and org-mode are you using?

Using a recent version of emacs and org-mode, I cannot reproduce the error. invoke a clean emacs:

$ emacs -q

steps to reproduce:

(require 'org-capture)
(require 'org-protocol)

(message (emacs-version))
(org-version nil t t)

(customize-set-variable
 'org-capture-templates
 (quote (("j" "Capture RSS to Incoming"
          entry
          (file+headline "~/tmp/jay.org" "Incoming")
          "* %c :RSS:\n%(org-link-unescape \"%i\")"
          :immediate-finish t))))

(kill-new "Test headline" t)

(org-protocol-capture "j/aaa/bbb/cccddd")
(org-protocol-capture "j/aaa/bbb/ccc%0Addd")

Contents of ~/tmp/jay.org is:

* Incoming
** Test headline                                                        :RSS:
 cccddd
** Test headline                                                        :RSS:
 ccc
 ddd

*Messages* shows:

org-capture
org-protocol
GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2018-06-29
"GNU Emacs 27.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.18.9)
 of 2018-06-29"
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/27.0.50/lisp/org/)
"Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/27.0.50/lisp/org/)"
(("j" "Capture RSS to Incoming" entry (file+headline "~/tmp/jay.org" "Incoming") "* %c :RSS:
%(org-link-unescape \"%i\")" :immediate-finish t))
"Test headline"
(New file)
Clipboard pasted as level 2 subtree
Wrote /home/jeff/tmp/jay.org
Item captured.
nil
Clipboard pasted as level 2 subtree
Wrote /home/jeff/tmp/jay.org
Item captured.
nil

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.