From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Insert a heading in every sibling Date: Tue, 29 Oct 2013 15:01:27 -0400 Message-ID: References: <20131028071319.45bb0a26@aga-netbook> <868uxd6ao5.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec520f305fefffb04e9e5d756 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbEXj-00036R-OY for emacs-orgmode@gnu.org; Tue, 29 Oct 2013 15:01:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VbEXi-0003xf-0c for emacs-orgmode@gnu.org; Tue, 29 Oct 2013 15:01:31 -0400 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]:50678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VbEXh-0003xS-Ko for emacs-orgmode@gnu.org; Tue, 29 Oct 2013 15:01:29 -0400 Received: by mail-pd0-f172.google.com with SMTP id w10so258851pde.31 for ; Tue, 29 Oct 2013 12:01:27 -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: Scot Becker Cc: Sebastien Vauban , Org-mode ml --bcaec520f305fefffb04e9e5d756 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I worked out some emacs-lisp code that does some of what you want. It was a little tricky though to avoid some strange recursion loops. See this post: http://jkitchin.github.io/blog/2013/10/29/Add-subheadings-to-all-headings-i= n-an-org-file-at-some-level/ j John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Mon, Oct 28, 2013 at 12:08 PM, Scot Becker wrote= : > Thanks, Seb and Marcin. I didn't know about cloning. That will do for > those parts of the tree that I know about before I start filling in the > data. For afterwards, which is more the case I'm thinking about, I'll ai= m > to write an Elisp function using org-insert-subheading. That sample macr= o > gives me something to go on. I'll experiment with keyboard macros, too, > which might be fine for this application. > > Thx. > > > > On Mon, Oct 28, 2013 at 1:51 PM, Sebastien Vauban > wrote: > >> Marcin Borkowski wrote: >> > Scot Becker napisa=C5=82(a): >> > >> >> I'm using org-mode to keep track of student grades. How can I easily >> >> add a bunch of identical headings at a certain level in my tree? >> >> Specifically,I have a L2 heading for each student, and I want to put >> >> a node (heading, with some properties) under each L2 student heading >> >> for that class. >> > >> > Personally, I'd just write a small Elisp function to do that. (It's >> > easier than you might think - even I could do that;).) Here's a thing >> > that is (remotely) similar: >> > >> http://mbork.pl/2013-09-23_Automatic_insertion_of_habit_templates_%28en%= 29 >> > >> > Or, you could record a keyboard macro, and even save it as Elisp. >> >> Other solutions include: >> >> - using YASnippets, or >> >> - writing a skeleton in the Org document and cloning it N times at once >> (see >> C-c C-x c). >> >> Best regards, >> Seb >> >> -- >> Sebastien Vauban >> >> >> > --bcaec520f305fefffb04e9e5d756 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I worked out some emacs-lisp code that does some= of what you want. It was a little tricky though to avoid some strange recu= rsion loops. See this post:

http://jkitchin.github.io/blog/2013/10/29/Add-subheadings-to-all-he= adings-in-an-org-file-at-some-level/

j

John=

-----------------------------------
John Kitchin
Associate Pr= ofessor
Doherty Hall A207F
Department of Chemical Engineering
Carn= egie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu

<= /div>

On Mon, Oct 28, 2013 at 12:08 PM, Scot B= ecker <scot.becker@gmail.com> wrote:
Thanks, =C2=A0Seb and Marcin. =C2=A0I didn't know abou= t cloning. =C2=A0That will do for those parts of the tree that I know about= before I start filling in the data. =C2=A0For afterwards, which is more th= e case I'm thinking about, I'll aim to write an Elisp function usin= g org-insert-subheading. =C2=A0That sample macro gives me something to go o= n. I'll experiment with keyboard macros, too, which might be fine for t= his application.

Thx.
=C2=A0


= On Mon, Oct 28, 2013 at 1:51 PM, Sebastien Vauban <sva-news@mygoogle= st.com> wrote:
Marcin Borkowski wrote:
> Scot Becker <scot.becker@gmail.com> napisa=C5=82(a):
>
>> I'm using org-mode to keep track of student grades. =C2=A0How = can I easily
>> add a bunch of identical headings at a certain level in my tree? >> Specifically,I have a L2 heading for each student, and I want to p= ut
>> a node (heading, with some properties) under each L2 student headi= ng
>> for that class.
>
> Personally, I'd just write a small Elisp function to do that. =C2= =A0(It's
> easier than you might think - even I could do that;).) =C2=A0Here'= s a thing
> that is (remotely) similar:
> http://mbork.pl/2013-09-23_Automatic_ins= ertion_of_habit_templates_%28en%29
>
> Or, you could record a keyboard macro, and even save it as Elisp.

Other solutions include:

- using YASnippets, or

- writing a skeleton in the Org document and cloning it N times at once (se= e
=C2=A0 C-c C-x c).

Best regards,
=C2=A0 Seb

--
Sebastien Vauban




--bcaec520f305fefffb04e9e5d756--