aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorPaul Eggert2015-07-26 00:01:34 -0700
committerPaul Eggert2015-07-26 12:44:54 -0700
commitaf32fa956267af40db61051c248597144d41521c (patch)
treeafd650b9f9805474df149081e51cc8abae3bdb87 /admin
parent4c55786d9b2a5d571f3e543cc261ce0702c7341e (diff)
downloademacs-af32fa956267af40db61051c248597144d41521c.tar.gz
emacs-af32fa956267af40db61051c248597144d41521c.zip
New optional ZONE arg for format-time-string etc.
This simplifies time conversions in other time zones. It also prevents display-time-world tampering with TZ (Bug#21020). * admin/admin.el (add-release-logs): Use improved add-log-time-format API. * admin/merge-gnulib (GNULIB_MODULES): Add time_rz, timegm. (GNULIB_TOOL_FLAGS): Avoid flexmember, setenv, unsetenv. * configure.ac (tzalloc): Remove test for this, since Emacs no longer uses HAVE_TZALLOC directly. * doc/lispref/os.texi (Time of Day, Time Conversion) (Time Parsing): * etc/NEWS: Document the new behavior. Merge from gnulib, incorporating: 2015-07-25 strftime: fix newly-introduced bug on Solaris 2015-07-23 fprintftime, strftime: use timezone_t args * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. * lib/strftime.c, lib/strftime.h, lib/time.in.h, m4/sys_time_h.m4: * m4/time_h.m4: Update from gnulib. * lib/time_rz.c, lib/timegm.c, m4/time_rz.m4, m4/timegm.m4: New files from gnulib. * lisp/time-stamp.el (time-stamp-string): * lisp/time.el (display-time-world-list) (display-time-world-display): Use new API, with time zone arg. * lisp/time.el (display-time-world-display): Fix race when current-time advances while we're running. * lisp/vc/add-log.el (add-log-iso8601-time-zone) (add-log-iso8601-time-string): Accept optional time zone arg. * lisp/vc/add-log.el (add-change-log-entry): * lisp/vc/log-edit.el (log-edit-changelog-ours-p): Use new arg. * nt/gnulib.mk: Propagate lib/gnulib.mk changes here. Add rules for the time module, since they're now needed for tzalloc etc. * src/conf_post.h (getenv_TZ, setenv_TZ): New macros. (emacs_getenv_TZ, emacs_setenv_TZ): New decls. * src/editfns.c: Include errno.h. (set_time_zone_rule): Omit unnecessary forward decl. (initial_tz): Remove, replacing with ... (local_tz, wall_clock_tz, utc_tz): New static vars and constants. (tzeqlen): New constant; prefer it to (sizeof "TZ=" - 1). (emacs_localtime_rz, emacs_mktime_z, xtzalloc, xtzfree) (tzlookup): New static functions. (init_editfns): New arg DUMPING. All uses changed. (init_editfns): Omit most initialization if dumping, not if !initialized. Initialize wall_clock_tz and local_tz. (emacs_nmemftime, format_time_string): Time zone argument can now be any time zone, not just a boolean for UTC or local time. All callers changed. (Fformat_time_string, Fencode_time, Fcurrent_time_string) (Fcurrent_time_zone): New optional arg ZONE. (Fdecode_time, Fset_time_zone_rule): ZONE arg can now also take the same form as with the other new additions. (decode_time_zone): Remove; no longer needed. (tzvalbuf): Now file-scope. (emacs_getenv_TZ, emacs_setenv_TZ): New functions. (syms_of_editfns): Define Qwall. * src/editfns.c (mktime_z) [!HAVE_TZALLOC]: * src/systime.h (mktime_z, timezone_t, tzalloc, tzfree) [!HAVE_TZALLOC]: Remove; now supplied by gnulib. * src/emacs.c (main): * src/lisp.h (init_editfns): Adjust to init_editfns API change.
Diffstat (limited to 'admin')
-rw-r--r--admin/admin.el6
-rwxr-xr-xadmin/merge-gnulib8
2 files changed, 6 insertions, 8 deletions
diff --git a/admin/admin.el b/admin/admin.el
index 93e9124ce8d..267f2c4afea 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -38,14 +38,12 @@ Optional argument DATE is the release date, default today."
38 emacs-minor-version)) 38 emacs-minor-version))
39 (read-string "Release date: " 39 (read-string "Release date: "
40 (progn (require 'add-log) 40 (progn (require 'add-log)
41 (let ((add-log-time-zone-rule t)) 41 (funcall add-log-time-format nil t)))))
42 (funcall add-log-time-format))))))
43 (setq root (expand-file-name root)) 42 (setq root (expand-file-name root))
44 (unless (file-exists-p (expand-file-name "src/emacs.c" root)) 43 (unless (file-exists-p (expand-file-name "src/emacs.c" root))
45 (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) 44 (user-error "%s doesn't seem to be the root of an Emacs source tree" root))
46 (require 'add-log) 45 (require 'add-log)
47 (or date (setq date (let ((add-log-time-zone-rule t)) 46 (or date (setq date (funcall add-log-time-format nil t)))
48 (funcall add-log-time-format))))
49 (let* ((logs (process-lines "find" root "-name" "ChangeLog")) 47 (let* ((logs (process-lines "find" root "-name" "ChangeLog"))
50 (entry (format "%s %s <%s>\n\n\t* Version %s released.\n\n" 48 (entry (format "%s %s <%s>\n\n\t* Version %s released.\n\n"
51 date 49 date
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index e7910a642c7..963c3a06e1a 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -37,20 +37,20 @@ GNULIB_MODULES='
37 pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat 37 pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat
38 sig2str socklen stat-time stdalign stddef stdio 38 sig2str socklen stat-time stdalign stddef stdio
39 stpcpy strftime strtoimax strtoumax symlink sys_stat 39 stpcpy strftime strtoimax strtoumax symlink sys_stat
40 sys_time time time_r timer-time timespec-add timespec-sub 40 sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub
41 unsetenv update-copyright utimens 41 unsetenv update-copyright utimens
42 vla warnings 42 vla warnings
43' 43'
44 44
45GNULIB_TOOL_FLAGS=' 45GNULIB_TOOL_FLAGS='
46 --avoid=close --avoid=dup 46 --avoid=close --avoid=dup
47 --avoid=fchdir --avoid=fstat 47 --avoid=fchdir --avoid=flexmember --avoid=fstat
48 --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow 48 --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow
49 --avoid=open --avoid=openat-die --avoid=opendir 49 --avoid=open --avoid=openat-die --avoid=opendir
50 --avoid=raise 50 --avoid=raise
51 --avoid=save-cwd --avoid=select --avoid=sigprocmask 51 --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask
52 --avoid=stdarg --avoid=stdbool 52 --avoid=stdarg --avoid=stdbool
53 --avoid=threadlib 53 --avoid=threadlib --avoid=unsetenv
54 --conditional-dependencies --import --no-changelog --no-vc-files 54 --conditional-dependencies --import --no-changelog --no-vc-files
55 --makefile-name=gnulib.mk 55 --makefile-name=gnulib.mk
56' 56'