thanks for the ideas.

I put together a new kind of link that takes you to files inside of emacs packages, or to paths relative to where a library is installed.

http://kitchingroup.cheme.cmu.edu/blog/2014/01/19/Making-org-mode-links-to-files-in-Emacs-packages/

basically I find where the library or package is installed, and then construct an org-link relative to that.

from the tests at the post above, it seems to work pretty well!

John

-----------------------------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.cheme.cmu.edu



On Fri, Jan 17, 2014 at 10:47 AM, Nick Dokos <ndokos@gmail.com> wrote:
John Kitchin <jkitchin@andrew.cmu.edu> writes:

> The files are all on a unix file system served over nfs, so everyone
> has the same / root. the users (students) have read access to my
> files.
>
> I am working towards creating "packages" of notes in org-mode (they
> might even be installed as emacs packages) for the courses that I
> teach. Having relative paths within a package certainly makes sense. I
> would like to link to notes in other packages too, as the courses are
> related, and build on each other. but I won't know in advance where
> those get installed. It sounds like those packages will have to have
> some variables configured to make that work out.
>

IIUC, everybody sees the same namespace (students in read-only mode, you
in rw: but /a/b/c/foo.org is the same file for everybody). If that's the
case, then all methods (absolute or relative pathnames and/or ids)
should work, no?

I'd still do relative pathnames for individual "packages". For
interpackage links, you might want to do a sort of double
indirection[fn:1]: for each package, create a directory with a symlink
farm where the symlinks point off-package:

    package1: /p1/c/foo.org contains an org link to file:../farm/bar.org
              /p1/farm/bar.org -> /p2/c/bar.org (-> means symlink)

    package2: /p2/c/bar.org

It should be possible to construct the symlink farms mechanically (and if
not, see [fn:1] :-).) Assuming that the indirections are not too onerous, it
should be possible to arrange things so that installation consists of
setting one symlink in each package:


    package1: /p1/c/foo.org contains an org link to file:../farm/bar.org
              /p1/farm/bar.org -> ./bar/bar.org
              /p1/farm/bar -> /p2/c

    package2: /p2/c/bar.org

Only /p1/farm/bar needs to be adjusted.

Or just go whole-hog with ids (but take good care of the id file: double
and triple backups would not be excessive imo). Since only you can
modify the file, it should work OK.

Footnotes:

[fn:1] http://en.wikipedia.org/wiki/Indirection - the David Wheeler
       quote :-)

Nick