emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/denote 23bc9dbca3 06/10: Define :help-echo function for


From: ELPA Syncer
Subject: [elpa] externals/denote 23bc9dbca3 06/10: Define :help-echo function for Org links
Date: Mon, 9 Sep 2024 03:58:07 -0400 (EDT)

branch: externals/denote
commit 23bc9dbca31c0b0d8d30b691d7bb0ba366834cb1
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    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.
---
 denote.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/denote.el b/denote.el
index 8d0310d2ad..4a91e5c6bb 100644
--- a/denote.el
+++ b/denote.el
@@ -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)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]