[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote a2229e03ff 09/12: Simplify 'denote-parse-date' n
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote a2229e03ff 09/12: Simplify 'denote-parse-date' now that 'denote-valid-date-p' does the work |
Date: |
Sun, 11 Feb 2024 03:57:54 -0500 (EST) |
branch: externals/denote
commit a2229e03ff65f2a83eb5f478fc91fc0ba776680a
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Simplify 'denote-parse-date' now that 'denote-valid-date-p' does the work
---
README.org | 11 +++++------
denote.el | 18 +++---------------
2 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/README.org b/README.org
index 7b7f7af2e4..3f5fa2357f 100644
--- a/README.org
+++ b/README.org
@@ -3950,12 +3950,11 @@ might change them without further notice.
#+findex: denote-parse-date
+ Function ~denote-parse-date~ :: Return =DATE= as an appropriate
- value for the ~denote~ command. If =DATE= is a list, assume it is
- consistent with ~current-date~ or related and return it as-is. If
- =DATE= is a non-empty string, try to convert it with ~date-to-time~,
- per ~denote-valid-date-p~. If =DATE= is none of the above, return
- ~current-time~. [ The ~denote-valid-date-p~ is the new name of
- ~denote--valid-date~ as part of {{{development-version}}}. ]
+ value for the ~denote~ command. Pass =DATE= through
+ ~denote-valid-date-p~ and use its return value. If either that or
+ =DATE= is nil, return ~current-time~. [ The ~denote-valid-date-p~ is
+ the new name of ~denote--valid-date~, with enhanced functionality.
+ Done as part of {{{development-version}}}. ]
#+findex: denote-directory
+ Function ~denote-directory~ :: Return path of the variable
diff --git a/denote.el b/denote.el
index a73fa17036..2f59cffac2 100644
--- a/denote.el
+++ b/denote.el
@@ -1876,21 +1876,9 @@ If DATE is nil, return nil."
(defun denote-parse-date (date)
"Return DATE as an appropriate value for the `denote' command.
-
-- If DATE is non-nil and a list, assume it is consistent with
- `current-date' or related and return it as-is.
-
-- If DATE is a non-empty string, try to convert it with
- `date-to-time'.
-
-- If DATE is none of the above, return `current-time'."
- (cond
- ((and date (listp date))
- date)
- ((and (stringp date) (not (string-empty-p date)))
- (denote--valid-date date))
- (t
- (current-time))))
+Pass DATE through `denote-valid-date-p' and use its return value.
+If either that or DATE is nil, return `current-time'."
+ (or (denote-valid-date-p date)) (current-time))
(defun denote--buffer-file-names ()
"Return file names of Denote buffers."
- [elpa] externals/denote updated (9353d23aa4 -> 55e923ffc5), ELPA Syncer, 2024/02/11
- [elpa] externals/denote e66f275c15 01/12: Ensure that denote-surround-with-quotes does not return "nil" if S is nil, ELPA Syncer, 2024/02/11
- [elpa] externals/denote a2229e03ff 09/12: Simplify 'denote-parse-date' now that 'denote-valid-date-p' does the work,
ELPA Syncer <=
- [elpa] externals/denote d862b65526 06/12: Define denote-get-identifier function, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 9dced4b7fd 07/12: Harden the conditionality of denote-valid-date-p, ELPA Syncer, 2024/02/11
- [elpa] externals/denote af17af9f2b 04/12: Move a helper function above where it is first called, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 07e8d0bf90 08/12: Clarify the documentation of denote-valid-date-p, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 121ed6d04d 11/12: Use the new 'denote-get-identifier' where appropriate, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 6c503ed953 02/12: Rename denote-surround-with-quotes to denote-format-string-for-md-front-matter, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 675f5e44ba 03/12: Add denote-format-string-for-org-front-matter, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 2339e51633 05/12: Rename 'denote--valid-date' to 'denote-valid-date-p', ELPA Syncer, 2024/02/11
- [elpa] externals/denote 55e923ffc5 12/12: Make denote-format-file-name also accept nil TITLE and SIGNATURE, ELPA Syncer, 2024/02/11
- [elpa] externals/denote 91f51e6cab 10/12: Use the correct number for the {{{development-version}}} in the docs, ELPA Syncer, 2024/02/11