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

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

[elpa] externals/denote a0525a0154 216/355: Do not try front matter rewr


From: ELPA Syncer
Subject: [elpa] externals/denote a0525a0154 216/355: Do not try front matter rewrite on non-notes
Date: Sun, 26 Jun 2022 23:58:26 -0400 (EDT)

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

    Do not try front matter rewrite on non-notes
---
 denote-dired.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/denote-dired.el b/denote-dired.el
index e5246ef049..c7942be276 100644
--- a/denote-dired.el
+++ b/denote-dired.el
@@ -214,10 +214,12 @@ The return value is for `denote--file-meta-header'."
   "Rewrite front matter of note after `denote-dired-rename-file'.
 The FILE, TITLE, and KEYWORDS are passed from the renaming
  command and are used to construct a new front matter block."
-  (when (and (file-regular-p file)
-             (file-writable-p file)
-             ;; Heuristic to check if this is one of our notes
-             (string= default-directory (abbreviate-file-name 
(denote-directory))))
+  (when-let ((ext (file-name-extension file))
+             ((and (file-regular-p file)
+                   (file-writable-p file)
+                   (string-match-p "\\(md\\|org\\|txt\\)\\'" ext)
+                   ;; Heuristic to check if this is one of our notes
+                   (string= default-directory (abbreviate-file-name 
(denote-directory))))))
     (let* ((id (denote-retrieve--filename-identifier file))
            (date (denote-retrieve--value-date file))
            (filetype (denote-dired--filetype-heuristics file))



reply via email to

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