[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote eff882fb09 4/6: Add file-type parameter to denot
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote eff882fb09 4/6: Add file-type parameter to denote--add-front-matter |
Date: |
Fri, 12 Aug 2022 23:57:30 -0400 (EDT) |
branch: externals/denote
commit eff882fb09b8706ec73cb6958aa53d6c6e9f04e7
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Add file-type parameter to denote--add-front-matter
---
denote.el | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/denote.el b/denote.el
index 31547eb157..614a6d0c94 100644
--- a/denote.el
+++ b/denote.el
@@ -1150,15 +1150,14 @@ Update Dired buffers if the file is renamed."
(rename-file old-name new-name nil)
(denote--rename-buffer old-name new-name)))
-(defun denote--add-front-matter (file title keywords id)
+(defun denote--add-front-matter (file title keywords id file-type)
"Prepend front matter to FILE if `denote--only-note-p'.
-The TITLE, KEYWORDS and ID are passed from the renaming
-command and are used to construct a new front matter block if
-appropriate."
+The TITLE, KEYWORDS ID, and FILE-TYPE are passed from the
+renaming command and are used to construct a new front matter
+block if appropriate."
(when-let* (((denote--only-note-p file))
- (filetype (denote--filetype-heuristics file))
- (date (denote--date (date-to-time id) filetype))
- (new-front-matter (denote--format-front-matter title date
keywords id filetype)))
+ (date (denote--date (date-to-time id) file-type))
+ (new-front-matter (denote--format-front-matter title date
keywords id file-type)))
(with-current-buffer (find-file-noselect file)
(goto-char (point-min))
(insert new-front-matter))))
@@ -1346,7 +1345,7 @@ files)."
(denote-update-dired-buffers)
(if (denote--edit-front-matter-p new-name file-type)
(denote--rewrite-front-matter new-name title keywords file-type)
- (denote--add-front-matter new-name title keywords id)))))
+ (denote--add-front-matter new-name title keywords id file-type)))))
(define-obsolete-function-alias
'denote-dired-rename-file-and-add-front-matter
@@ -1408,7 +1407,7 @@ The operation does the following:
(denote--rename-file file new-name)
(if (denote--edit-front-matter-p new-name file-type)
(denote--rewrite-keywords new-name keywords file-type)
- (denote--add-front-matter new-name title keywords id))))
+ (denote--add-front-matter new-name title keywords id
file-type))))
(revert-buffer))
(user-error "No marked files; aborting")))
@@ -1533,7 +1532,8 @@ relevant front matter."
(buffer-file-name)
(denote--title-prompt)
(denote--keywords-prompt)))
- (denote--add-front-matter file title keywords (denote--file-name-id file)))
+ (denote--add-front-matter file title keywords (denote--file-name-id file)
+ (denote--filetype-heuristics file)))
;;;; The Denote faces
- [elpa] externals/denote updated (16e67cba93 -> 75cbaaf3a1), ELPA Syncer, 2022/08/12
- [elpa] externals/denote eff882fb09 4/6: Add file-type parameter to denote--add-front-matter,
ELPA Syncer <=
- [elpa] externals/denote fe4bd822fd 5/6: Remove the optional key parameter from denote--retrieve-search and related functions, ELPA Syncer, 2022/08/12
- [elpa] externals/denote dbe003bae7 3/6: Use with-temp-buffer instead of with-current-buffer in denote--regexp-in-file-p, ELPA Syncer, 2022/08/12
- [elpa] externals/denote 061c7013eb 2/6: Add denote--title-key-regexp and denote--keywords-key-regexp functions and use them, ELPA Syncer, 2022/08/12
- [elpa] externals/denote 75cbaaf3a1 6/6: Merge pull request #88 from jeanphilippegg/cleanup, ELPA Syncer, 2022/08/12
- [elpa] externals/denote aeb8905128 1/6: Remove some unused variables and functions, ELPA Syncer, 2022/08/12