(fix)capture: Process fn capture templates before whitespace-content (#2157)

* [Fix #2156] Expand fn templates in fill-template before whitespace-content

* Update change log and adding tests related to #2157
This commit is contained in:
Ahmed Shariff
2022-04-14 12:50:47 -04:00
committed by GitHub
parent 3bb45afccb
commit 9eaf91b801
3 changed files with 11 additions and 2 deletions

View File

@ -762,7 +762,10 @@ This function is to be called in the Org-capture finalization process."
It expands ${var} occurrences in TEMPLATE, and then runs
org-capture's template expansion.
When ENSURE-NEWLINE, always ensure there's a newline behind."
(let ((template-whitespace-content (org-roam-whitespace-content template)))
(let* ((template (if (functionp template)
(funcall template)
template))
(template-whitespace-content (org-roam-whitespace-content template)))
(setq template
(org-roam-format-template
template