From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [ox, patch] Quickly INCLUDE from own file Date: Tue, 07 Oct 2014 16:02:29 +0200 Message-ID: <87oato2d1m.fsf@nicolasgoaziou.fr> References: <871tqk8bf8.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbVKt-0001iO-1W for emacs-orgmode@gnu.org; Tue, 07 Oct 2014 10:02:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbVKl-000469-0m for emacs-orgmode@gnu.org; Tue, 07 Oct 2014 10:01:54 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:38994) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbVKk-000462-QT for emacs-orgmode@gnu.org; Tue, 07 Oct 2014 10:01:46 -0400 In-Reply-To: <871tqk8bf8.fsf@gmx.us> (rasmus@gmx.us's message of "Tue, 07 Oct 2014 11:40:59 +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: Rasmus Cc: emacs-orgmode@gnu.org Hello, Rasmus writes: > The attached patch allows for "quick" (== without filename) inclusion > from the same file. Why? 'Cause I'm lazy and it would be useful to > push boring, location-specific stuff to the end of the file. > > Here's an example: > > * poor man's ~:ignoreheading:~ > #+INCLUDE: "::*foo" :only-contents t > > #+INCLUDE: "::tbl" > > * foo :noexport: > 1 > > * bar :noexport: > #+NAME: tbl > | 1 | > > You need the preceding "::" to be able tell the difference between the > file "tbl" and the table "tbl". Granted, this doesn't look like an > org link. If that's an issue, for each link sans location it could be > tested if it exists in the current buffer. > > Do you think something like this would be desirable? Including in the same file is dangerous: you can easily duplicate custom-id, name keywords, which are supposed to be unique. Even though we don't prevent it[fn:1], I don't think we should make it easier to achieve. Introducing a new special syntax in this case doesn't sound like a good move either. Regards, [fn:1] Actually, we should have a guard against circular inclusion, but at the moment, it is ineffective in this case. -- Nicolas Goaziou