branch: externals/denote
commit d58a684f0f86d97fc3c3a56ba1c45d75efd448ab
Author: Protesilaos Stavrou <i...@protesilaos.com>
Commit: Protesilaos Stavrou <i...@protesilaos.com>

    Make denote--get-link-file-path-at-point more robust
---
 denote.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/denote.el b/denote.el
index 42cd419aec..3b93551897 100644
--- a/denote.el
+++ b/denote.el
@@ -6362,13 +6362,13 @@ This is the subroutine of `denote-link-open-at-point' 
and
           (string-match denote-date-identifier-regexp link)
           (match-string-no-properties 0 link)))))
 
-(defun denote--get-link-file-path-at-point (&optional point)
-  "Return link to the Denote file path at point or optional POINT.
+(defun denote--get-link-file-path-at-point ()
+  "Return target file path of the Denote link at point.
 To be used as a `thing-at' provider."
-  (when-let* ((position (or point (point)))
-              (id (get-text-property position 'denote-link-query-part))
-              (path (denote-get-path-by-id id)))
-    (concat "file:" path)))
+  (pcase-let* ((data (denote--link-at-point-get-data (point)))
+               (`(,target . ,_) (car data)))
+    (when-let* ((path (denote-get-path-by-id target)))
+      (concat "file:" path))))
 
 (defvar thing-at-point-provider-alist)
 

Reply via email to