emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "tenspd137 ." <dcday137@gmail.com>
To: Marco Wahl <marcowahlsoft@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Multiple capture templates in file
Date: Tue, 6 Oct 2015 17:43:29 -0600	[thread overview]
Message-ID: <CAB=m8wJ9T6ddZZkfW9oBB+GtRt3JC+NcAQGSMfvPSK1gWnz_FQ@mail.gmail.com> (raw)
In-Reply-To: <841td7ravo.fsf@gmail.com>

I can do the following in .emacs

(setq org-capture-templates
      '(("t" "Todo" entry (file+headline (concat org-directory
"/default.org") "Tasks")
         "* TODO %?")
        ("j" "Journal" entry (file+datetree (concat org-directory
"/journal.org"))
         "* %?\nEntered on %U\n")
        ;;product or work specific stuff - I would like to move these
to files and have
        ;;them loaded - maybe in the future
    ("p" "product")
    ("pt" "Product Todo" entry (file+headline (concat org-directory
"/product.org") "Tasks") "* TODO %?")))

and it works as expected

but if I do this in .emacs:
(setq org-capture-templates
      '(("t" "Todo" entry (file+headline (concat org-directory
"/default.org") "Tasks")
         "* TODO %?")
        ("j" "Journal" entry (file+datetree (concat org-directory
"/journal.org"))
         "* %?\nEntered on %U\n")))
        ;;product or work specific stuff - I would like to move these
to files and have
        ;;them loaded - maybe in the future

(load-file (concat org-directory "/capture-templates/product-templates.el"))

with product-templates containing:

(push '(("p" "product") ("pt" "Product - Todo" entry (file+headline
(concat org-directory "/product.org") "Tasks") "* TODO %?"))
org-capture-templates)

and then I use C-c n to go to capture mode, it just hangs with the
mouse cursor in a spinning wheel.  Am I not translating the part to go
into submenus correctly, or can you not add sub-menus as I am doing.

Thanks!

-C

On Tue, Oct 6, 2015 at 2:38 PM, Marco Wahl <marcowahlsoft@gmail.com> wrote:
> Hi!
>
> "tenspd137 ." <dcday137@gmail.com> writes:
>
>> I am trying to figure out how to store multiple capture templates in a
>> file, have several files of related templates, and then load all the
>> files stored in a directory.  For example, lets say I have two
>> projects at work WorkProject1 and WorkProject2.  Then I have two files
>> in a directory org-templates called WorkProj1Templates.el and
>> WorkTemplates2.el.  How can I append the templates in these files to
>> or capture templates?  In my main .emacs, I have:
>>
>> (setq org-capture-templates
>>       '(("t" "Todo" entry (file+headline (concat org-directory
>> "/default.org") "Tasks")
>>          "* TODO %?")
>>         ("j" "Journal" entry (file+datetree (concat org-directory
>> "/journal.org"))
>>          "* %?\nEntered on %U\n")))
>>
>> I would like to then load the template files in org-templates.  That
>> way, when a project ends, I can just yank the templates.  I have
>> experimentally tried using add-to-list with org-capture-templates
>> without success.  Either that can't be done or my syntax was wrong?
>
> How could anyone tell if you don't show your attempt?
>
>> Does anyone have any ideas?
>
> What about this?
>
> WorkProj1Templates.el:
>
> #v+
> (push '("1" "Todo" entry
>         (file+headline
>          (concat org-directory "/WorkProj1.org")
>          "Tasks")
>         "* TODO %?")
>       org-capture-templates)
> #v-
>
> --
> Marco Wahl
> GPG: 0x49010A040A3AE6F2
>
>

  parent reply	other threads:[~2015-10-06 23:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 19:35 Multiple capture templates in file tenspd137 .
2015-10-06 20:38 ` Marco Wahl
2015-10-06 21:01   ` Subhan Michael Tindall
2015-10-06 21:15   ` tenspd137 .
2015-10-06 23:43   ` tenspd137 . [this message]
2015-10-07  0:45     ` tenspd137 .
2015-10-07  6:45       ` tenspd137 .

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=m8wJ9T6ddZZkfW9oBB+GtRt3JC+NcAQGSMfvPSK1gWnz_FQ@mail.gmail.com' \
    --to=dcday137@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=marcowahlsoft@gmail.com \
    /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).