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 (= (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 <narendr...@gmail.com> 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,
> -- 
> Narendra Joshi
>

-- 
Ihor Radchenko,
PhD Student
Singapore University of Technology and Design,
8 Somapah Road Singapore 487372
Email: yanta...@gmail.com, ihor_radche...@mymail.sutd.edu.sg
Tel: +6584017977

Attachment: signature.asc
Description: PGP signature

Reply via email to