emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Mark Elston <m_elston@comcast.net>
To: emacs-orgmode@gnu.org
Subject: Re: Re: Limited #+INCLUDE ?
Date: Tue, 27 Apr 2010 17:52:48 -0700	[thread overview]
Message-ID: <4BD786E0.8070000@comcast.net> (raw)
In-Reply-To: <8739yh7i3d.fsf@stats.ox.ac.uk>

On 4/26/2010 7:19 PM, Dan Davison wrote:
> Mark Elston<m_elston@comcast.net>  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

  reply	other threads:[~2010-04-28  0:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 11:25 Limited #+INCLUDE ? Giles Chamberlin
2010-04-26  8:32 ` Sébastien Vauban
2010-04-26 19:40   ` Dan Davison
2010-04-27  0:34     ` Mark Elston
2010-04-27  2:19       ` Dan Davison
2010-04-28  0:52         ` Mark Elston [this message]
2010-04-27  8:27     ` Eric S Fraga
2010-04-27 10:25       ` Darlan Cavalcante Moreira
2010-04-27 15:12         ` Eric Schulte
2010-04-27 17:26           ` Dan Davison
2010-04-27 17:58             ` Eric Schulte
2010-04-27 18:27             ` Giles Chamberlin
2010-04-27 17:52           ` Samuel Wales
2010-04-27 19:19             ` Dan Davison
2010-04-27 21:56               ` Carsten Dominik
2010-04-29 23:14               ` Samuel Wales

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=4BD786E0.8070000@comcast.net \
    --to=m_elston@comcast.net \
    --cc=emacs-orgmode@gnu.org \
    /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).