diff options
| author | Stefan Kangas | 2019-06-01 01:40:57 -0700 |
|---|---|---|
| committer | Paul Eggert | 2019-06-01 01:44:31 -0700 |
| commit | b6c628a16b52ce964f6526f9770d2f7d52ce8747 (patch) | |
| tree | dec93322e8ff4739df268cf020851b63f491502f /lisp/timezone.el | |
| parent | 12f530a7358aefe32134eeec3bc20ce58305e473 (diff) | |
| download | emacs-b6c628a16b52ce964f6526f9770d2f7d52ce8747.tar.gz emacs-b6c628a16b52ce964f6526f9770d2f7d52ce8747.zip | |
Use lexical-binding in timezone.el and add tests
* lisp/timezone.el: Use lexical-binding.
* test/lisp/timezone-tests.el: New file.
Diffstat (limited to 'lisp/timezone.el')
| -rw-r--r-- | lisp/timezone.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/timezone.el b/lisp/timezone.el index 79720b42ec1..ff0b266245f 100644 --- a/lisp/timezone.el +++ b/lisp/timezone.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; timezone.el --- time zone package for GNU Emacs | 1 | ;;; timezone.el --- time zone package for GNU Emacs -- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1990-1993, 1996, 1999, 2001-2019 Free Software | 3 | ;; Copyright (C) 1990-1993, 1996, 1999, 2001-2019 Free Software |
| 4 | ;; Foundation, Inc. | 4 | ;; Foundation, Inc. |
| @@ -72,8 +72,7 @@ if nil, the local time zone is assumed." | |||
| 72 | (timezone-make-arpa-date (aref new 0) (aref new 1) (aref new 2) | 72 | (timezone-make-arpa-date (aref new 0) (aref new 1) (aref new 2) |
| 73 | (timezone-make-time-string | 73 | (timezone-make-time-string |
| 74 | (aref new 3) (aref new 4) (aref new 5)) | 74 | (aref new 3) (aref new 4) (aref new 5)) |
| 75 | (aref new 6)) | 75 | (aref new 6)))) |
| 76 | )) | ||
| 77 | 76 | ||
| 78 | (defun timezone-make-date-sortable (date &optional local timezone) | 77 | (defun timezone-make-date-sortable (date &optional local timezone) |
| 79 | "Convert DATE to a sortable date string. | 78 | "Convert DATE to a sortable date string. |
| @@ -84,8 +83,7 @@ if nil, the local time zone is assumed." | |||
| 84 | (let ((new (timezone-fix-time date local timezone))) | 83 | (let ((new (timezone-fix-time date local timezone))) |
| 85 | (timezone-make-sortable-date (aref new 0) (aref new 1) (aref new 2) | 84 | (timezone-make-sortable-date (aref new 0) (aref new 1) (aref new 2) |
| 86 | (timezone-make-time-string | 85 | (timezone-make-time-string |
| 87 | (aref new 3) (aref new 4) (aref new 5))) | 86 | (aref new 3) (aref new 4) (aref new 5))))) |
| 88 | )) | ||
| 89 | 87 | ||
| 90 | 88 | ||
| 91 | ;; | 89 | ;; |