From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike McLean Subject: Re: file or headline-local template for new subtree? Date: Tue, 14 Jul 2015 21:27:24 -0400 Message-ID: References: <874ml6mnn4.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113cc16492ab24051adfdc79 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFBUG-0004Mi-S4 for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 21:27:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFBUA-0002c1-K4 for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 21:27:52 -0400 Received: from pb-sasl1.int.icgroup.com ([208.72.237.25]:61380 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFBUA-0002bf-FP for emacs-orgmode@gnu.org; Tue, 14 Jul 2015 21:27:46 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 246D761850 for ; Tue, 14 Jul 2015 21:27:45 -0400 (EDT) Received: from pb-sasl1.int.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 1DC3F6184F for ; Tue, 14 Jul 2015 21:27:45 -0400 (EDT) Received: from mail-ob0-f169.google.com (unknown [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id B25426184D for ; Tue, 14 Jul 2015 21:27:44 -0400 (EDT) Received: by obre1 with SMTP id e1so17291528obr.1 for ; Tue, 14 Jul 2015 18:27:44 -0700 (PDT) In-Reply-To: <874ml6mnn4.fsf@gmx.us> 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: Rasmus Cc: emacs-orgmode --001a113cc16492ab24051adfdc79 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Jul 14, 2015 at 5:31 PM, Rasmus wrote: > Matt Price writes: > > > I have this new system, in which I create a new subtree for every paper= I > > grade. I'd love to have the new subtree automatically populated by a > > mostly-empty table on cration. Is this something I can do on a per-file > > basis; or perhaps even something I can change with every level 1 headin= g? > > I can think of a couple uses for this, actually. > > I'm fond of org-structure-template-alist, but it might not be powerful > enough for what you want here. On a per file basis you could bind some > letter in org-structure-template-alist. ATM it cannot guess how to inser= t > a subtree. But there's org-insert-subheading. > Something I do alot of is have Org Capture templates as files. This lets me write a more complex capture template (in my case for one of several =E2=80=9Croles=E2=80=9D that I take on ad-hoc but recurring basis during me= etings). I call the template with an entry like the following in org-capture-templates. ("Mg" "Grammarian" entry (file+headline "~/Documents/OrgMaster/org/Toastmasters.org" "Miscellaneous and Non-Goal roles 2015") (file "~/.init/emacs/org-capture-templates/grammarian.org_template") :jump-to-captured t :immediate-finish t) In this specific case, it places the entry under a special pre-defined Org heading, but I could always call org-capture with a `C-0' (zero) prefix to insert a template at point. I can edit the template file as things change, and it can be pretty complex (some of my represent Projects: A header, several sub headers as tasks, etc.). --001a113cc16492ab24051adfdc79 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Tue, Jul 14, 2015 at 5:31 PM, Rasmus <rasmus@gmx.us> wrote:
Matt Price <moptop99@gmail.com> writes:

> I have this new system, in which I create a new subtree for every pape= r I
> grade. I'd love to have the new subtree automatically populated by= a
> mostly-empty table on cration. Is this something I can do on a per-fil= e
> basis; or perhaps even something I can change with every level 1 headi= ng?
> I can think of a couple uses for this, actually.

I'm fond of org-structure-template-alist, but it might not be po= werful
enough for what you want here.=C2=A0 On a per file basis you could bind som= e
letter in org-structure-template-alist.=C2=A0 ATM it cannot guess how to in= sert
a subtree.=C2=A0 But there's org-insert-subheading.

Something I do alot of is have Org Capture templates as fi= les. This lets me write a more complex capture template (in my case for one= of several =E2=80=9Croles=E2=80=9D that I take on ad-hoc but recurring bas= is during meetings).

I call the template with an e= ntry like the following in org-capture-templates.

=
("Mg" "Grammarian"
=C2=A0entry
=C2=A0(file+headline "~/Documents/OrgMaster/org/Toastmasters.org= " "Miscellaneous and Non-Goal roles 2015")
=C2=A0(= file "~/.init/emacs/org-capture-templates/grammarian.org_template"= ;)
=C2=A0:jump-to-captured t :immediate-finish t)

In this specific case, it places the entry under a sp= ecial pre-defined Org heading, but I could always call org-capture with a `= C-0' (zero) prefix to insert a template at point.

<= div>I can edit the template file as things change, and it can be pretty com= plex (some of my represent Projects: A header, several sub headers as tasks= , etc.).


--001a113cc16492ab24051adfdc79--