emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Dynamically creating capture mode templates (solved)


From: tenspd137 .
Subject: Re: [O] Dynamically creating capture mode templates (solved)
Date: Fri, 9 Oct 2015 22:34:19 -0600

Needed to use backquotes correctly:

(setq products '("Firebird" "Ion"))


(dolist (product products)
  (setq org-capture-templates
        (append org-capture-templates `( (,(substring product 0 1) ,product)
                                        (,(concat (substring product 0
1) "t" ) "Todo" entry (file+headline (concat org-directory
"/default.org") ,product) "* TODO %?" )     ))))

Again - I hope this helps someone else in the future.

Thanks!



On Fri, Oct 9, 2015 at 12:34 PM, tenspd137 . <address@hidden> wrote:
> Hi all -
>
> I was hoping someone could help me figure this out.  I have the
> following in a .el file I am loading to create keys for my projects:
>
> (setq projects '("Aa" "Bb" "Cc" "Dd")
>
> (let (firstLetter)
>   (dolist (project projects firstLetter)
>     (setq firstLetter (substring project 0 1))
>     (message "%s" firstLetter)
>     (setq org-capture-templates
>           (append org-capture-templates
>                   '((firstLetter project)
>                     ((concat firstLetter "t") "Todo" entry
> (file+headline (concat org-directory "/default.org") project) "* TODO
> %?"))))))
>
> C-n (to activate capture mode)
>
> org-mks: Wrong type argument: sequencep, firstLetter
>
>
> but in the messages window, it prints the firstLetter variable -
> shouldn't firstLetter be a string or char?
>
> Anyway, I can't seem to get this to work - could anyone give me some
> insight as to what I am missing?
>
> Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]