mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
Simplify 'denote-parse-date' now that 'denote-valid-date-p' does the work
This commit is contained in:
parent
07e8d0bf90
commit
a2229e03ff
11
README.org
11
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
|
||||
|
|
|
|||
18
denote.el
18
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."
|
||||
|
|
|
|||
Loading…
Reference in a new issue