branch: externals/denote-menu
commit f901a2dba52cc1c764a670411bbf605426ac4039
Author: Mohamed Suliman <[email protected]>
Commit: Mohamed Suliman <[email protected]>

    fix denote get path by id
---
 denote-menu.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/denote-menu.el b/denote-menu.el
index 2b25769cce..21326d3384 100644
--- a/denote-menu.el
+++ b/denote-menu.el
@@ -111,9 +111,17 @@ list entry following the defined form. Then updates the 
buffer."
  presented in the *Denote* buffer."
   (mapcar (lambda (entry)
             (let ((id (car entry)))
-              (denote-get-path-by-id id)))
+              (denote-menu-get-path-by-id id)))
           (funcall tabulated-list-entries)))
 
+(defun denote-menu-get-path-by-id (id)
+  "Return absolute path of ID string in `denote-directory-files'."
+  (seq-find
+   (lambda (f)
+     (and (string-prefix-p id (file-name-nondirectory f))))
+   (denote-directory-files)))
+
+
 (defun denote-menu-files-matching-regexp (files regexp)
   "Return list of files matching REGEXP from FILES."
   (seq-filter (lambda (f) (string-match-p regexp f)) files))

Reply via email to