[Top][All Lists]

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

Re: [O] [PATCH] Capture: Expand keyword within %(SEXP) in template

Subject: Re: [O] [PATCH] Capture: Expand keyword within %(SEXP) in template
Date: Fri, 02 Nov 2012 22:55:56 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
> Thanks for your patch. Here are a few comments about it.
> Ryo TAKAISHI <address@hidden> 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.


reply via email to

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