From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: most robust linking practices? Date: Sun, 19 Jan 2014 15:37:45 -0500 Message-ID: References: <87vbxj36dk.fsf@alphaville.bos.redhat.com> <87eh46391l.fsf@alphaville.bos.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b111dcd62b5b404f058bfd3 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4z7v-0004go-LD for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 15:37:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4z7s-0003Zp-6t for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 15:37:51 -0500 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:42142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4z7r-0003ZU-MV for emacs-orgmode@gnu.org; Sun, 19 Jan 2014 15:37:48 -0500 Received: by mail-pa0-f41.google.com with SMTP id fa1so3857089pad.14 for ; Sun, 19 Jan 2014 12:37:45 -0800 (PST) In-Reply-To: <87eh46391l.fsf@alphaville.bos.redhat.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Dokos Cc: "emacs-orgmode@gnu.org" --047d7b111dcd62b5b404f058bfd3 Content-Type: text/plain; charset=ISO-8859-1 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 wrote: > John Kitchin 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 > > > --047d7b111dcd62b5b404f058bfd3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
thanks for the ideas.

I put t= ogether 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 t= hen construct an org-link relative to that.

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

John

-----------------------------------
J= ohn Kitchin
Associate Professor
Doherty Hall A207F
Department of C= hemical 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 D= okos <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-mod= e (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<= br> > related, and build on each other. but I won't know in advance wher= e
> 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". Fo= r
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:

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

=A0 =A0 package2: /p2/c/bar.or= g

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


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

=A0 =A0 package2: /p2/c/bar.or= g

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
=A0 =A0 =A0 =A0quote :-)

Nick



--047d7b111dcd62b5b404f058bfd3--