feat(org): introduce doom-executable link type
This commit is contained in:
parent
c26d64c9b9
commit
181540c8b7
2 changed files with 24 additions and 0 deletions
|
@ -230,6 +230,25 @@ exist, and `org-link' otherwise."
|
||||||
"TODO"
|
"TODO"
|
||||||
(doom/describe-package (intern-soft pkg)))
|
(doom/describe-package (intern-soft pkg)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +org-link--doom-executable-link-activate-fn (start end executable _bracketed-p)
|
||||||
|
(when buffer-read-only
|
||||||
|
(let ((found (executable-find executable)))
|
||||||
|
(add-text-properties
|
||||||
|
start end
|
||||||
|
(list 'display
|
||||||
|
(concat
|
||||||
|
(propertize
|
||||||
|
""
|
||||||
|
'rear-nonsticky t
|
||||||
|
'display '(raise -0.02)
|
||||||
|
'face (list :family "all-the-icons"
|
||||||
|
:height 1.0
|
||||||
|
:inherit (if found 'success 'error)))
|
||||||
|
" "
|
||||||
|
(propertize
|
||||||
|
executable
|
||||||
|
'face (if found 'org-verbatim 'default))))))))
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;;; Image data functions (for custom inline images)
|
;;; Image data functions (for custom inline images)
|
||||||
|
|
|
@ -586,6 +586,11 @@ relative to `org-directory', unless it is an absolute path."
|
||||||
:activate-func #'+org-link--doom-module-link-activate-fn
|
:activate-func #'+org-link--doom-module-link-activate-fn
|
||||||
:face #'+org-link--doom-module-link-face-fn
|
:face #'+org-link--doom-module-link-face-fn
|
||||||
:eldoc (-eldoc-fn "Doom module" 'org-priority))
|
:eldoc (-eldoc-fn "Doom module" 'org-priority))
|
||||||
|
(org-link-set-parameters
|
||||||
|
"doom-executable"
|
||||||
|
:activate-func #'+org-link--doom-executable-link-activate-fn
|
||||||
|
;; :help-echo #'doom-docs--help-echo-from-textprop
|
||||||
|
:face 'org-verbatim)
|
||||||
(org-link-set-parameters
|
(org-link-set-parameters
|
||||||
"doom-ref"
|
"doom-ref"
|
||||||
:follow (lambda (link)
|
:follow (lambda (link)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue