From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aankhen Subject: Re: org-attach link proposal Date: Fri, 1 Apr 2011 18:07:51 +0530 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=53465 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5dcD-00051y-BK for emacs-orgmode@gnu.org; Fri, 01 Apr 2011 08:38:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5dcB-0000vN-Tp for emacs-orgmode@gnu.org; Fri, 01 Apr 2011 08:38:13 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:51920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5dcB-0000uu-Ou for emacs-orgmode@gnu.org; Fri, 01 Apr 2011 08:38:11 -0400 Received: by vws4 with SMTP id 4so3424573vws.0 for ; Fri, 01 Apr 2011 05:38:11 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Juraj Kubelka , Org-mode ml Hi Juraj, On Fri, Apr 1, 2011 at 16:32, Juraj Kubelka wrote= : > I played a bit with org-attach. It is great package! Thanks for it! :) > I have one proposal. So at first why: > I would like to do something like this: > * Project documents > =C2=A0=C2=A0:PROPERTIES: > =C2=A0=C2=A0:Attachments: first.doc second.doc third.doc > =C2=A0=C2=A0:ID: =C2=A0 =C2=A0 =C2=A0 37773ace-b471-4003-a8d1-448e7c48f77= b > =C2=A0=C2=A0:END: > =C2=A0=C2=A0+ the first document about something1 [[att:first.doc]] > =C2=A0=C2=A0+ the second document =C2=A0[[att:second.doc]] > =C2=A0=C2=A0+ the third document [[att:third.doc]] > in order to easily access it just by click on related link. > So I defined method: > (defun org-attach-open-link (file &optional in-emacs) > =C2=A0=C2=A0(org-open-file (expand-file-name file (org-attach-dir t)) in-= emacs)) > and link: > #+LINK: att elisp:(org-attach-open-link "%s") > and it works. but always asks if I want to execute elisp code. > Would it be possible to integrate it directly to org-mode like http: and > others? I am not sure how to do it. I believe this should be possible using a bit of Elisp: ,---- | (org-add-link-type "att" 'org-attach-open-link) | | (defun org-attach-open-link (file &optional in-emacs) | (org-open-file (expand-file-name file (org-attach-dir t)) in-emacs)) `---- Put that in your init file, or wherever you place your customizations. You can read more about adding new hyperlink types in the manual.[1] By the way, the function is only passed a single argument (the text of the link); =E2=80=98in-emacs=E2=80=99 will always be =E2=80=98nil=E2=80=99,= unless you=E2=80=99re also calling it programmatically elsewhere. Aankhen [1]: http://orgmode.org/org.html#Adding-hyperlink-types