emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Rasmus <rasmus@gmx.us>
Cc: emacs-orgmode@gnu.org
Subject: Re: [ox, patch] Quickly INCLUDE from own file
Date: Tue, 07 Oct 2014 16:02:29 +0200	[thread overview]
Message-ID: <87oato2d1m.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <871tqk8bf8.fsf@gmx.us> (rasmus@gmx.us's message of "Tue, 07 Oct 2014 11:40:59 +0200")

Hello,

Rasmus <rasmus@gmx.us> 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

      reply	other threads:[~2014-10-07 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07  9:40 [ox, patch] Quickly INCLUDE from own file Rasmus
2014-10-07 14:02 ` Nicolas Goaziou [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oato2d1m.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=rasmus@gmx.us \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).