[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote c9d8e0555f 2/5: Merge pull request #173 from kan
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote c9d8e0555f 2/5: Merge pull request #173 from kandread/journal-templates |
Date: |
Mon, 9 Oct 2023 15:58:02 -0400 (EDT) |
branch: externals/denote
commit c9d8e0555f4b5940c6df0e74c5b7ecdea4c4ba2a
Merge: 4fb7c11b83 2fac6ba061
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: GitHub <noreply@github.com>
Merge pull request #173 from kandread/journal-templates
Use templates for creating journal entries
---
denote-journal-extras.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/denote-journal-extras.el b/denote-journal-extras.el
index d6d2c8a3ea..cae5130751 100644
--- a/denote-journal-extras.el
+++ b/denote-journal-extras.el
@@ -105,6 +105,13 @@ journal entry (refer to the `tmr' package on GNU ELPA)."
('day-date-month-year-12h "%A %e %B %Y %I:%M %^p"))))
(t (denote-title-prompt (format-time-string "%F")))))
+(defun denote-journal-extras-template ()
+ "Check for journal template, and return it or prompt the user for one from
`denote-templates'. Otherwise do not use a template, if `denote-templates' is
empty."
+ (if-let ((denote-journal-extras-daily--template (cdr (assoc 'journal
denote-templates))))
+ denote-journal-extras-daily--template
+ (when denote-templates
+ (denote-template-prompt))))
+
;;;###autoload
(defun denote-journal-extras-new-entry ()
"Create a new journal entry in variable `denote-journal-extras-directory'.
@@ -119,7 +126,9 @@ created file."
;; template only if one exists. Otherwise, no template is used.
(denote
(denote-journal-extras-daily--title-format)
- `(,denote-journal-extras-keyword))
+ `(,denote-journal-extras-keyword)
+ nil nil nil
+ (denote-journal-extras-template))
(run-hooks 'denote-journal-extras-hook)))
(defun denote-journal-extras--entry-today ()