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

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

[elpa] externals/denote 3ca5797934 05/11: Add denote-file-is-in-denote-d


From: ELPA Syncer
Subject: [elpa] externals/denote 3ca5797934 05/11: Add denote-file-is-in-denote-directory-p
Date: Mon, 16 Dec 2024 03:58:29 -0500 (EST)

branch: externals/denote
commit 3ca57979344cd8cf9e9919e1ead1bc65f2ed319c
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>

    Add denote-file-is-in-denote-directory-p
---
 denote.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 7f17136726..3f90e093e0 100644
--- a/denote.el
+++ b/denote.el
@@ -1176,12 +1176,16 @@ extensions are those implied by the variable 
`denote-file-type'."
               (string-suffix-p e file))
             (denote-file-type-extensions-with-encryption)))
 
+(defun denote-file-is-in-denote-directory-p (file)
+  "Return non-nil if FILE is in the variable `denote-directory'."
+  (string-prefix-p (denote-directory) (expand-file-name file)))
+
 (defun denote-filename-is-note-p (filename)
   "Return non-nil if FILENAME is a valid name for a Denote note.
 For our purposes, its path must be part of the variable
 `denote-directory', it must have a Denote identifier in its name, and
 use one of the extensions implied by the variable `denote-file-type'."
-  (and (string-prefix-p (denote-directory) (expand-file-name filename))
+  (and (denote-file-is-in-denote-directory-p filename)
        (denote-file-has-identifier-p filename)
        (denote-file-has-supported-extension-p filename)))
 



reply via email to

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