diff options
| author | Paul Eggert | 2016-04-12 09:19:11 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-12 09:19:38 -0700 |
| commit | fdb1ba144ca61185e6457f092f38f59dd9bbe6a0 (patch) | |
| tree | 5048d1fbb946faf0b6059e4d4375bb514b3bfa74 /lisp/vc | |
| parent | 7c2c2196fd4be0b656bdf0e0b68f3d7c4a5eca08 (diff) | |
| download | emacs-fdb1ba144ca61185e6457f092f38f59dd9bbe6a0.tar.gz emacs-fdb1ba144ca61185e6457f092f38f59dd9bbe6a0.zip | |
Support OFFSET and (OFFSET ABBR) time zone rules
This simplifies Gnus and VC time zone support, by letting them
feed the output of ‘current-time-zone’ and ‘decode time’ to
primitives that accept time zone arguments.
* doc/lispref/os.texi (Time Zone Rules, Time Conversion):
* etc/NEWS:
* lisp/gnus/message.el (message-insert-formatted-citation-line):
* lisp/org/org.el (org-timestamp-format):
* src/editfns.c (Fformat_time_string, Fdecode_time):
(Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
Document new behavior.
* lisp/gnus/gmm-utils.el (gmm-format-time-string):
* lisp/vc/add-log.el (add-log-iso8601-time-zone):
Mark as obsolete, as it is now just an alias or narrow wrapper
around format-time-string.
* src/editfns.c (tzlookup): Also support integer OFFSET and
list (OFFSET ABBR) as time zone rules.
(Fencode_time): No longer need a special case for a cons ZONE.
(Fcurrent_time_zone): If the time zone string is missing, compute
it the same way the other new code does.
Diffstat (limited to 'lisp/vc')
| -rw-r--r-- | lisp/vc/add-log.el | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/lisp/vc/add-log.el b/lisp/vc/add-log.el index 58a4e77a602..9076d834c7c 100644 --- a/lisp/vc/add-log.el +++ b/lisp/vc/add-log.el | |||
| @@ -590,25 +590,14 @@ If a string, interpret as the ZONE argument of `format-time-string'.") | |||
| 590 | (lambda (x) (or (booleanp x) (stringp x)))) | 590 | (lambda (x) (or (booleanp x) (stringp x)))) |
| 591 | 591 | ||
| 592 | (defun add-log-iso8601-time-zone (&optional time zone) | 592 | (defun add-log-iso8601-time-zone (&optional time zone) |
| 593 | (let* ((utc-offset (or (car (current-time-zone time zone)) 0)) | 593 | (declare (obsolete nil "25.2")) |
| 594 | (sign (if (< utc-offset 0) ?- ?+)) | 594 | (format-time-string "%:::z" time zone)) |
| 595 | (sec (abs utc-offset)) | ||
| 596 | (ss (% sec 60)) | ||
| 597 | (min (/ sec 60)) | ||
| 598 | (mm (% min 60)) | ||
| 599 | (hh (/ min 60))) | ||
| 600 | (format (cond ((not (zerop ss)) "%c%02d:%02d:%02d") | ||
| 601 | ((not (zerop mm)) "%c%02d:%02d") | ||
| 602 | (t "%c%02d")) | ||
| 603 | sign hh mm ss))) | ||
| 604 | 595 | ||
| 605 | (defvar add-log-iso8601-with-time-zone nil) | 596 | (defvar add-log-iso8601-with-time-zone nil) |
| 606 | 597 | ||
| 607 | (defun add-log-iso8601-time-string (&optional time zone) | 598 | (defun add-log-iso8601-time-string (&optional time zone) |
| 608 | (let ((date (format-time-string "%Y-%m-%d" time zone))) | 599 | (format-time-string |
| 609 | (if add-log-iso8601-with-time-zone | 600 | (if add-log-iso8601-with-time-zone "%Y-%m-%d %:::z" "%Y-%m-%d") time zone)) |
| 610 | (concat date " " (add-log-iso8601-time-zone time zone)) | ||
| 611 | date))) | ||
| 612 | 601 | ||
| 613 | (defun change-log-name () | 602 | (defun change-log-name () |
| 614 | "Return (system-dependent) default name for a change log file." | 603 | "Return (system-dependent) default name for a change log file." |