From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: Feature request: #+INCLUDE: with anchors Date: Thu, 11 Jan 2018 11:39:29 +0100 Message-ID: <878td4r866.fsf@gmx.us> References: 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]:39949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZaH1-0001zw-6g for emacs-orgmode@gnu.org; Thu, 11 Jan 2018 05:39:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZaGy-0001D4-1i for emacs-orgmode@gnu.org; Thu, 11 Jan 2018 05:39:51 -0500 Received: from [195.159.176.226] (port=44727 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZaGx-0001Ad-Qg for emacs-orgmode@gnu.org; Thu, 11 Jan 2018 05:39:47 -0500 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eZaEr-0005PJ-Oq for emacs-orgmode@gnu.org; Thu, 11 Jan 2018 11:37:37 +0100 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" To: emacs-orgmode@gnu.org edgar@openmail.cc writes: > Hello, > > I have seen this syntax in markdown (one of the many versions): > > !listing > path/to/file.ext > start=ini_keyword end=end_keyword > > Here, ~file.ext~ is a source file, and both ~ini_keyword~ and > ~end_keyword~ are text strings in the text delimiting what should be > included (responsibility of the writer to make sure they are > unique). I think that having something like this in Org would be > nice. I am aware of the ~:lines~ option, but having something like > this would not require an update of the numeric reference every time > the referenced file changes. What would happen if one of the keywords aren’t unique? Something similar can already be done in Org. See this part of the manual: Inclusions may specify a file-link to extract an object matched by org-link-search (see Search options). To extract only the contents of the matched object, set :only-contents property to non-nil. This will omit any planning lines or property drawers. The ranges for :lines keyword are relative to the requested element. Some examples: #+INCLUDE: "./paper.org::#theory" :only-contents t Include the body of the heading with the custom id ‘theory’ #+INCLUDE: "./paper.org::mytable" Include named element. #+INCLUDE: "./paper.org::*conclusion" :lines 1-20 Include the first 20 lines of the headline named ‘conclusion’. Rasmus -- Tack, ni svenska vakttorn. Med plutonium tvingar vi dansken på knä!