Fix #2429: replace defunct attach: links w/ download:
Forgot that support for attach: links were removed some time ago, but I still want short org-download links, so I've added 'download:' links.
This commit is contained in:
parent
871201dad6
commit
827225e331
4 changed files with 49 additions and 40 deletions
|
@ -387,21 +387,6 @@ file isn't in `org-directory'."
|
|||
|
||||
|
||||
(defun +org-init-custom-links-h ()
|
||||
(defun +org--relpath (path root)
|
||||
(if (and buffer-file-name (file-in-directory-p buffer-file-name root))
|
||||
(file-relative-name path)
|
||||
path))
|
||||
|
||||
(defun +org-def-link (key dir)
|
||||
(org-link-set-parameters
|
||||
key
|
||||
:complete (lambda () (+org--relpath (+org-link-read-file key dir) dir))
|
||||
:follow (lambda (link) (find-file (expand-file-name link dir)))
|
||||
:face (lambda (link)
|
||||
(if (file-exists-p (expand-file-name link dir))
|
||||
'org-link
|
||||
'error))))
|
||||
|
||||
;; Highlight broken file links
|
||||
(org-link-set-parameters
|
||||
"file"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue