diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-06-28 22:40:01 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-06-28 22:40:51 +0200 |
commit | 6f8fdabf3529e9034e20c8e7d1dc8267c7ced838 (patch) | |
tree | fc58ebd47ab9bafebf125b17da877aa2c3df165a | |
parent | 27381411caacb5cb58c6774580fd08e9d044ed0e (diff) | |
download | org-mode-6f8fdabf3529e9034e20c8e7d1dc8267c7ced838.tar.gz |
org-macs: Fix circular dependency
* lisp/org-macs.el (org-matcher-time): Fix circular dependency between
`org-parse-time-string', `org-matcher-time' and `org-2ft'. Improve
docstring.
Reported-by: Allen Li <vianchielfaura@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2017-11/msg00023.html>
-rw-r--r-- | lisp/org-macs.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el index f74d3e0..e7e7f9d 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -1122,7 +1122,13 @@ This should be a lot faster than the `parse-time-string'." (t (error "Not an Org time string: %s" s)))) (defun org-matcher-time (s) - "Interpret a time comparison value S." + "Interpret a time comparison value S as a floating point time. + +S can be an Org time stamp, a modifier, e.g., \"<+2d>\", or the +following special strings: \"<now>\", \"<today>\", +\"<tomorrow>\", and \"<yesterday>\". + +Return 0. if S is not recognized as a valid value." (let ((today (float-time (apply #'encode-time (append '(0 0 0) (nthcdr 3 (decode-time))))))) (save-match-data @@ -1137,7 +1143,8 @@ This should be a lot faster than the `parse-time-string'." (cdr (assoc (match-string 2 s) '(("d" . 86400.0) ("w" . 604800.0) ("m" . 2678400.0) ("y" . 31557600.0))))))) - (t (org-2ft s)))))) + ((string-match org-ts-regexp0 s) (org-2ft s)) + (t 0.))))) |