diff options
author | jao <jao@gnu.org> | 2023-11-11 23:08:58 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2023-11-11 23:08:58 +0000 |
commit | 1843941d9eabbcf33dddbc41ddbe60c4001fb865 (patch) | |
tree | a3628451b6d16fb19d0ecaa9483f8719182c5502 | |
parent | f310c663766eea4b76837e929a1fa3d2766f4029 (diff) | |
download | elibs-1843941d9eabbcf33dddbc41ddbe60c4001fb865.tar.gz elibs-1843941d9eabbcf33dddbc41ddbe60c4001fb865.tar.bz2 |
embark link: simpler detection of org links
-rw-r--r-- | custom/jao-custom-completion.el | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/custom/jao-custom-completion.el b/custom/jao-custom-completion.el index 0151de5..235161c 100644 --- a/custom/jao-custom-completion.el +++ b/custom/jao-custom-completion.el @@ -257,11 +257,8 @@ (defun jao-embark-targets--org-link () (when (derived-mode-p 'org-mode) - (when (org-in-regexp org-link-bracket-re) - (let ((lnk (match-string-no-properties 1))) - (if (string-match-p "https?://.+" (or lnk "")) - (cons 'url lnk) - (cons 'org-link (match-string-no-properties 0))))))) + (let ((lnk (org-element-property :raw-link (org-element-context)))) + (and lnk (cons 'org-link lnk))))) (defun jao-embark-targets--gl-org-link () (when (org-in-regexp org-link-bracket-re) |