emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <r.m.krug@gmail.com>
To: Yuri Niyazov <yuri.niyazov@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Creating a link to a file using ID
Date: Fri, 24 Apr 2015 08:48:29 +0200	[thread overview]
Message-ID: <E4056E81-1560-45B5-A9A4-352896A0AC73@gmail.com> (raw)
In-Reply-To: <CACbjG0uFXnvPXnT6ftv1+08Hau04iGiGi4VTJWWeWs=Q0=JzeQ@mail.gmail.com>



Envoyé de mon iPhone

> Le 24 avr. 2015 à 00:10, Yuri Niyazov <yuri.niyazov@gmail.com> a écrit :
> 
> 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 renaming of the external file which is done outside emacs. 

Nevertheless, there are ways of achieving this, which depend on the OS you are 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. 

Other option: use a custom function to identify the file based on the ID by using e.g. grep on a the directory where you expect the file to be. 

But I don' think this can easily be done. 

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
> 
> 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!
> 

      reply	other threads:[~2015-04-24  6:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-23 22:10 Creating a link to a file using ID Yuri Niyazov
2015-04-24  6:48 ` Rainer M Krug [this message]

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=E4056E81-1560-45B5-A9A4-352896A0AC73@gmail.com \
    --to=r.m.krug@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yuri.niyazov@gmail.com \
    /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).