emacs-orgmode
[Top][All Lists]
Advanced

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

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


From: Nicolas Goaziou
Subject: Re: [O] [PATCH] Capture: Expand keyword within %(SEXP) in template
Date: Fri, 02 Nov 2012 12:50:02 +0100

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?

> +     (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,

-- 
Nicolas Goaziou



reply via email to

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