From: Ryo TAKAISHI <ryo.takaishi.0@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Capture: Expand keyword within %(SEXP) in template
Date: Fri, 02 Nov 2012 22:55:56 +0900 [thread overview]
Message-ID: <878vak9kib.fsf@gmail.com> (raw)
In-Reply-To: <87ip9oi5qt.fsf@gmail.com> (Nicolas Goaziou's message of "Fri, 02 Nov 2012 12:50:02 +0100")
Nicolas Goaziou <n.goaziou@gmail.com> writes:
> Hello,
>
> Thanks for your patch. Here are a few comments about it.
>
> Ryo TAKAISHI <ryo.takaishi.0@gmail.com> writes:
>
>> * lisp/org-capture.el: If %(SEXP) has %:keyword, expand it using org-store-link-plist.
>>
>> I want to expand %:description keyword in sexp "%(func %:description)".
>> But if org-capture template is "%(function %:keyword)", function
>> take a symbol %:keyword, it does'nt expand.
>> This patch expand %:keyword within %(SEXP), so funcsion is taken %:keyword's value.
>> For example, when capture template is "%(func %:description)" and
>> a keyword :description is "foobar", func is taken string "foobar".
>
> I'm not sure to understand why this patch is necessary. Can't you use
> (plist-get org-store-link-plist :description) from your sexp instead?
>
I did'nt come up with to use it.
But "%(func %:description)" or "%(func (plist-get org-store-link-plist :description))", I think the former is readble template than the latter.
>> + (let* ((sexp (mapcar '(lambda (attr)
>
> lambdas are self-quoting: do not explicitly quote them.
>
>> + (key (if (string-match "%\\(:.*\\)" attr-symbol)
>> + (intern (match-string 1 attr-symbol))
>> + nil)))
>
> (key (and (string-match "%\\(:.*\\)" attr-symbol)
> (intern (match-string 1 attr-symbol))))
>
> is better.
>
>
> Regards,
Thank you for your comment, I'll refine my code.
Regards,
Ryo
next prev parent reply other threads:[~2012-11-02 13:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 9:20 [PATCH] Capture: Expand keyword within %(SEXP) in template Ryo TAKAISHI
2012-11-02 11:50 ` Nicolas Goaziou
2012-11-02 13:55 ` Ryo TAKAISHI [this message]
2012-11-02 14:11 ` Nicolas Goaziou
2012-11-02 15:36 ` Ryo TAKAISHI
2012-11-03 8:45 ` Nicolas Goaziou
2012-11-04 7:51 ` Ryo TAKAISHI
2012-11-04 13:10 ` Nicolas Goaziou
2012-11-04 15:05 ` Ryo TAKAISHI
2012-11-05 0:38 ` Nicolas Goaziou
2012-11-05 12:34 ` Ryo TAKAISHI
2012-11-05 12:39 ` Nicolas Goaziou
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=878vak9kib.fsf@gmail.com \
--to=ryo.takaishi.0@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=n.goaziou@gmail.com \
/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).