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

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

[elpa] externals/denote ca6aa0d104 5/7: Make filetype parameter mandator


From: ELPA Syncer
Subject: [elpa] externals/denote ca6aa0d104 5/7: Make filetype parameter mandatory in denote--format-front-matter
Date: Wed, 10 Aug 2022 00:57:41 -0400 (EDT)

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

    Make filetype parameter mandatory in denote--format-front-matter
---
 denote.el | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/denote.el b/denote.el
index 4b798fddab..e99a436e0b 100644
--- a/denote.el
+++ b/denote.el
@@ -726,23 +726,21 @@ Make sure to:
 These help with consistency and might prove useful if we ever
 need to operate on the front matter as a whole.")
 
-(defun denote--format-front-matter (title date keywords id &optional filetype)
+(defun denote--format-front-matter (title date keywords id filetype)
   "Front matter for new notes.
 
 TITLE, DATE, KEYWORDS, FILENAME, ID are all strings which are
- provided by `denote'.
-
-Optional FILETYPE is one of the values of `denote-file-type',
-else that variable is used."
+provided by `denote'. FILETYPE is one of the values of
+`denote-file-type'."
   (let ((kw-md (denote--format-front-matter-keywords keywords 'md)))
-    (pcase (or filetype denote-file-type)
+    (pcase filetype
       ('markdown-toml (format denote-toml-front-matter title date kw-md id))
       ('markdown-yaml (format denote-yaml-front-matter title date kw-md id))
       ('text (format denote-text-front-matter title date
                      (denote--format-front-matter-keywords keywords 'text)
                      id denote-text-front-matter-delimiter))
-      (_ (format denote-org-front-matter title date
-                 (denote--format-front-matter-keywords keywords 'org) id)))))
+      ('org (format denote-org-front-matter title date
+                    (denote--format-front-matter-keywords keywords 'org) 
id)))))
 
 (defun denote--path (title keywords &optional dir id)
   "Return path to new file with TITLE and KEYWORDS.
@@ -2169,10 +2167,9 @@ arbitrary text).
 Consult the manual for template samples."
   (let* ((title (denote--title-prompt))
          (keywords (denote--keywords-prompt))
-         (denote-file-type nil) ; we enforce the .org extension for 
`org-capture'
          (front-matter (denote--format-front-matter
                         title (denote--date nil) keywords
-                        (format-time-string denote--id-format nil))))
+                        (format-time-string denote--id-format nil) 'org)))
     (setq denote-last-path (denote--path title keywords))
     (denote--keywords-add-to-history keywords)
     (concat front-matter denote-org-capture-specifiers)))



reply via email to

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