Merge branch 'maint'
This commit is contained in:
commit
1c7cf61bd7
|
@ -1068,7 +1068,7 @@ as a canonical duration, i.e., using units defined in
|
||||||
(cond
|
(cond
|
||||||
((string-match-p org-ts-regexp s)
|
((string-match-p org-ts-regexp s)
|
||||||
(/ (- org-columns--time
|
(/ (- org-columns--time
|
||||||
(float-time (apply #'encode-time (org-parse-time-string s))))
|
(float-time (apply #'encode-time (org-parse-time-string s nil t))))
|
||||||
60))
|
60))
|
||||||
((org-duration-p s) (org-duration-to-minutes s t)) ;skip user units
|
((org-duration-p s) (org-duration-to-minutes s t)) ;skip user units
|
||||||
(t (user-error "Invalid age: %S" s))))
|
(t (user-error "Invalid age: %S" s))))
|
||||||
|
|
16
lisp/org.el
16
lisp/org.el
|
@ -17799,11 +17799,17 @@ day number."
|
||||||
(list (nth 4 d) (nth 3 d) (nth 5 d))))
|
(list (nth 4 d) (nth 3 d) (nth 5 d))))
|
||||||
((listp d) (list (nth 4 d) (nth 3 d) (nth 5 d)))))
|
((listp d) (list (nth 4 d) (nth 3 d) (nth 5 d)))))
|
||||||
|
|
||||||
(defun org-parse-time-string (s &optional nodefault)
|
(defun org-parse-time-string (s &optional nodefault zone)
|
||||||
"Parse the standard Org time string.
|
"Parse the standard Org time string.
|
||||||
|
|
||||||
This should be a lot faster than the normal `parse-time-string'.
|
This should be a lot faster than the normal `parse-time-string'.
|
||||||
If time is not given, defaults to 0:00. However, with optional NODEFAULT,
|
|
||||||
hour and minute fields will be nil if not given."
|
If time is not given, defaults to 0:00. However, with optional
|
||||||
|
NODEFAULT, hour and minute fields will be nil if not given.
|
||||||
|
|
||||||
|
The optional ZONE is omitted or nil for Emacs local time, t for
|
||||||
|
Universal Time, ‘wall’ for system wall clock time, or a string as
|
||||||
|
in the TZ environment variable."
|
||||||
(cond ((string-match org-ts-regexp0 s)
|
(cond ((string-match org-ts-regexp0 s)
|
||||||
(list 0
|
(list 0
|
||||||
(when (or (match-beginning 8) (not nodefault))
|
(when (or (match-beginning 8) (not nodefault))
|
||||||
|
@ -17813,9 +17819,9 @@ hour and minute fields will be nil if not given."
|
||||||
(string-to-number (match-string 4 s))
|
(string-to-number (match-string 4 s))
|
||||||
(string-to-number (match-string 3 s))
|
(string-to-number (match-string 3 s))
|
||||||
(string-to-number (match-string 2 s))
|
(string-to-number (match-string 2 s))
|
||||||
nil nil nil))
|
nil nil zone))
|
||||||
((string-match "^<[^>]+>$" s)
|
((string-match "^<[^>]+>$" s)
|
||||||
(decode-time (seconds-to-time (org-matcher-time s))))
|
(decode-time (seconds-to-time (org-matcher-time s)) zone))
|
||||||
(t (error "Not a standard Org time string: %s" s))))
|
(t (error "Not a standard Org time string: %s" s))))
|
||||||
|
|
||||||
(defun org-timestamp-up (&optional arg)
|
(defun org-timestamp-up (&optional arg)
|
||||||
|
|
|
@ -513,7 +513,7 @@
|
||||||
(cl-letf (((symbol-function 'current-time)
|
(cl-letf (((symbol-function 'current-time)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(apply #'encode-time
|
(apply #'encode-time
|
||||||
(org-parse-time-string "<2014-03-04 Tue>")))))
|
(org-parse-time-string "<2014-03-04 Tue>" nil t)))))
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"* H
|
"* H
|
||||||
** S1
|
** S1
|
||||||
|
@ -528,11 +528,11 @@
|
||||||
(get-char-property (point) 'org-columns-value-modified)))))
|
(get-char-property (point) 'org-columns-value-modified)))))
|
||||||
(should
|
(should
|
||||||
(equal
|
(equal
|
||||||
"705d 1h"
|
"705d"
|
||||||
(cl-letf (((symbol-function 'current-time)
|
(cl-letf (((symbol-function 'current-time)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(apply #'encode-time
|
(apply #'encode-time
|
||||||
(org-parse-time-string "<2014-03-04 Tue>")))))
|
(org-parse-time-string "<2014-03-04 Tue>" nil t)))))
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"* H
|
"* H
|
||||||
** S1
|
** S1
|
||||||
|
@ -547,11 +547,11 @@
|
||||||
(get-char-property (point) 'org-columns-value-modified)))))
|
(get-char-property (point) 'org-columns-value-modified)))))
|
||||||
(should
|
(should
|
||||||
(equal
|
(equal
|
||||||
"352d 12h 30min"
|
"352d 12h"
|
||||||
(cl-letf (((symbol-function 'current-time)
|
(cl-letf (((symbol-function 'current-time)
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(apply #'encode-time
|
(apply #'encode-time
|
||||||
(org-parse-time-string "<2014-03-04 Tue>")))))
|
(org-parse-time-string "<2014-03-04 Tue>" nil t)))))
|
||||||
(org-test-with-temp-text
|
(org-test-with-temp-text
|
||||||
"* H
|
"* H
|
||||||
** S1
|
** S1
|
||||||
|
|
Loading…
Reference in New Issue