From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ihor Radchenko Subject: Re: Searching all attachments in org-files Date: Tue, 26 Dec 2017 08:06:38 +0800 Message-ID: <877eta2vzl.fsf@yantar92-laptop.i-did-not-set--mail-host-address--so-tickle-me> References: <87vagua8vm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eTcmJ-0005Fl-2J for emacs-orgmode@gnu.org; Mon, 25 Dec 2017 19:07:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eTcmF-00024g-2b for emacs-orgmode@gnu.org; Mon, 25 Dec 2017 19:07:31 -0500 Received: from mail-pl0-x22c.google.com ([2607:f8b0:400e:c01::22c]:37176) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eTcmE-000244-RP for emacs-orgmode@gnu.org; Mon, 25 Dec 2017 19:07:26 -0500 Received: by mail-pl0-x22c.google.com with SMTP id s3so17100243plp.4 for ; Mon, 25 Dec 2017 16:07:26 -0800 (PST) In-Reply-To: <87vagua8vm.fsf@gmail.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" To: Narendra Joshi , emacs-orgmode --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Dear Narendra, Here is what I am using: (defun org-att-complete-link (&optional arg) "Completion dispatcher for att: links (rewritten from org-attach-open)" (let* ((attach-dir (org-attach-dir t)) (files (org-attach-file-list attach-dir)) (file (if (=3D (length files) 1) (car files) (completing-read "att: " (mapcar #'list files) nil t))) (path (expand-file-name file attach-dir))) (concat "att:" file))) (add-to-list 'org-link-abbrev-alist '("att" . org-attach-expand-link)) (org-link-set-parameters "att" :complete 'org-att-complete-link) Regards, Ihor Narendra Joshi writes: > Hi, > > Is there a way to quick get a link to an existing attachment? A lot of > times, I find myself referring to the same file. I like to keep files as > attachments so that they are committed with my org-files. Any help here, > either in fixing my workflow or helping me figure out how to get a link > to an existing file that is attached to an org-heading, would be greatly > appreciated. > > Thanks, > --=20 > Narendra Joshi > =2D-=20 Ihor Radchenko, PhD Student Singapore University of Technology and Design, 8 Somapah Road Singapore 487372 Email: yantar92@gmail.com, ihor_radchenko@mymail.sutd.edu.sg Tel: +6584017977 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEERZAHPFbUe3JemmzmZHB2Kn2hHYsFAlpBko4ACgkQZHB2Kn2h HYu8nAgAgZ7veowdG9lLhOdK83sjrEcWrnHSD2lfU2/MOTkQOfLBGxwaTBCAh2VB e18junjw0u5ViosGLfcroUwv1yko9bwTqrxV+pxPaPQWMI+ok1Y5NFsM+sFBl7lq TL/UafdpIwT6x+zL8hj+IhTntJjRoJ70pRWn6hlGB48z7idflG2tVibauuVKbotW FqdNwnpSAuCtSp8bxFPuq8quE6N7ITJesGfFXdMyKfBMungJINd4zwidrHSG4Mf9 MKHZjPodcHQ+fItdV2P5biYGf4ZzfegY5Iq1Wk6dHOrYM/rEiZbmqft4ZUQWqlDH yFYiwUawRUcMFi+caBJp7hBjl0Qb/g== =jQQT -----END PGP SIGNATURE----- --=-=-=--