emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Feature request: #+INCLUDE: with anchors
@ 2018-01-10 18:30 edgar
  2018-01-11 10:39 ` Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: edgar @ 2018-01-10 18:30 UTC (permalink / raw)
  To: emacs-orgmode

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.

Thanks for the great work!

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Feature request: #+INCLUDE: with anchors
  2018-01-10 18:30 edgar
@ 2018-01-11 10:39 ` Rasmus
  0 siblings, 0 replies; 4+ messages in thread
From: Rasmus @ 2018-01-11 10:39 UTC (permalink / raw)
  To: emacs-orgmode

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ä!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Feature request: #+INCLUDE: with anchors
       [not found] <mailman.77.1515690017.29034.emacs-orgmode@gnu.org>
@ 2018-01-12  7:14 ` edgar
  2018-01-23  8:16   ` Rasmus
  0 siblings, 1 reply; 4+ messages in thread
From: edgar @ 2018-01-12  7:14 UTC (permalink / raw)
  To: emacs-orgmode

> Message: 6
> Date: Thu, 11 Jan 2018 11:39:29 +0100
> From: Rasmus <rasmus@gmx.us>
> To: emacs-orgmode@gnu.org
> Subject: Re: [O] Feature request: #+INCLUDE: with anchors
> Message-ID: <878td4r866.fsf@gmx.us>
> Content-Type: text/plain; charset=utf-8
> 
> What would happen if one of the keywords aren?t unique?

Get the first instance? what happens when a referenced heading, block or 
table is not unique (or doesn't exist)?

> 
> 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?.
> 

Although I was aware of this, I think that what you write is very 
useful, thank you.

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Feature request: #+INCLUDE: with anchors
  2018-01-12  7:14 ` Feature request: #+INCLUDE: with anchors edgar
@ 2018-01-23  8:16   ` Rasmus
  0 siblings, 0 replies; 4+ messages in thread
From: Rasmus @ 2018-01-23  8:16 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: edgar

BTW: For your original request there’s a hack here that might work for
you.  AFAIR it works by updating the lines.

    http://endlessparentheses.com/updating-org-mode-include-statements-on-the-fly.html

At one point I considered adding some sort of regexp delimiters, but I
think including named objects is better in almost all cases.

Rasmus

-- 
Summon the Mothership!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-23  8:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.77.1515690017.29034.emacs-orgmode@gnu.org>
2018-01-12  7:14 ` Feature request: #+INCLUDE: with anchors edgar
2018-01-23  8:16   ` Rasmus
2018-01-10 18:30 edgar
2018-01-11 10:39 ` Rasmus

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).