emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Org capture: Invalid use of ‘\’ in replacement text [9.1.14 (9.1.14-1049-g04641c-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20181203/)]
@ 2018-12-08  2:12 Allen Li
  2018-12-08  3:37 ` [PATCH] " Allen Li
  2018-12-08 10:51 ` Nicolas Goaziou
  0 siblings, 2 replies; 5+ messages in thread
From: Allen Li @ 2018-12-08  2:12 UTC (permalink / raw)
  To: Org Mode List

There's an escaping bug in Org capture:

1. emacs -Q
2. Evaluate:

(setq org-capture-templates
   '(("Z" "org-protocol capture" entry
      (file "/tmp/tmp")
      "* %?
%(let ((x \"%:annotation\")) (if (string= x \"\") \"\" (concat x
\"\\n\")))%i")))

3. Evaluate (require 'org-protocol)

4. Evaluate to simulate org protocol capture:

    (org-protocol-capture '(:template "Z" :body "foo\nbar\n"))

Causes error:

(error "Capture abort: (error Invalid use of ‘\\’ in replacement text)")

org-protocol is used in the example as that's where I encountered it,
but the bug is in org-capture proper.

Note that this works:

    (org-protocol-capture '(:template "Z" :body "foo"))

Emacs  : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-07-05
Package: Org mode version 9.1.14 (9.1.14-1049-g04641c-elpaplus @
/home/ionasal/.emacs.d/elpa/org-plus-contrib-20181203/)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-09 23:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-08  2:12 Bug: Org capture: Invalid use of ‘\’ in replacement text [9.1.14 (9.1.14-1049-g04641c-elpaplus @ /home/ionasal/.emacs.d/elpa/org-plus-contrib-20181203/)] Allen Li
2018-12-08  3:37 ` [PATCH] " Allen Li
2018-12-08  9:54   ` Nicolas Goaziou
2018-12-09 23:25   ` Nicolas Goaziou
2018-12-08 10:51 ` Nicolas Goaziou

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).