diff options
author | Galen Menzel <galen.menzel@utexas.edu> | 2017-08-11 15:07:45 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-08-14 13:02:43 +0200 |
commit | f3abb514a3d343add93fd370b5a9894a95a3d3e8 (patch) | |
tree | 7d60e1b2cdf7ee3a86e47e1b438da3b169690e48 | |
parent | b862c24b9fb2591dc6240bfbd3a9829c72d9b970 (diff) | |
download | org-mode-f3abb514a3d343add93fd370b5a9894a95a3d3e8.tar.gz |
Implement `org-decode-time' for backward compatibility
* lisp/org-compat.el (org-decode-time): New function.
* lisp/org-clock.el (org-clock-get-sum-start): Use new function.
Emacs 24's `decode-time' doesn't accept two arguments.
-rw-r--r-- | lisp/org-clock.el | 2 | ||||
-rw-r--r-- | lisp/org-compat.el | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index bceeea9..aa5c375 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1434,7 +1434,7 @@ The time is always returned as UTC." (current-time)) ((equal cmt "today") (setq org--msg-extra "showing today's task time.") - (let* ((dt (decode-time nil t)) + (let* ((dt (org-decode-time nil t)) (hour (nth 2 dt)) (day (nth 3 dt))) (if (< hour org-extend-today-until) (setf (nth 3 dt) (1- day))) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 8803c21..68a1166 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -60,6 +60,12 @@ (defalias 'format-message 'format) (defalias 'gui-get-selection 'x-get-selection)) +(defun org-decode-time (&optional time zone) + "Backward-compatible function for `decode-time'." + (if (< emacs-major-version 25) + (decode-time time) + (decode-time time zone))) + ;;; Obsolete aliases (remove them after the next major release). |