emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "tenspd137 ." <dcday137@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Dynamically creating capture mode templates (solved)
Date: Fri, 9 Oct 2015 22:34:19 -0600	[thread overview]
Message-ID: <CAB=m8wJ+FtMumFDYa4i10DmmmJsPNb0q3A8C4Cd1VYjLOABSdg@mail.gmail.com> (raw)

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 . <dcday137@gmail.com> 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	other threads:[~2015-10-10  4:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAB=m8wJ+FtMumFDYa4i10DmmmJsPNb0q3A8C4Cd1VYjLOABSdg@mail.gmail.com' \
    --to=dcday137@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).