How do I include text between a range of line numbers with #INCLUDE
commit7b399fe128773999c49fe321fe46c9ec27848727
authorPuneeth Chaganti <punchagan@gmail.com>
Sun, 9 Jan 2011 00:28:01 +0000 (9 00:28 +0000)
committerBastien Guerry <bzg@altern.org>
Tue, 18 Jan 2011 00:02:04 +0000 (18 01:02 +0100)
tree4e456a753bb78dcaeb5758b4376749e15c1501cb
parentc7d1e0f997d2aa1043c9cbbf72d03f05195d692e
How do I include text between a range of line numbers with #INCLUDE

Hi Carsten,

On Sat, Jan 8, 2011 at 11:35 PM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
> Hi Puneeth,
>
> can cou please augment the patch with a propert ChangeLog-like entry, and
> with documentation for the manual, and then resubmit?

Here is a patch with a ChangeLog entry and documentation for the
manual. Please tell me if it looks OK. Also, I hope using
git-format-patch is the right way to send this page. If not, what is
the right way?

Thanks,
Puneeth

>From 4a9be5b1a7a19c5d092ed14a86d29ad83122e9a8 Mon Sep 17 00:00:00 2001
From: Puneeth Chaganti <punchagan@gmail.com>
Date: Sun, 9 Jan 2011 00:48:51 +0530
Subject: [PATCH] Include only specified range of line numbers of a file

* doc/org.texi (Include files): Document :lines.
* lisp/org-exp.el (org-export-handle-include-files): Support :lines
property.
(org-get-file-contents): New argument lines to include specify a range
of lines to include.

On Fri, Jan 7, 2011 at 1:29 PM, Puneeth <punchagan@gmail.com> wrote:
> On Fri, Jan 7, 2011 at 10:03 AM, Venkatesh Choppella
> <venkatesh.choppella@iiit.ac.in> wrote:
>> I would like to include a part of a file (between a given range of
>> line numbers) instead of the whole file.  Is there a way to do that
>> in org-mode?
>
> It isn't possible to include files using line numbers, as of now.
> Here's a quick patch that would add this feature.  I have tested it
> with small files and works fine. Can somebody tell me if it looks
> good?
>
> :lines "5-10"  will include the lines from 5 to 10, 10 excluded.
> :lines "-10"  will include the lines from 1 to 10, 10 excluded.
> :lines "5-"  will include the lines from 1 to the end of the file.
>
> HTH,
> Puneeth
doc/org.texi
lisp/org-exp.el