[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 2b627aaafd 11/20: Add denote-org-capture-with-pr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 2b627aaafd 11/20: Add denote-org-capture-with-prompts |
Date: |
Wed, 20 Dec 2023 03:58:01 -0500 (EST) |
branch: externals/denote
commit 2b627aaafdb5bd50402e4f87de547b998019bc62
Author: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Commit: Jean-Philippe Gagné Guay <jeanphilippe150@gmail.com>
Add denote-org-capture-with-prompts
---
denote.el | 42 ++++++++++++++++++++++++++++++++++++++----
1 file changed, 38 insertions(+), 4 deletions(-)
diff --git a/denote.el b/denote.el
index 4567f609b5..6d4a2df7bf 100644
--- a/denote.el
+++ b/denote.el
@@ -3988,10 +3988,44 @@ Consult the manual for template samples."
(denote--keywords-add-to-history keywords)
(concat front-matter template denote-org-capture-specifiers))))
-(make-obsolete
- 'denote-org-capture-with-prompts
- 'denote-org-capture
- "2.3.0")
+;; TODO 2023-12-02: Maybe simplify `denote-org-capture-with-prompts'
+;; by passing a single PROMPTS that is the same value as `denote-prompts'?
+
+;; TODO 2023-12-02: The `denote-org-capture-with-prompts' is missing a
+;; signature argument, but nobody has asked for it. I think
+;; refactoring it per the above TODO is better, anyway. But maybe do
+;; this after version 2.2.0 is out.
+
+;;;###autoload
+(defun denote-org-capture-with-prompts (&optional title keywords subdirectory
date template)
+ "Like `denote-org-capture' but with optional prompt parameters.
+
+When called without arguments, do not prompt for anything. Just
+return the front matter with title and keyword fields empty and
+the date and identifier fields specified. Also make the file
+name consist of only the identifier plus the Org file name
+extension.
+
+Otherwise produce a minibuffer prompt for every non-nil value
+that corresponds to the TITLE, KEYWORDS, SUBDIRECTORY, DATE, and
+TEMPLATE arguments. The prompts are those used by the standard
+`denote' command and all of its utility commands.
+
+When returning the contents that fill in the Org capture
+template, the sequence is as follows: front matter, TEMPLATE, and
+then the value of the user option `denote-org-capture-specifiers'.
+
+Important note: in the case of SUBDIRECTORY actual subdirectories
+must exist---Denote does not create them. Same principle for
+TEMPLATE as templates must exist and are specified in the user
+option `denote-templates'."
+ (let ((denote-prompts '()))
+ (when template (push 'template denote-prompts))
+ (when date (push 'date denote-prompts))
+ (when subdirectory (push 'subdirectory denote-prompts))
+ (when keywords (push 'keywords denote-prompts))
+ (when title (push 'title denote-prompts))
+ (denote-org-capture)))
(defun denote-org-capture-delete-empty-file ()
"Delete file if capture with `denote-org-capture' is aborted."
- [elpa] externals/denote faaf5f94ab 03/20: Use denote-rename-max-mini-window-height in denote-change-file-type-and-front-matter, (continued)
- [elpa] externals/denote faaf5f94ab 03/20: Use denote-rename-max-mini-window-height in denote-change-file-type-and-front-matter, ELPA Syncer, 2023/12/20
- [elpa] externals/denote e6b7ba74e6 05/20: Make denote-retrieve-filename-identifier consistent with other functions, ELPA Syncer, 2023/12/20
- [elpa] externals/denote f1730b7798 17/20: Acknowledge Ashton Wiersdorf for commit e2ba6c1, ELPA Syncer, 2023/12/20
- [elpa] externals/denote f26d8d7799 08/20: Handle nil case in denote-sort--define-lessp, ELPA Syncer, 2023/12/20
- [elpa] externals/denote 4899ca5c78 09/20: Remove separator for the last file in denote-org-dblock-add-files, ELPA Syncer, 2023/12/20
- [elpa] externals/denote 6acb25c7ec 10/20: Create aliases for denote-retrieve-front-matter-* functions, ELPA Syncer, 2023/12/20
- [elpa] externals/denote 195f0c3b7f 14/20: Acknowledge Joseph Turner for commits 4261d19, f0910d3, ELPA Syncer, 2023/12/20
- [elpa] externals/denote 3d4891b5dd 06/20: Rename denote-retrieve-title-* and denote-retrieve-keywords-* functions, ELPA Syncer, 2023/12/20
- [elpa] externals/denote e2ba6c144d 16/20: Guard sorting keywords when given an empty string, ELPA Syncer, 2023/12/20
- [elpa] externals/denote ee58ae014d 20/20: Merge pull request #199 from jeanphilippegg/refactor, ELPA Syncer, 2023/12/20
- [elpa] externals/denote 2b627aaafd 11/20: Add denote-org-capture-with-prompts,
ELPA Syncer <=