Hello Bastien, I'm glad to help (even if such a small contribution). The downside of this hack is that it does not work when you export the buffer. If you use the file: link type then the link will works when you export the org buffer, but you have to type the whole path of the attached file. Therefore, there is this trade-off for now.
There is probably a way to make the attach link type also work when exporting the org buffer, but since I don't need this right now I didn't search how to do it. -- Darlan At Thu, 18 Aug 2011 19:33:37 +0200, Bastien <b...@altern.org> wrote: > > Hi Darlan, > > Darlan Cavalcante Moreira <darc...@gmail.com> writes: > > > I requested this some time ago [1]. While there is not a built-in attach > > link type, org provides you with ways to easily create this functionality. > > > > In the setup part in my org-files I put > > #+LINK: attach elisp:(org-open-file (org-attach-expand "%s")) > > > > Now I can use the "attach" link type, but org will ask me if I want to > > allow executing the elisp code. To avoid this you can even set > > org-confirm-elisp-link-function to nil (I don't like this because it allows > > any elisp code in links) or you can set org-confirm-elisp-link-not-regexp > > appropriately. > > > > In my case I use > > : (setq org-confirm-elisp-link-not-regexp "org-open-file") > > > > This works very well. > > This is a nice and useful hack -- I added it to Worg/org-hacks.org. > > Thanks! > > -- > Bastien