progfolio / doct

DOCT: Declarative Org Capture Templates for Emacs
GNU General Public License v3.0
380 stars 8 forks source link

warnings issued with example doct. #8

Closed mohkale closed 4 years ago

mohkale commented 4 years ago

Describe the problem

In the README, there's an example doct:

(doct '(("Parent" :keys "p"
         :file "~/example.org"
         :prepend t
         :template ("* %doct(todo-state) %^{Description}"
                    ":PROPERTIES:"
                    ":Created: %U"
                    ":END:"
                    "%?")
         :children (("First Child"  :keys "1"
                     :headline   "One"
                     :todo-state "TODO"
                     :hook (lambda () (message "\"First Child\" selected.")))
                    ("Second Child" :keys "2"
                     :headline   "Two"
                     :todo-state "NEXT")
                    ("Third Child"  :keys "3"
                     :headline   "Three"
                     :todo-state "MAYBE")))))

If I try to evaluate it I get a tonne of warnings.

Directions to reproduce

  1. Copy the example doct to your *scratch* buffer.
  2. evaluate your scratch buffer (using eval-buffer).

When I do so, the warnings buffer pops up with the following messages.

Warning (doct): :template %?
:END:
:Created: %U
:PROPERTIES:
* TODO %^{Description} in declaration:
(First Child :keys p1 :headline One :todo-state TODO :hook (lambda nil (message "First Child" selected.)) :file ~/example.org :prepend t :template (* %doct(todo-state) %^{Description} :PROPERTIES: :Created: %U :END: %?))
is not a valid Org entry
Are you missing the leading ’*’?
Warning (doct): :template %?
:END:
:Created: %U
:PROPERTIES:
* NEXT %^{Description} in declaration:
(Second Child :keys p2 :headline Two :todo-state NEXT :file ~/example.org :prepend t :template (* %doct(todo-state) %^{Description} :PROPERTIES: :Created: %U :END: %?))
is not a valid Org entry
Are you missing the leading ’*’?
Warning (doct): :template %?
:END:
:Created: %U
:PROPERTIES:
* MAYBE %^{Description} in declaration:
(Third Child :keys p3 :headline Three :todo-state MAYBE :file ~/example.org :prepend t :template (* %doct(todo-state) %^{Description} :PROPERTIES: :Created: %U :END: %?))
is not a valid Org entry
Are you missing the leading ’*’?

Version information

mohkale commented 4 years ago

I'm having the same issue with all of my own templates as well.

progfolio commented 4 years ago

Sorry! Working on a patch now!

mohkale commented 4 years ago

No probs, issues like this are inevitable with a package this cool 😎.

progfolio commented 4 years ago

Temporary solution:

(setq doct-warn-when-unbound nil)

Will disable all warnings. (Note to self: rename that variable)

mohkale commented 4 years ago

Yeah, I encountered that variable when trying to make doct quieter, but I didn't try it cause the name seemed to imply it was only for a single type of issue. Maybe name it doct-allow-warnings or something.

progfolio commented 4 years ago

That branch above fixes the example you gave. Would you mind testing it on your templates?

mohkale commented 4 years ago

Yep, everythings working again. Thnx for the great work 😄.

progfolio commented 4 years ago

Excellent. Will merge to master once I do some more cleanup!

mohkale commented 4 years ago

Kay, I'll close this issue for now. 😎.