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

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

[elpa] externals/denote b996b7e6f0 02/20: Refactor denote-add-front-matt


From: ELPA Syncer
Subject: [elpa] externals/denote b996b7e6f0 02/20: Refactor denote-add-front-matter
Date: Wed, 20 Dec 2023 03:58:00 -0500 (EST)

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

    Refactor denote-add-front-matter
---
 denote.el | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/denote.el b/denote.el
index 838558047b..3c03395908 100644
--- a/denote.el
+++ b/denote.el
@@ -2719,12 +2719,10 @@ relevant front matter."
     (buffer-file-name)
     (denote-title-prompt)
     (denote-keywords-prompt)))
-  (when (and (denote-file-is-writable-and-supported-p file)
-             (denote-file-has-identifier-p file))
-    (denote--add-front-matter
-     file title keywords
-     (denote-retrieve-filename-identifier file)
-     (denote-filetype-heuristics file))))
+  (when-let ((denote-file-is-writable-and-supported-p file)
+             (id (denote-retrieve-filename-identifier file :no-error))
+             (file-type (denote-filetype-heuristics file)))
+    (denote--add-front-matter file title keywords id file-type)))
 
 (define-obsolete-function-alias
   'denote-change-file-type



reply via email to

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