From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: Re: Limited #+INCLUDE ? Date: Mon, 26 Apr 2010 22:19:18 -0400 Message-ID: <8739yh7i3d.fsf@stats.ox.ac.uk> References: <874oj2v2a6.fsf@tandberg.com> <87k4ruy5pd.fsf@mundaneum.com> <87eii26lzg.fsf@stats.ox.ac.uk> <4BD6312A.5090108@comcast.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6aOX-0007gW-JF for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 22:19:29 -0400 Received: from [140.186.70.92] (port=51890 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6aOU-0007gO-94 for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 22:19:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6aOS-0004Vf-Jj for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 22:19:26 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:39969) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6aOS-0004VV-CT for emacs-orgmode@gnu.org; Mon, 26 Apr 2010 22:19:24 -0400 In-Reply-To: <4BD6312A.5090108@comcast.net> (Mark Elston's message of "Mon, 26 Apr 2010 17:34:50 -0700") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Mark Elston Cc: emacs-orgmode@gnu.org Mark Elston writes: > 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. Hi Mark, > > Your idea about regexps sounds promising, though. My current thought is that Emacs bookmarks might be the technology to use here. They seem to be designed for this task (saving a reference to a location in a file which is robust to mild file alteration), they are almost 20 years old, and there is already org-bookmarks.el in contrib by Tokuya Kameshima[1]. (info "(emacs) Bookmarks") > You could define > 'markers' in comments delimiting the relevant sections of code and > org could search these out easily enough. My hope was to avoid forcing the target files to receive extra Org-related content. E.g. suppose that the target files are a collaborative project involving non-Org users that is under version control; one wouldn't want to commit those special tags, and one wouldn't particularly want to have to filter them out them when making commits. Dan [1] I haven't looked into this properly, but to avoid staleness one possibility would be to modify Tokuya's links to actually include the lisp form defining the bookmark (i.e. the entry in bookmark-alist) in the non-visible portion of the link (?). My proposed range links would employ two bookmarks. > > Mark > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode