From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Elston Subject: Re: Re: Limited #+INCLUDE ? Date: Tue, 27 Apr 2010 17:52:48 -0700 Message-ID: <4BD786E0.8070000@comcast.net> References: <874oj2v2a6.fsf@tandberg.com> <87k4ruy5pd.fsf@mundaneum.com> <87eii26lzg.fsf@stats.ox.ac.uk> <4BD6312A.5090108@comcast.net> <8739yh7i3d.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6vWU-0007h0-4s for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 20:53:06 -0400 Received: from [140.186.70.92] (port=43971 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6vWS-0007gn-Vs for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 20:53:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6vWR-000232-HJ for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 20:53:04 -0400 Received: from qmta14.westchester.pa.mail.comcast.net ([76.96.59.212]:42599) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6vWR-00022t-Db for emacs-orgmode@gnu.org; Tue, 27 Apr 2010 20:53:03 -0400 In-Reply-To: <8739yh7i3d.fsf@stats.ox.ac.uk> 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: emacs-orgmode@gnu.org On 4/26/2010 7:19 PM, Dan Davison wrote: > Mark Elston writes: >> >> 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]. I haven't tried this so I don't know how resilient it is to changes in the target file. > (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. It's the non-org users that would, of course, be the 'problem', though. They are the ones likely to make non-mild edits and not update links. In a collaborative project you will likely always be trying to keep your links up-to-date without some kind of marker in the code. > 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