Hi Bastien

On Thu, Aug 9, 2012 at 4:53 PM, Bastien <b...@gnu.org> wrote:

> I've check against current Emacs trunk, and only three files/packages
> uses this: rst.el, filesets.el and mh-e.
>
> So I'd rather not pollute the hundred files of Org with this.

That's all right.

> (org-at-regexp-p org-capture-template-embedded-elisp-re) already
> returns the correct value for %(length ")")

For the above example yes, but not with more than one %():
“- %(capitalize "simple percent-escape")\n- %(capitalize "one more")”

Also non-greedy regexp is not enough here:
“%(capitalize "(some) text")”

> -- but you're right there
> is a problem with my patch: `org-at-regexp-p' does not match over
> multiple lines.  Maybe you can play with `org-in-regexp':
>
>   (org-in-regexp org-capture-template-embedded-elisp-re 3)
>
> If using `forward-sexp' is necessary let's do so -- but I thought it
> was too complex first.

When I wrote the patch my conclusion was that regexp alone is not
sufficient. For real feed templates used by me, not only for
artificial examples. I must admit that my solution with `forward-sexp'
is complicated but it makes available the power of the Emacs Lisp Mode
parser. Maybe there are still some simplifications?

Michael

Reply via email to