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

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

[elpa] externals/denote a5120e0e93 061/355: Enable optional EXTENSION in


From: ELPA Syncer
Subject: [elpa] externals/denote a5120e0e93 061/355: Enable optional EXTENSION in file name creation
Date: Sun, 26 Jun 2022 23:58:00 -0400 (EDT)

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

    Enable optional EXTENSION in file name creation
---
 denote.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/denote.el b/denote.el
index ab2ad8add8..f4451ffd5a 100644
--- a/denote.el
+++ b/denote.el
@@ -272,14 +272,18 @@ output is sorted with `string-lessp'."
 
 ;;;; New note
 
-(defun denote--format-file (path id keywords slug)
+(defun denote--format-file (path id keywords slug &optional extension)
   "Format file name.
 PATH, ID, KEYWORDS, SLUG are expected to be supplied by `denote'
-or equivalent: they will all be converted into a single string."
+or equivalent: they will all be converted into a single string.
+
+Optional EXTENSION is the file type extension.  Use .org if none
+is specified."
   (let ((kws (if denote-infer-keywords
                  (denote--keywords-combine keywords)
-               keywords)))
-    (format "%s%s--%s--%s.org" path id kws slug)))
+               keywords))
+        (ext (or extension ".org")))
+    (format "%s%s--%s--%s%s" path id kws slug ext)))
 
 (defun denote--file-meta-header (title date keywords filename id)
   "Front matter for new notes.



reply via email to

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