emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Limited #+INCLUDE ?


From: Mark Elston
Subject: Re: [Orgmode] Re: Limited #+INCLUDE ?
Date: Mon, 26 Apr 2010 17:34:50 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

On 4/26/2010 12:40 PM, Dan Davison wrote:

I'm considering investigating the following and would appreciate
comments on this idea. The aim is to make it easier to use Org-mode to
work pure code files which are *external to Org-mode* (i.e. this
proposal lies outside of the current org-babel tangling framework).

- Extend Org file links to allow links to a range of lines in a
   file. The syntax could be
   [[file:/path/to/file::from::to][linkname]]

- These links will bring up a buffer visiting the target file, narrowed
   to the target region.

- The link back in the Org-mode file can be adjusted from the target
   file, by widening and then narrowing again. (During this procedure the
   target region would be highlighted.)

- Export to HTML and LaTeX will have the ability to include the target
   regions, fontified according to the appropriate major-mode, similar to
   how begin_src blocks behave on export.

- 'from' and 'to' could be line numbers, or regexps for text search.

For programmers, this would allow a sort of org-mode mediated literate
programming in projects where it is not feasible/desirable to actually
include the source code in the org-mode file.

Any comments or suggestions?

Dan

Dan,

The use of line numbers seems a little error prone since line numbers
can change dramatically by simply editing the file.  If you edit one
section of a file, even if you update the line numbers for that
section, you will need to search out all the *other* links to sections
in that file and update them as well as they will become stale.  And,
since it will be possible to have multiple org files with links into a
single source file, this will be a *very* difficult thing to manage.

Your idea about regexps sounds promising, though.  You could define
'markers' in comments delimiting the relevant sections of code and
org could search these out easily enough.

Mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]