[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 2ac68a135b 1/4: Implement denote-prompt-for-date
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 2ac68a135b 1/4: Implement denote-prompt-for-date-return-id |
Date: |
Sat, 8 Oct 2022 08:57:31 -0400 (EDT) |
branch: externals/denote
commit 2ac68a135b818aae35437d3d70d3fe6daf2757f1
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Implement denote-prompt-for-date-return-id
This is a function that might prove useful elsewhere in denote.el or
for users that want to extend Denote.
---
README.org | 7 +++++++
denote.el | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/README.org b/README.org
index a9cf11fe77..8ea1e03100 100644
--- a/README.org
+++ b/README.org
@@ -2505,6 +2505,13 @@ might change them without further notice.
~denote-date-prompt-use-org-read-date~ is non-nil. It requires Org
([[#h:e7ef08d6-af1b-4ab3-bb00-494a653e6d63][The
denote-date-prompt-use-org-read-date option]]).
+[ The ~denote-prompt-for-date-return-id~ is part of
+ {{{development-version}}}. ]
+
+#+findex: denote-prompt-for-date-return-id
++ Function ~denote-prompt-for-date-return-id~ :: Use
+ ~denote-date-prompt~ and return it as ~denote-id-format~.
+
#+findex: denote-template-prompt
+ Function ~denote-template-prompt~ :: Prompt for template key in
~denote-templates~ and return its value.
diff --git a/denote.el b/denote.el
index 2028c2e90d..2e1e51977b 100644
--- a/denote.el
+++ b/denote.el
@@ -1412,6 +1412,12 @@ Use Org's more advanced date selection utility if the
user option
'denote-date-prompt
"1.0.0")
+(defun denote-prompt-for-date-return-id ()
+ "Use `denote-date-prompt' and return it as `denote-id-format'."
+ (format-time-string
+ denote-id-format
+ (denote--valid-date (denote-date-prompt))))
+
(defvar denote--subdir-history nil
"Minibuffer history of `denote-subdirectory-prompt'.")