branch: externals/denote
commit b996b7e6f0204550f9b6480c587a73a95ce0f7d1
Author: Jean-Philippe Gagné Guay <[email protected]>
Commit: Jean-Philippe Gagné Guay <[email protected]>
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