Hello,
> I fix these problem. A new patch expand keyword recursively, and only
> symbol.
Great.
> + (let* ((sexp (mapcar 'org-capture-expand-keyword-in-embedded-elisp
> + (read (current-buffer))))
> + (result (org-eval sexp)))
> (delete-region template-start (point))
> (insert result))))))
>
> +(defun org-capture-expand-keyword-in-embedded-elisp (attr)
> + (cond ((consp attr)
> + (mapcar 'org-capture-expand-keyword-in-embedded-elisp attr))
> + ((symbolp attr)
> + (let* ((attr-symbol (symbol-name attr))
> + (key (and (string-match "%\\(:.*\\)" attr-symbol)
> + (intern (match-string 1 attr-symbol)))))
> + (or (plist-get org-store-link-plist key)
> + attr)))
> + (t attr)))
The code looks good, although I would have moved the external `mapcar'
within the worker function in order to make its purpose clearer.
Also, would you mind to provide a docstring for the function? Something
along the lines of:
"Recursively replace capture link keywords in ATTR sexp.
Such keywords are prefixed with "%:". See `org-capture-template' for
more information."
You may also want to rename it
`org-capture--expand-keyword-in-embedded-elisp' to insist on the fact it
is an internal function. That's not mandatory, though.
Finally, this feature must be documented in `org-capture-templates'
docstring and org.texi.
Thank you for working on it.
Regards,
--
Nicolas Goaziou