From mboxrd@z Thu Jan 1 00:00:00 1970 From: "tenspd137 ." Subject: Re: Multiple capture templates in file Date: Tue, 6 Oct 2015 18:45:41 -0600 Message-ID: References: <841td7ravo.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1141a2a2dfa55605217910b2 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjcrX-0000la-O4 for emacs-orgmode@gnu.org; Tue, 06 Oct 2015 20:45:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZjcrW-0002LN-5g for emacs-orgmode@gnu.org; Tue, 06 Oct 2015 20:45:43 -0400 Received: from mail-io0-x234.google.com ([2607:f8b0:4001:c06::234]:33383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZjcrV-0002LF-VZ for emacs-orgmode@gnu.org; Tue, 06 Oct 2015 20:45:42 -0400 Received: by iofh134 with SMTP id h134so5776187iof.0 for ; Tue, 06 Oct 2015 17:45:41 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Marco Wahl Cc: emacs-orgmode@gnu.org --001a1141a2a2dfa55605217910b2 Content-Type: text/plain; charset=UTF-8 One thought I need to try either pushing one item at a time or concatenation the list of options. I'll try it when I get a chance. Playtime is over for now. Thanks for all help and suggestions so far. C On Oct 6, 2015 5:43 PM, "tenspd137 ." wrote: > 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 > wrote: > > Hi! > > > > "tenspd137 ." 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 > > > > > --001a1141a2a2dfa55605217910b2 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

One thought=C2=A0 I need to try either pushing one item at a= time or concatenation the list of options.=C2=A0=C2=A0 I'll try it whe= n I get a chance.=C2=A0=C2=A0 Playtime is over for now. Thanks for all help= and suggestions so far.

C

On Oct 6, 2015 5:43 PM, "tenspd137 ." = <dcday137@gmail.com> wrote:=
I can do the follow= ing in .emacs

(setq org-capture-templates
=C2=A0 =C2=A0 =C2=A0 '(("t" "Todo" entry (file+head= line (concat org-directory
"/= default.org") "Tasks")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"* TODO %?")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ("j" "Journal" entry (file+= datetree (concat org-directory
"/= journal.org"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"* %?\nEntered on %U\n")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;product or work specific stuff - I would like= to move these
to files and have
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;them loaded - maybe in the future
=C2=A0 =C2=A0 ("p" "product")
=C2=A0 =C2=A0 ("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
=C2=A0 =C2=A0 =C2=A0 '(("t" "Todo" entry (file+head= line (concat org-directory
"/= default.org") "Tasks")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"* TODO %?")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ("j" "Journal" entry (file+= datetree (concat org-directory
"/= journal.org"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"* %?\nEntered on %U\n")))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;product or work specific stuff - I would like= to move these
to files and have
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;them loaded - maybe in the future

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

with product-templates containing:

(push '(("p" "product") ("pt" "Produ= ct - Todo" entry (file+headline
(concat org-directory "/product.org") "Tasks") "* TOD= O %?"))
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.=C2=A0 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 ." <dcda= y137@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 t= he
>> files stored in a directory.=C2=A0 For example, lets say I have tw= o
>> projects at work WorkProject1 and WorkProject2.=C2=A0 Then I have = two files
>> in a directory org-templates called WorkProj1Templates.el and
>> WorkTemplates2.el.=C2=A0 How can I append the templates in these f= iles to
>> or capture templates?=C2=A0 In my main .emacs, I have:
>>
>> (setq org-capture-templates
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0'(("t" "Todo" en= try (file+headline (concat org-directory
>> "/default.org") "Tasks")
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "* TODO %?")
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0("j" "Journal"= ; entry (file+datetree (concat org-directory
>> "/journal.org"))
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "* %?\nEntered on %U\n"= ;)))
>>
>> I would like to then load the template files in org-templates.=C2= =A0 That
>> way, when a project ends, I can just yank the templates.=C2=A0 I h= ave
>> experimentally tried using add-to-list with org-capture-templates<= br> >> without success.=C2=A0 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
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(file+headline
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (concat org-directory "/WorkPro= j1.org")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Tasks")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"* TODO %?")
>=C2=A0 =C2=A0 =C2=A0 =C2=A0org-capture-templates)
> #v-
>
> --
> Marco Wahl
> GPG: 0x49010A040A3AE6F2
>
>
--001a1141a2a2dfa55605217910b2--