mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
Define :help-echo function for Org links
Thanks to Julian Hoch for asking about this. It was done via a private channel and I am sharing the information with permission.
This commit is contained in:
parent
d5cf6222d5
commit
23bc9dbca3
|
|
@ -4942,6 +4942,14 @@ backend."
|
|||
((eq format 'md) (format "[%s](%s)" desc path))
|
||||
(t path))))
|
||||
|
||||
(defun denote-link-ol-help-echo (_window _object position)
|
||||
"Echo the full file path of the identifier at POSITION."
|
||||
(when-let ((htmlize-link (get-text-property position 'htmlize-link))
|
||||
(string (plist-get htmlize-link :uri))
|
||||
(identifier (replace-regexp-in-string "denote:\\(.*?\\)\\(#.*\\)?" "\\1" string))
|
||||
(path (denote-get-path-by-id identifier)))
|
||||
path))
|
||||
|
||||
;; The `eval-after-load' part with the quoted lambda is adapted from
|
||||
;; Elfeed: <https://github.com/skeeto/elfeed/>.
|
||||
|
||||
|
|
@ -4957,6 +4965,7 @@ backend."
|
|||
"denote"
|
||||
:follow #'denote-link-ol-follow
|
||||
:face 'denote-faces-link
|
||||
:help-echo #'denote-link-ol-help-echo
|
||||
:complete #'denote-link-ol-complete
|
||||
:store #'denote-link-ol-store
|
||||
:export #'denote-link-ol-export)))))
|
||||
|
|
|
|||
Loading…
Reference in a new issue