progfolio / doct

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

Doct modifies list argument #9

Closed BumbleBeeBleep closed 4 years ago

BumbleBeeBleep commented 4 years ago

Hello,

I am trying to put some common children under different parents as shown below. But this does not work. Both ct and it put the todo item under the currently clocked item. After running the code the value of my/basic-capture-types is changed to this:

(("Todo" :keys "t" :template "* TODO %?" :inherited-keys "it" :clock t :file "inbox.org") ("Entry" :keys "e" :template "* TODO %?
%a" :inherited-keys "ie" :clock t :file "inbox.org"))

Is this meant to happen? If yes, what would be an other way to accomplish this? Thank You!

;; These are the type of capture-templates
(setq my/basic-capture-types
      ;; Simple todo entry
      '(("Todo" :keys "t"
         :template "* TODO %?")
        ;; Link to current entry
        ("Entry" :keys "e"
         :template "* TODO %?\n%a")))

;; Here I will add the capture types to different locations
(setq org-capture-templates
      (doct
       `(("Clock" :keys "c" :clock t
          :children ,my/basic-capture-types)
         ("Inbox" :keys "i" :file "inbox.org"
          :children ,my/basic-capture-types))))
progfolio commented 4 years ago

Thanks for reporting this. Doct does indeed modify its declarations argument. I had not anticipated your use-case! Any performance gained from mutating the argument is probably moot. Working on a patch now to fix this.

progfolio commented 4 years ago

The commit below (ad94e62) should take care of that for you. Would you mind testing it for me?

BumbleBeeBleep commented 4 years ago

This is working for me, Thanks!

progfolio commented 4 years ago

Glad to hear it! I'll merge the fix into master. Thanks again for reporting.