Merge pull request #3196 from howsiwei/develop

lang/org: Support option in custom org links
This commit is contained in:
Henrik Lissner 2020-05-24 22:51:47 -04:00 committed by GitHub
commit 121710f779
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,9 +32,12 @@ exist, and `org-link' otherwise."
:follow (lambda (link)
(org-link-open-as-file (expand-file-name link (funcall dir-fn)) nil))
:face (lambda (link)
(if (file-exists-p (expand-file-name link (funcall dir-fn)))
'org-link
'error))
(let* ((path (expand-file-name link (funcall dir-fn)))
(option-index (string-match-p "::\\(.*\\)\\'" path))
(file-name (substring path 0 option-index)))
(if (file-exists-p file-name)
'org-link
'error)))
(doom-plist-delete plist :requires))))