[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 608832a 02/13: Use decoded time accessors in calc
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master 608832a 02/13: Use decoded time accessors in calc |
Date: |
Tue, 30 Jul 2019 07:12:05 -0400 (EDT) |
branch: master
commit 608832acc35420fc7140f73cd8e18f1a00f93ec6
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Use decoded time accessors in calc
* lisp/calc/calc-forms.el (calc-time, math-this-year)
(calcFunc-now): Use decoded time accessors.
---
lisp/calc/calc-forms.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el
index eb1a824..d867ac1 100644
--- a/lisp/calc/calc-forms.el
+++ b/lisp/calc/calc-forms.el
@@ -41,7 +41,9 @@
(calc-enter-result 0 "time"
(list 'mod
(list 'hms
- (nth 2 time) (nth 1 time) (nth 0 time))
+ (decoded-time-hour time)
+ (decoded-time-minute time)
+ (decoded-time-second 0 time))
(list 'hms 24 0 0))))))
(defun calc-to-hms (arg)
@@ -523,7 +525,7 @@ in the Gregorian calendar and the remaining part determines
the time."
(defun math-this-year ()
- (nth 5 (decode-time)))
+ (decoded-time-year (decode-time)))
(defun math-leap-year-p (year &optional julian)
"Non-nil if YEAR is a leap year.
@@ -1341,8 +1343,12 @@ as measured in the integer number of days before
December 31, 1 BC (Gregorian)."
(defun calcFunc-now (&optional zone)
(let ((date (let ((now (decode-time)))
(list 'date (math-dt-to-date
- (list (nth 5 now) (nth 4 now) (nth 3 now)
- (nth 2 now) (nth 1 now) (nth 0 now)))))))
+ (list (decoded-time-year now)
+ (decoded-time-month now)
+ (decoded-time-day now)
+ (decoded-time-hour now)
+ (decoded-time-minute now)
+ (decoded-time-second now)))))))
(if zone
(math-add date (math-div (math-sub (calcFunc-tzone nil date)
(calcFunc-tzone zone date))
- [Emacs-diffs] master updated (8a30f04 -> 74c5d68), Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master 3c4eb0d 01/13: Use decoded time accessors in proced, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master bd3bc1c 05/13: Fix syntax error in previus calc-forms change, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master 9f14c9a 04/13: Use decoded time accessors in calendar, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master e3bbd66 06/13: Use decoded time accessors in appt, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master c859bc0 08/13: Use decoded time accessors in timeclock, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master 4134e6f 12/13: Use decoded time accessors in pop3, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master 608832a 02/13: Use decoded time accessors in calc,
Lars Ingebrigtsen <=
- [Emacs-diffs] master bd26eff 03/13: Use decoded time accessors in Gnus, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master e9e1b0a 07/13: Use decoded time accessors in time-date, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master 66a74f8 09/13: Use decoded time accessors in timer, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master bddd4d3 10/13: Use decoded time accessors in in em-ls, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master 2b5fe44 11/13: Use decoded time accessors in esh-util, Lars Ingebrigtsen, 2019/07/30
- [Emacs-diffs] master 74c5d68 13/13: Use decoded time accessors in ediff-mult, Lars Ingebrigtsen, 2019/07/30