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

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

[elpa] externals/denote 465a093893 3/3: Simplify denote--edit-front-matt


From: ELPA Syncer
Subject: [elpa] externals/denote 465a093893 3/3: Simplify denote--edit-front-matter-p
Date: Thu, 11 Aug 2022 01:57:34 -0400 (EDT)

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

    Simplify denote--edit-front-matter-p
    
    The 'denote--writable-and-supported-p' was added in commit 29ed5c3.
---
 denote.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/denote.el b/denote.el
index 1474b33ed6..040d17bc56 100644
--- a/denote.el
+++ b/denote.el
@@ -1171,15 +1171,12 @@ For the purposes of this test, FILE is a Denote note 
when it (i)
 is a regular file, (ii) is writable, (iii) has a supported file
 type extension per `denote-file-type', and (iv) is stored in the
 variable `denote-directory'."
-  (when-let ((ext (file-name-extension file)))
-    (and (file-regular-p file)
-         (file-writable-p file)
-         (not (denote--file-empty-p file))
-         (string-match-p "\\(md\\|org\\|txt\\)\\'" ext)
-         ;; Heuristic to check if this is one of our notes
-         (string-prefix-p (denote-directory) (expand-file-name file))
-         (denote--regexp-in-file-p 
denote--retrieve-title-front-matter-key-regexp file)
-         (denote--regexp-in-file-p 
denote--retrieve-keywords-front-matter-key-regexp file))))
+  (and (denote--writable-and-supported-p file)
+       (not (denote--file-empty-p file))
+       ;; Heuristic to check if this is one of our notes
+       (string-prefix-p (denote-directory) (expand-file-name file)) ; FIXME 
2022-08-11: Why do we need this?
+       (denote--regexp-in-file-p 
denote--retrieve-title-front-matter-key-regexp file)
+       (denote--regexp-in-file-p 
denote--retrieve-keywords-front-matter-key-regexp file)))
 
 (defun denote--rewrite-keywords (file keywords)
   "Rewrite KEYWORDS in FILE outright.



reply via email to

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