From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Creating a link to a file using ID Date: Fri, 24 Apr 2015 08:48:29 +0200 Message-ID: References: Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlXPh-0008Cu-M6 for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 02:48:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YlXPd-0003Qb-Jk for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 02:48:37 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:33717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YlXPd-0003QR-CO for emacs-orgmode@gnu.org; Fri, 24 Apr 2015 02:48:33 -0400 Received: by wiax7 with SMTP id x7so27964165wia.0 for ; Thu, 23 Apr 2015 23:48:32 -0700 (PDT) In-Reply-To: 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: Yuri Niyazov Cc: "emacs-orgmode@gnu.org" Envoy=C3=A9 de mon iPhone > Le 24 avr. 2015 =C3=A0 00:10, Yuri Niyazov a =C3=A9= crit : >=20 > I would like to link to a whole file (rather than a heading in that > file), but instead of using the path+name, I would like to use an id, > so that it survives renames. I do not think this is easily possible, as I assume you are referring to a r= enaming of the external file which is done outside emacs.=20 Nevertheless, there are ways of achieving this, which depend on the OS you a= re using. For Linux (and OSX) you could create a hardlink to your file. This= hardlink always links to the file, irrespective if you rename your original= file. You could then use the hardlink in your org file.=20 Other option: use a custom function to identify the file based on the ID by u= sing e.g. grep on a the directory where you expect the file to be.=20 But I don' think this can easily be done.=20 Hope this helps, Rainer > Is it possible to assign an ID to the > whole buffer? I tried doing > #+CUSTOM_ID: A948A2E7-F4A0-4F77-8D7A-C6273DA7D734 > and > #+ID: A948A2E7-F4A0-4F77-8D7A-C6273DA7D734 >=20 > but a link to such an ID results in an error when clicked. I am going > to link to a heading in the file instead for now, but it would be nice > to know if this is possible. Thanks! >=20