From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xavier Garrido Subject: Improved way to include some headlines from an external org file Date: Thu, 11 Sep 2014 16:24:13 +0200 Message-ID: <5411B08D.30209@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46680) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5IV-0001VS-Ph for emacs-orgmode@gnu.org; Thu, 11 Sep 2014 10:24:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS5IR-0000SO-9Q for emacs-orgmode@gnu.org; Thu, 11 Sep 2014 10:24:31 -0400 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]:41470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5IR-0000Dn-3I for emacs-orgmode@gnu.org; Thu, 11 Sep 2014 10:24:27 -0400 Received: by mail-wg0-f45.google.com with SMTP id z12so5631320wgg.4 for ; Thu, 11 Sep 2014 07:24:18 -0700 (PDT) Received: from [134.158.89.151] (nb-nemo6.lal.in2p3.fr. [134.158.89.151]) by mx.google.com with ESMTPSA id z8sm6098821wiv.24.2014.09.11.07.24.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Sep 2014 07:24:16 -0700 (PDT) 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: "emacs-orgmode@gnu.org" Dear Orgers, By following discussions on this list, I think I have understood that the inclusion mechanism through =#+INCLUDE= directive is a bit rough and only allows a limited range of use. I know how to include only lines using =:lines= parameter but what I would like to achieve is to only include some headlines from an external org file. Is there a way using babel for example (like this function https://github.com/thesoftwarebin/the-emacs-software-bin/blob/master/include-many-files/include-many-files.org) to write something like that #+BEGIN_SRC org #+INCLUDE: "./base.org" :headline "First base chapter" ,* A more personal chapter #+INCLUDE: "./base.org" :headline "Second base chapter" ,* Another personal chapter #+END_SRC Of course, I can achieve that by using =:lines= and calculating how many lines embeds the given headline. But every time the "First base chapter" length changes I will have to change all the subsequent =#INCLUDE:= commands. I do not know how hard it is to implement this but I think it will be a nice addition (at least one I will use a lot). Thanks for your answer, Xavier