Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant warning regarding doct template #12

Closed
shrysr opened this issue Apr 3, 2020 · 3 comments
Closed

Constant warning regarding doct template #12

shrysr opened this issue Apr 3, 2020 · 3 comments
Assignees
Labels
support question regarding use, installation, etc.

Comments

@shrysr
Copy link

shrysr commented Apr 3, 2020

I've defined a few functions for templates like

(defun sr/fun/todo-active ()
'("* %doct(todo-state) %?"
":PROPERTIES:"
":CREATED: %U"
":PLANNED: %t"
":END:"))

which are plugged into templates for capture like

(setq org-capture-templates
      (doct '(("Tasks" :keys "t"
               :file "~/my_org/todo-global.org"
               :prepend t
	       :children (("Fast TODO"  
			   :keys "t"
			   :type entry	                           
			   :headline   "@Inbox"
			   :todo-state "TODO"
			   :template (lambda () (sr/fun/todo-active))))))))

However for each capture, I get the warning

Warning (doct): Old template expansion syntax detected. Upgrading :template value.
Substitute "* %doct(todo-state)" for "* %{todo-state}" in your configuration to prevent this warning in the future.

I have tried replacing %doct(todo-state) with %doct{todo-state} in the function above, as I see some discussion on this breaking change. However then the literal %doct{todo-state} appears in the capture. The warning appears each time I capture. I would be grateful for advice.

Note: I am using the latest commit of doct (9e7cbec) via straight.el

@shrysr shrysr added the support question regarding use, installation, etc. label Apr 3, 2020
@shrysr
Copy link
Author

shrysr commented Apr 3, 2020

AHA. I see i did not pay attention. It should have been %{todo-state}. I will close the issue.

@shrysr shrysr closed this as completed Apr 3, 2020
@progfolio
Copy link
Owner

Thanks for using doct!
Glad it was an easy fix for you. One other thing I noticed:
You should be able to use the symbol for your template function directly.

:template (lambda () (sr/fun/todo-active))

Can be:

:template sr/fun/todo-active

@shrysr
Copy link
Author

shrysr commented Apr 3, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support question regarding use, installation, etc.
Projects
None yet
Development

No branches or pull requests

2 participants