emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Org campture recursively expands %-escapes


From: Michael Brand
Subject: Re: [O] Org campture recursively expands %-escapes
Date: Sun, 10 Jan 2016 09:08:01 +0100

Hi Nicolas

On Sat, Jan 9, 2016 at 6:54 PM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
>
> Michael Brand <michael.address@hidden> writes:
>
> > My current ERT for test-org-feed.el
> >
> >    (equal
> >     "5 % Less (See\n Item \"3)\" Somewhere)"
> >     (org-feed-format-entry
> >      '(:title "5 % less (see\n item \"3)\" somewhere)")
> >      "%(capitalize \"%h\")" nil))
> >
> > works now too. What does not work yet is my backport of the above ERT
> > to test-org-capture.el:
> >
> >    (equal
> >     "5 % Less (See\n Item \"3)\" Somewhere)\n"
> >     (let ((org-store-link-plist nil))
> >       (org-capture-fill-template
> >        "%(capitalize \"%i\")"
> >        "5 % less (see\n item \"3)\" somewhere)")))
> >
> > Am I doing something wrong?
>
> I think you're mis-using "%i" place-holder. One feature is to repeat the
> leading text, so that, when you write, for example "> %i", "> " is
> repeated every line.

Indeed. After removing the "\n" from the input of the capture ERT it
works too.

I would like to push the attached change to add some ERTs with the
commit msg below and would like to ask you for a review first.

Michael

----------------------------------------

Add ERTs for feed templates

* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
  Strengthen some expectations, add new tests.

* testing/lisp/test-org-feed.el: New file derived from
  testing/lisp/test-org-capture.el.

Attachment: git.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]