emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: Add the capture feature "%(sexp)" to org-feed
Date: Thu, 9 Aug 2012 20:00:37 +0200	[thread overview]
Message-ID: <CALn3zohvUBi4emSi8Wm1J7cVb5Wj6mvsVfqyvdTNWei+OnyKEw@mail.gmail.com> (raw)
In-Reply-To: <87liho86cp.fsf@gnu.org>

Hi Bastien

On Thu, Aug 9, 2012 at 4:53 PM, Bastien <bzg@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	other threads:[~2012-08-09 18:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-16 15:53 Add the capture feature "%(sexp)" to org-feed Michael Brand
2012-06-17  2:07 ` Nick Dokos
2012-06-24 17:51   ` Michael Brand
2012-08-07 23:05     ` Bastien
2012-08-09 14:07       ` Michael Brand
2012-08-09 14:53         ` Bastien
2012-08-09 18:00           ` Michael Brand [this message]
2012-08-10  8:53             ` Bastien
2012-08-11 15:31               ` Michael Brand
2012-08-11 16:55                 ` Bastien
2012-08-11 18:11                   ` Michael Brand
2012-08-11 21:59                     ` Bastien
2012-08-12  9:37                       ` Michael Brand
2012-08-12 10:12                         ` Bastien
2012-08-09 21:09           ` Ivan Andrus
2012-08-10  4:48             ` Michael Brand
2012-08-10  7:24               ` Bastien

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=CALn3zohvUBi4emSi8Wm1J7cVb5Wj6mvsVfqyvdTNWei+OnyKEw@mail.gmail.com \
    --to=michael.ch.brand@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    /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).