Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2017-06-21 22:35:28 +02:00
commit e90b643b05
2 changed files with 13 additions and 11 deletions

View File

@ -1593,9 +1593,9 @@ to, overriding the existing value of `org-clock-out-switch-to-state'."
(insert "--") (insert "--")
(setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive)) (setq te (org-insert-time-stamp (or at-time now) 'with-hm 'inactive))
(setq s (- (float-time (setq s (- (float-time
(apply #'encode-time (org-parse-time-string te))) (apply #'encode-time (org-parse-time-string te nil t)))
(float-time (float-time
(apply #'encode-time (org-parse-time-string ts)))) (apply #'encode-time (org-parse-time-string ts nil t))))
h (floor (/ s 3600)) h (floor (/ s 3600))
s (- s (* 3600 h)) s (- s (* 3600 h))
m (floor (/ s 60)) m (floor (/ s 60))
@ -1829,9 +1829,9 @@ PROPNAME lets you set a custom text property instead of :org-clock-minutes."
(setq ts (match-string 2) (setq ts (match-string 2)
te (match-string 3) te (match-string 3)
ts (float-time ts (float-time
(apply #'encode-time (org-parse-time-string ts))) (apply #'encode-time (org-parse-time-string ts nil t)))
te (float-time te (float-time
(apply #'encode-time (org-parse-time-string te))) (apply #'encode-time (org-parse-time-string te nil t)))
ts (if tstart (max ts tstart) ts) ts (if tstart (max ts tstart) ts)
te (if tend (min te tend) te) te (if tend (min te tend) te)
dt (- te ts) dt (- te ts)
@ -2703,14 +2703,16 @@ LEVEL is an integer. Indent by two spaces per level above 1."
(pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute ts))) (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute ts)))
(setq ts (float-time (encode-time 0 0 0 day month year))))) (setq ts (float-time (encode-time 0 0 0 day month year)))))
(ts (ts
(setq ts (float-time (apply #'encode-time (org-parse-time-string ts)))))) (setq ts (float-time
(apply #'encode-time (org-parse-time-string ts nil t))))))
(cond (cond
((numberp te) ((numberp te)
;; Likewise for te. ;; Likewise for te.
(pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te))) (pcase-let ((`(,month ,day ,year) (calendar-gregorian-from-absolute te)))
(setq te (float-time (encode-time 0 0 0 day month year))))) (setq te (float-time (encode-time 0 0 0 day month year)))))
(te (te
(setq te (float-time (apply #'encode-time (org-parse-time-string te)))))) (setq te (float-time
(apply #'encode-time (org-parse-time-string te nil t))))))
(setq tsb (setq tsb
(if (eq step0 'week) (if (eq step0 'week)
(- ts (* 86400 (- (nth 6 (decode-time (seconds-to-time ts))) ws))) (- ts (* 86400 (- (nth 6 (decode-time (seconds-to-time ts))) ws)))
@ -2883,9 +2885,9 @@ Otherwise, return nil."
(setq ts (match-string 1) (setq ts (match-string 1)
te (match-string 3)) te (match-string 3))
(setq s (- (float-time (setq s (- (float-time
(apply #'encode-time (org-parse-time-string te))) (apply #'encode-time (org-parse-time-string te nil t)))
(float-time (float-time
(apply #'encode-time (org-parse-time-string ts)))) (apply #'encode-time (org-parse-time-string ts nil t))))
neg (< s 0) neg (< s 0)
s (abs s) s (abs s)
h (floor (/ s 3600)) h (floor (/ s 3600))

View File

@ -345,13 +345,13 @@ the buffer."
(equal (equal
"| Headline | Time | | "| Headline | Time | |
|--------------+------------+-----| |--------------+------------+-----|
| *Total time* | *16905:01* | foo | | *Total time* | *16904:01* | foo |
|--------------+------------+-----| |--------------+------------+-----|
| Test | 16905:01 | foo | | Test | 16904:01 | foo |
#+TBLFM: $3=string(\"foo\")" #+TBLFM: $3=string(\"foo\")"
(org-test-with-temp-text-in-file (org-test-with-temp-text-in-file
"* Test "* Test
CLOCK: [2012-03-29 Thu 16:40]--[2014-03-04 Thu 00:41] => 16905:01" CLOCK: [2012-03-29 Thu 16:40]--[2014-03-04 Thu 00:41] => 16904:01"
(test-org-clock-clocktable-contents ":scope file-with-archives" (test-org-clock-clocktable-contents ":scope file-with-archives"
"#+TBLFM: $3=string(\"foo\")")))) "#+TBLFM: $3=string(\"foo\")"))))
;; Test "function" scope. ;; Test "function" scope.