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

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

[elpa] externals/denote 93971de099 3/6: fix: denote-get-path-by-id to se


From: ELPA Syncer
Subject: [elpa] externals/denote 93971de099 3/6: fix: denote-get-path-by-id to send only denote notes file
Date: Mon, 21 Nov 2022 22:57:31 -0500 (EST)

branch: externals/denote
commit 93971de099246f3fcb76f85c9f95eab4326fdca3
Author: Noboru Ota <me@nobiot.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>

    fix: denote-get-path-by-id to send only denote notes file
    
    Currently this function returns any file that starts with the identifier
    passed into it.  There are cases where contain derivative files that
    have the same name sans extetion as the note (e.g. exported HTML file
    for the note, etc.).  Now the patch changes the function to check
    against these cases and returns only denote notes file.
---
 denote.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 9f9e2932b5..4ed7e24e69 100644
--- a/denote.el
+++ b/denote.el
@@ -697,7 +697,11 @@ whatever matches `denote-excluded-directories-regexp'."
   "Return absolute path of ID string in `denote-directory-files'."
   (seq-find
    (lambda (f)
-     (string-prefix-p id (file-name-nondirectory f)))
+     (and (string-prefix-p id (file-name-nondirectory f))
+          ;; The directory can contain exported html and other
+          ;; derivative files that have the same name sans extetion as
+          ;; the note.
+          (denote-file-is-note-p f)))
    (denote-directory-files)))
 
 (define-obsolete-function-alias



reply via email to

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