From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Improved way to include some headlines from an external org file Date: Wed, 01 Oct 2014 01:10:54 +0200 Message-ID: <87a95giu0x.fsf@gmx.us> References: <5411B08D.30209@gmail.com> <8438bxoedh.fsf@gmail.com> <5414111A.1030502@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ6Za-0000bO-OU for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 19:11:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ6ZV-0002g1-Dk for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 19:11:10 -0400 Received: from plane.gmane.org ([80.91.229.3]:36899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ6ZV-0002fj-76 for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 19:11:05 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XZ6ZU-0004wR-58 for emacs-orgmode@gnu.org; Wed, 01 Oct 2014 01:11:04 +0200 Received: from 217.130.110.20 ([217.130.110.20]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Oct 2014 01:11:04 +0200 Received: from rasmus by 217.130.110.20 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 01 Oct 2014 01:11:04 +0200 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 Hi Xavier, Xavier Garrido writes: > Le 12/09/2014 02:45, Andrea Rossetti a écrit : >> Xavier Garrido writes: >>> Of course, I can achieve that by using =:lines= and calculating how many >>> lines embeds the given headline. >> >> Hi Xavier, another possible approach (maybe less handy, but in >> some cases it might fit): the user could keep one .org file >> per headline, and #+INCLUDE one headline (= one entire file) >> when needed. >> > > This is something I use when dealing with a book or report with > basically one big file per chapter. Here the problem is slightly > different : I have 4 org/Beamer presentations that almost 80% of them > are the same. So instead of maintening this 80% in 4 different places, > I'd like to write them and change them in one place and then include > the needed headlines at the right place in each of the 4 > presentations. > > I know this can't be done with #+INCLUDE maybe with a nice babel > function or a bit of elisp. So maybe someone already did > that. Otherwise this may be a nice addition for further release of org > ;) You could test the patch here: http://permalink.gmane.org/gmane.emacs.orgmode/91307 I think it introduces something close to what you are looking for. > #+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 You'd be able to do * first chapter Note how we're renaming /first base chapter/ on the fly. * In this book /first base chapter/ is my second chapter #+INCLUDE: "./base.org::*First base chapter" :only-contents t Of course, you can also include other named objects such as tables and probably code blocks. —Rasmus -- Hvor meget poesi tror De kommer ud af et glas isvand?