From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 03 19:19:19 2016 Received: (at submit) by debbugs.gnu.org; 4 Jan 2016 00:19:19 +0000 Received: from localhost ([127.0.0.1]:36978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aFsrn-00028A-9N for submit@debbugs.gnu.org; Sun, 03 Jan 2016 19:19:19 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57574) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aFsrl-00027v-PG for submit@debbugs.gnu.org; Sun, 03 Jan 2016 19:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFsrf-0008Sx-PD for submit@debbugs.gnu.org; Sun, 03 Jan 2016 19:19:12 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45009) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFsrf-0008St-Ll for submit@debbugs.gnu.org; Sun, 03 Jan 2016 19:19:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFsre-0001JB-Og for bug-gnu-emacs@gnu.org; Sun, 03 Jan 2016 19:19:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFsra-0008SP-NR for bug-gnu-emacs@gnu.org; Sun, 03 Jan 2016 19:19:10 -0500 Received: from hylle05.itea.ntnu.no ([129.241.56.225]:34338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFsra-0008Rz-GK for bug-gnu-emacs@gnu.org; Sun, 03 Jan 2016 19:19:06 -0500 Received: from localhost (localhost [127.0.0.1]) by hylle05.itea.ntnu.no (Postfix) with ESMTP id 91E4390A44D for ; Mon, 4 Jan 2016 01:18:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at hylle05.itea.ntnu.no Received: from it-ex12.win.ntnu.no (it-ex12.it.ntnu.no [IPv6:2001:700:300:3::147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by hylle05.itea.ntnu.no (Postfix) with ESMTPS id 40C7690A322 for ; Mon, 4 Jan 2016 01:18:53 +0100 (CET) Received: from it-ex13.win.ntnu.no (129.241.56.148) by it-ex12.win.ntnu.no (129.241.56.147) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Mon, 4 Jan 2016 01:18:52 +0100 Received: from it-ex13.win.ntnu.no ([fe80::d4d7:f6fd:a4b:6a86]) by it-ex13.win.ntnu.no ([fe80::d4d7:f6fd:a4b:6a86%17]) with mapi id 15.00.1130.005; Mon, 4 Jan 2016 01:18:52 +0100 From: Harald Hanche-Olsen To: "bug-gnu-emacs@gnu.org" Subject: 25.1.50; time-stamp ignores time-stamp-time-zone Thread-Topic: 25.1.50; time-stamp ignores time-stamp-time-zone Thread-Index: AQHRRoV9Tx+JINxuW0aFjgG599cFNA== Date: Mon, 4 Jan 2016 00:18:52 +0000 Message-ID: Accept-Language: en-US, nb-NO Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Airmail (335) x-ms-exchange-transport-fromentityheader: Hosted X-Ntnu-xOriginatingIp: [2001:4662:4ff3:0:45b5:d691:bc24:5827] Content-Type: text/plain; charset="utf-8" Content-ID: <17DF77D81C544C45953336DDF10A0EC0@mail.ntnu.no> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) UnVuIGVtYWNzIC1RIGFuZCBpbnNlcnQgdGhpcyB0ZXh0Og0KVGltZS1zdGFtcDogPD4NCg0KVGhl biBkbzoNCk0tOiAocmVxdWlyZSAndGltZS1zdGFtcCkgUkVUDQpNLXggc2V0LXZhcmlhYmxlIFJF VCB0aW1lLXN0YW1wLXRpbWUtem9uZSBSRVQgIlVUQyIgUkVUDQpNLXggdGltZS1zdGFtcA0KDQpF eHBlY3RlZCByZXN1bHQ6IEEgVVRDIHRpbWUgc3RhbXAgaXMgaW5zZXJ0ZWQuDQpBY3R1YWwgcmVz dWx0OiBBIHRpbWUgc3RhbXAgaW4gdGhlIGxvY2FsIHRpbWUgem9uZSBpcyBpbnNlcnRlZC4NCg0K TXkgYW5hbHlzaXM6DQp0aW1lLXN0YW1wIHVzZXMgdGltZS1zdGFtcC1zdHJpbmcgdG8gY29tcHV0 ZSB0aGUgc3RyaW5nIHRvIGluc2VydC4NCkFuZCB0aGF0IGNhbGxzOg0KwqAgwqAgwqAgKGZvcm1h dC10aW1lLXN0cmluZyAodGltZS1zdGFtcC1zdHJpbmctcHJlcHJvY2VzcyB0cy1mb3JtYXQpDQrC oCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCDCoCBuaWwgdGltZS1zdGFtcC10aW1l LXpvbmUpDQpIb3dldmVyLCB0aW1lLXN0YW1wLXN0cmluZy1wcmVwcm9jZXNzIGRvZXMgYWxsIHRo ZSB3b3JrLA0KbGVhdmluZyBub3RoaW5nIGZvciBmb3JtYXQtdGltZS1zdHJpbmcgdG8gZG8uDQpB bmQgaXQgZG9lcyBzbyB3aXRob3V0IGNvbnN1bHRpbmcgdGltZS1zdGFtcC10aW1lLXpvbmUuDQoN CkFkbWl0dGVkbHksIHRoZSBkb2Mgc3RyaW5nIGZvciB0aW1lLXN0YW1wIChubyBsb25nZXI/KSBt ZW50aW9ucyB0aW1lLXN0YW1wLXRpbWUtem9uZS4NCkhvd2V2ZXIsIHRoZSB2YXJpYWJsZSBkb2Vz IGV4aXN0LCBhbmQgaXRzIGRvYyBzdHJpbmcgaW5kaWNhdGVzIHRoYXQgaXQgd2lsbCBiZSB1c2Vk IGJ5IHRpbWUtc3RhbXAuDQoNCuKAkyBIYXJhbGQNCg0KSW4gR05VIEVtYWNzIDI1LjEuNTAuMSAo eDg2XzY0LWFwcGxlLWRhcndpbjE1LjIuMCwgTlMgYXBwa2l0LTE0MDQuMzQgVmVyc2lvbiAxMC4x MS4yIChCdWlsZCAxNUM1MCkpDQrCoG9mIDIwMTUtMTItMTcNClJlcG9zaXRvcnkgcmV2aXNpb246 IDIzYjVjMjI3MDNlZWVlN2I0ZmU2NjA4Y2UxMmZmZTNiODc3OTQ5MzMNCldpbmRvd2luZyBzeXN0 ZW0gZGlzdHJpYnV0b3IgJ0FwcGxlJywgdmVyc2lvbiAxMC4zLjE0MDQNCkNvbmZpZ3VyZWQgdXNp bmc6DQrCoCdjb25maWd1cmUgLS13aXRoLW5zJw0KDQpDb25maWd1cmVkIGZlYXR1cmVzOg0KUlNW RyBJTUFHRU1BR0lDSyBOT1RJRlkgQUNMIEdOVVRMUyBMSUJYTUwyIFpMSUIgVE9PTEtJVF9TQ1JP TExfQkFSUyBOUw0KDQpJbXBvcnRhbnQgc2V0dGluZ3M6DQrCoCB2YWx1ZSBvZiAkTENfQ1RZUEU6 IGVuX1VTLlVURi04DQrCoCBsb2NhbGUtY29kaW5nLXN5c3RlbTogdXRmLTgtdW5peA0KDQoNCg== From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 11 23:40:59 2016 Received: (at 22302) by debbugs.gnu.org; 12 Jan 2016 04:40:59 +0000 Received: from localhost ([127.0.0.1]:46959 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aIqlP-0000ua-0v for submit@debbugs.gnu.org; Mon, 11 Jan 2016 23:40:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50276) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aIqlN-0000uH-F6 for 22302@debbugs.gnu.org; Mon, 11 Jan 2016 23:40:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIqlH-0003o6-G1 for 22302@debbugs.gnu.org; Mon, 11 Jan 2016 23:40:52 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIqlD-0003nF-CN; Mon, 11 Jan 2016 23:40:47 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1aIqlB-00062L-8f; Mon, 11 Jan 2016 23:40:45 -0500 From: Glenn Morris To: Paul Eggert Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone References: X-Spook: WHO security Social media strategic unclassified bootleg X-Ran: _u^s\tP"bl?)XQ0.{k7'6r6%77s%?y'>*;dIc-Jgho8o'-[5Ucz^tbwC/Tpn,%q\m7qY{J X-Hue: blue X-Attribution: GM Date: Mon, 11 Jan 2016 23:40:44 -0500 In-Reply-To: (Harald Hanche-Olsen's message of "Mon, 4 Jan 2016 00:18:52 +0000") Message-ID: <3tziwb4dgz.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22302 Cc: 22302@debbugs.gnu.org, Harald Hanche-Olsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Harald Hanche-Olsen wrote: > Run emacs -Q and insert this text: > Time-stamp: <> > > Then do: > M-: (require 'time-stamp) RET > M-x set-variable RET time-stamp-time-zone RET "UTC" RET > M-x time-stamp > > Expected result: A UTC time stamp is inserted. > Actual result: A time stamp in the local time zone is inserted. This is due to af32fa956. Paul, could you have a look please? From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 12:15:00 2016 Received: (at 22302-done) by debbugs.gnu.org; 12 Jan 2016 17:15:00 +0000 Received: from localhost ([127.0.0.1]:47489 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ2X6-0005Uh-A9 for submit@debbugs.gnu.org; Tue, 12 Jan 2016 12:15:00 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42579) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ2X3-0005UU-Ll for 22302-done@debbugs.gnu.org; Tue, 12 Jan 2016 12:14:58 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 27D5B160819; Tue, 12 Jan 2016 09:14:51 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id qPuUNv0TGUVb; Tue, 12 Jan 2016 09:14:50 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EA8541605E4; Tue, 12 Jan 2016 09:14:49 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id wWJyKDvRBgv6; Tue, 12 Jan 2016 09:14:49 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id CD7E41601E7; Tue, 12 Jan 2016 09:14:49 -0800 (PST) Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone To: Glenn Morris References: <3tziwb4dgz.fsf@fencepost.gnu.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <56953489.20700@cs.ucla.edu> Date: Tue, 12 Jan 2016 09:14:49 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <3tziwb4dgz.fsf@fencepost.gnu.org> Content-Type: multipart/mixed; boundary="------------000100080306070301040807" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22302-done Cc: 22302-done@debbugs.gnu.org, Harald Hanche-Olsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) This is a multi-part message in MIME format. --------------000100080306070301040807 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 01/11/2016 08:40 PM, Glenn Morris wrote: > Harald Hanche-Olsen wrote: > >> Run emacs -Q and insert this text: >> Time-stamp: <> >> >> Then do: >> M-: (require 'time-stamp) RET >> M-x set-variable RET time-stamp-time-zone RET "UTC" RET >> M-x time-stamp >> >> Expected result: A UTC time stamp is inserted. >> Actual result: A time stamp in the local time zone is inserted. > This is due to af32fa956. Paul, could you have a look please? Thanks for reporting this. I fixed the bug by installing the attached patch to emacs-25. By the way, the value "UTC" is not portable to non-GNU systems, and POSIX says that in theory it could cause Emacs to crash. The value should be "UTC0" or (in Emacs 25) t. I see that some of Emacs's own source files have this issue, and plan to look into that. --------------000100080306070301040807 Content-Type: text/x-patch; name="0001-Fix-time-stamp-time-zone-bugs-introduced-in-July.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Fix-time-stamp-time-zone-bugs-introduced-in-July.patch" >From 92f27b6928b99b75630cda663c4a726c0b8ec0bf Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 12 Jan 2016 09:09:27 -0800 Subject: [PATCH] Fix time-stamp-time-zone bugs introduced in July This fixes a bug introduced when the July changes to format-time-string installed, as the changes were not correctly handled in this module (Bug#22302). Also, document time stamp time zones. * lisp/time-stamp.el (time-stamp-time-zone): Document values better. (time-stamp--format): New private function. (time-stamp-string, time-stamp-string-preprocess) (time-stamp-do-number): Use it. * doc/emacs/files.texi (Time Stamps): Mention time zones. * doc/misc/autotype.texi (Timestamps): Document time-stamp-time-zone. --- doc/emacs/files.texi | 7 ++++--- doc/misc/autotype.texi | 8 +++++--- lisp/time-stamp.el | 48 ++++++++++++++++++++++++++---------------------- 3 files changed, 35 insertions(+), 28 deletions(-) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index bfa55d3..3d5562d 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -881,9 +881,10 @@ Time Stamps @code{before-save-hook} (@pxref{Hooks}). When you save the file, this function then automatically updates the time stamp with the current date and time. You can also use the command @kbd{M-x time-stamp} to -update the time stamp manually. For other customizations, see the -Custom group @code{time-stamp}. Note that the time stamp is formatted -according to your locale setting (@pxref{Environment}). +update the time stamp manually. By default the time stamp is +formatted according to your locale setting (@pxref{Environment}) and +time zone (@pxref{Time of Day,,, elisp, The Emacs Lisp Reference +Manual}). For customizations, see the Custom group @code{time-stamp}. @node Reverting @section Reverting a Buffer diff --git a/doc/misc/autotype.texi b/doc/misc/autotype.texi index 839782a..6bdbd34 100644 --- a/doc/misc/autotype.texi +++ b/doc/misc/autotype.texi @@ -531,15 +531,17 @@ Timestamps customization buffer. @vindex time-stamp-active +@findex time-stamp-toggle-active @vindex time-stamp-format -@vindex time-stamp-start +@vindex time-stamp-time-zone The time stamp is updated only if the customizable variable @code{time-stamp-active} is on, which it is by default; the command @code{time-stamp-toggle-active} can be used to toggle it. The format of -the time stamp is set by the customizable variable -@code{time-stamp-format}. +the time stamp is set by the customizable variables +@code{time-stamp-format} and @code{time-stamp-time-zone}. @vindex time-stamp-line-limit +@vindex time-stamp-start @vindex time-stamp-end @vindex time-stamp-count @vindex time-stamp-inserts-lines diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 46c993e..dffd590 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -121,9 +121,12 @@ time-stamp-old-format-warn :group 'time-stamp) (defcustom time-stamp-time-zone nil - "If non-nil, a string naming the timezone to be used by \\[time-stamp]. -Format is the same as that used by the environment variable TZ on your system." - :type '(choice (const nil) string) + "The time zone to be used by \\[time-stamp]. +Its format is that of the ZONE argument of the `format-time-string' function," + :type '(choice (const :tag "Emacs local time" nil) + (const :tag "Universal Time" t) + (const :tag "system wall clock time" wall) + (string :tag "TZ environment variable value")) :group 'time-stamp :version "20.1") ;;;###autoload(put 'time-stamp-time-zone 'safe-local-variable 'string-or-null-p) @@ -412,6 +415,8 @@ time-stamp-toggle-active (> (prefix-numeric-value arg) 0))) (message "time-stamp is now %s." (if time-stamp-active "active" "off"))) +(defun time-stamp--format (format time) + (format-time-string format time time-stamp-time-zone)) (defun time-stamp-string (&optional ts-format) "Generate the new string to be inserted by \\[time-stamp]. @@ -420,8 +425,7 @@ time-stamp-string (or ts-format (setq ts-format time-stamp-format)) (if (stringp ts-format) - (format-time-string (time-stamp-string-preprocess ts-format) - nil time-stamp-time-zone) + (time-stamp--format (time-stamp-string-preprocess ts-format) nil) ;; handle version 1 compatibility (cond ((or (eq time-stamp-old-format-warn 'error) (and (eq time-stamp-old-format-warn 'ask) @@ -515,32 +519,32 @@ time-stamp-string-preprocess "%%") ((eq cur-char ?a) ;day of week (if change-case - (format-time-string "%#a" time) + (time-stamp--format "%#a" time) (or alt-form (not (string-equal field-width "")) (time-stamp-conv-warn "%a" "%:a")) (if (and alt-form (not (string-equal field-width ""))) "" ;discourage "%:3a" - (format-time-string "%A" time)))) + (time-stamp--format "%A" time)))) ((eq cur-char ?A) (if alt-form - (format-time-string "%A" time) + (time-stamp--format "%A" time) (or change-case (not (string-equal field-width "")) (time-stamp-conv-warn "%A" "%#A")) - (format-time-string "%#A" time))) + (time-stamp--format "%#A" time))) ((eq cur-char ?b) ;month name (if change-case - (format-time-string "%#b" time) + (time-stamp--format "%#b" time) (or alt-form (not (string-equal field-width "")) (time-stamp-conv-warn "%b" "%:b")) (if (and alt-form (not (string-equal field-width ""))) "" ;discourage "%:3b" - (format-time-string "%B" time)))) + (time-stamp--format "%B" time)))) ((eq cur-char ?B) (if alt-form - (format-time-string "%B" time) + (time-stamp--format "%B" time) (or change-case (not (string-equal field-width "")) (time-stamp-conv-warn "%B" "%#B")) - (format-time-string "%#B" time))) + (time-stamp--format "%#B" time))) ((eq cur-char ?d) ;day of month, 1-31 (time-stamp-do-number cur-char alt-form field-width time)) ((eq cur-char ?H) ;hour, 0-23 @@ -554,27 +558,27 @@ time-stamp-string-preprocess ((eq cur-char ?p) ;am or pm (or change-case (time-stamp-conv-warn "%p" "%#p")) - (format-time-string "%#p" time)) + (time-stamp--format "%#p" time)) ((eq cur-char ?P) ;AM or PM - (format-time-string "%p" time)) + (time-stamp--format "%p" time)) ((eq cur-char ?S) ;seconds, 00-60 (time-stamp-do-number cur-char alt-form field-width time)) ((eq cur-char ?w) ;weekday number, Sunday is 0 - (format-time-string "%w" time)) + (time-stamp--format "%w" time)) ((eq cur-char ?y) ;year (or alt-form (not (string-equal field-width "")) (time-stamp-conv-warn "%y" "%:y")) - (string-to-number (format-time-string "%Y" time))) + (string-to-number (time-stamp--format "%Y" time))) ((eq cur-char ?Y) ;4-digit year, new style - (string-to-number (format-time-string "%Y" time))) + (string-to-number (time-stamp--format "%Y" time))) ((eq cur-char ?z) ;time zone lower case (if change-case "" ;discourage %z variations - (format-time-string "%#Z" time))) + (time-stamp--format "%#Z" time))) ((eq cur-char ?Z) (if change-case - (format-time-string "%#Z" time) - (format-time-string "%Z" time))) + (time-stamp--format "%#Z" time) + (time-stamp--format "%Z" time))) ((eq cur-char ?f) ;buffer-file-name, base name only (if buffer-file-name (file-name-nondirectory buffer-file-name) @@ -634,7 +638,7 @@ time-stamp-do-number (format "%%:%c" format-char))) (if (and alt-form (not (string-equal field-width ""))) "" ;discourage "%:2d" and the like - (string-to-number (format-time-string format-string time))))) + (string-to-number (time-stamp--format format-string time))))) (defvar time-stamp-conversion-warn t "Warn about soon-to-be-unsupported forms in `time-stamp-format'. -- 2.5.0 --------------000100080306070301040807-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 12:47:17 2016 Received: (at 22302-done) by debbugs.gnu.org; 12 Jan 2016 17:47:17 +0000 Received: from localhost ([127.0.0.1]:47502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ32L-0006Gm-DO for submit@debbugs.gnu.org; Tue, 12 Jan 2016 12:47:17 -0500 Received: from eggs.gnu.org ([208.118.235.92]:32836) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ32J-0006GZ-Ra for 22302-done@debbugs.gnu.org; Tue, 12 Jan 2016 12:47:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJ32E-0002yK-4S for 22302-done@debbugs.gnu.org; Tue, 12 Jan 2016 12:47:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:43136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ32B-0002xr-CK; Tue, 12 Jan 2016 12:47:07 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1aJ32A-00015O-5W; Tue, 12 Jan 2016 12:47:06 -0500 From: Glenn Morris To: Paul Eggert Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone References: <3tziwb4dgz.fsf@fencepost.gnu.org> <56953489.20700@cs.ucla.edu> X-Spook: White Powder Stranded FTS2000 jihad Plume Hostage X-Ran: __{HNf8#\5E3dCN[mTqu*lf>=#_f74A2][LN~jOiY[Wa (Paul Eggert's message of "Tue, 12 Jan 2016 09:14:49 -0800") Message-ID: <2hd1t63d2d.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22302-done Cc: 22302-done@debbugs.gnu.org, Harald Hanche-Olsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Paul Eggert wrote: > By the way, the value "UTC" is not portable to non-GNU systems, and > POSIX says that in theory it could cause Emacs to crash. Well, that sure sounds like a recipe for trouble. Please make it so that perfectly reasonable user-input can't crash Emacs. > The value should be "UTC0" or (in Emacs 25) t. I would guess that very few people are going to use "UTC0" instead of "UTC". Can't say I blame them. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 15:19:19 2016 Received: (at 22302-done) by debbugs.gnu.org; 12 Jan 2016 20:19:20 +0000 Received: from localhost ([127.0.0.1]:47567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ5PT-00031t-N5 for submit@debbugs.gnu.org; Tue, 12 Jan 2016 15:19:19 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:55577) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ5PS-00031h-LE for 22302-done@debbugs.gnu.org; Tue, 12 Jan 2016 15:19:19 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E1C3F1601E7; Tue, 12 Jan 2016 12:19:11 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id LzVphKx1FOqM; Tue, 12 Jan 2016 12:19:11 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 38C5C1606D6; Tue, 12 Jan 2016 12:19:11 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CP1DcqUCQGuP; Tue, 12 Jan 2016 12:19:11 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1EFCB1601E7; Tue, 12 Jan 2016 12:19:11 -0800 (PST) Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone To: Glenn Morris References: <3tziwb4dgz.fsf@fencepost.gnu.org> <56953489.20700@cs.ucla.edu> <2hd1t63d2d.fsf@fencepost.gnu.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <56955FBE.70806@cs.ucla.edu> Date: Tue, 12 Jan 2016 12:19:10 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <2hd1t63d2d.fsf@fencepost.gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22302-done Cc: 22302-done@debbugs.gnu.org, Harald Hanche-Olsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 01/12/2016 09:47 AM, Glenn Morris wrote: > Please make it so that perfectly reasonable user-input can't crash Emacs. Sorry, I take it back, in rereading the spec POSIX says merely that the behavior is unspecified when TZ="UTC", which I understand to mean that localtime_r should not crash so we don't need to worry about that in Emacs. However, the user might not get Universal Time, so "UTC0" is still safer. This is not an issue for operating systems like GNU/Linux, FreeBSD, OS X, and Solaris, where "UTC" means the same thing as "UTC0", because there's a file with a name like /usr/share/zoneinfo/UTC that does the right thing. I don't know what MS-Windows does with TZ="UTC" but I expect it works OK there too, otherwise we would have gotten bug reports before now (as this issue would come up even in older Emacs versions). I am mostly worried about obscure operating systems like HP-UX that do not use the tz database and which are not much tested by GNU Emacs developers. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 15:51:30 2016 Received: (at 22302) by debbugs.gnu.org; 12 Jan 2016 20:51:30 +0000 Received: from localhost ([127.0.0.1]:47577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ5ub-0003pS-SR for submit@debbugs.gnu.org; Tue, 12 Jan 2016 15:51:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52358) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ5ua-0003pC-1g for 22302@debbugs.gnu.org; Tue, 12 Jan 2016 15:51:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJ5uQ-00076F-UL for 22302@debbugs.gnu.org; Tue, 12 Jan 2016 15:51:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46006) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJ5uF-0006y2-3o; Tue, 12 Jan 2016 15:51:07 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4346 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aJ5uD-0004LB-WB; Tue, 12 Jan 2016 15:51:06 -0500 Date: Tue, 12 Jan 2016 22:51:15 +0200 Message-Id: <83wpreiksc.fsf@gnu.org> From: Eli Zaretskii To: Paul Eggert In-reply-to: <56955FBE.70806@cs.ucla.edu> (message from Paul Eggert on Tue, 12 Jan 2016 12:19:10 -0800) Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone References: <3tziwb4dgz.fsf@fencepost.gnu.org> <56953489.20700@cs.ucla.edu> <2hd1t63d2d.fsf@fencepost.gnu.org> <56955FBE.70806@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22302 Cc: rgm@gnu.org, 22302@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Eggert > Date: Tue, 12 Jan 2016 12:19:10 -0800 > Cc: 22302-done@debbugs.gnu.org, Harald Hanche-Olsen > > I don't know what MS-Windows does with TZ="UTC" Nothing. It doesn't understand that. The MS-Windows time routines need an explicit offset from UTC to be able to account for the timezone. So unless you say UTC-0, nothing will happen. From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 12 16:29:32 2016 Received: (at 22302) by debbugs.gnu.org; 12 Jan 2016 21:29:32 +0000 Received: from localhost ([127.0.0.1]:47599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ6VQ-0004j6-Lo for submit@debbugs.gnu.org; Tue, 12 Jan 2016 16:29:32 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:59302) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJ6VP-0004it-Ca for 22302@debbugs.gnu.org; Tue, 12 Jan 2016 16:29:31 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C16CA1606D6; Tue, 12 Jan 2016 13:29:24 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id XmmyVYW9RcB4; Tue, 12 Jan 2016 13:29:24 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 1357F160819; Tue, 12 Jan 2016 13:29:24 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id L2kPuR-1fF-K; Tue, 12 Jan 2016 13:29:23 -0800 (PST) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id EE1941601E7; Tue, 12 Jan 2016 13:29:23 -0800 (PST) Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone To: Eli Zaretskii References: <3tziwb4dgz.fsf@fencepost.gnu.org> <56953489.20700@cs.ucla.edu> <2hd1t63d2d.fsf@fencepost.gnu.org> <56955FBE.70806@cs.ucla.edu> <83wpreiksc.fsf@gnu.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <56957033.6090304@cs.ucla.edu> Date: Tue, 12 Jan 2016 13:29:23 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <83wpreiksc.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 22302 Cc: rgm@gnu.org, 22302@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 01/12/2016 12:51 PM, Eli Zaretskii wrote: >> don't know what MS-Windows does with TZ="UTC" > Nothing. It doesn't understand that. The MS-Windows time routines > need an explicit offset from UTC to be able to account for the > timezone. So unless you say UTC-0, nothing will happen. In that case I'm a bit puzzled. Before today, lines like this: # time-stamp-time-zone: "UTC" appeared in files like build-aux/gitlog-to-changelog. Emacs implements these lines by temporarily setting the TZ environment variable to "UTC". If that setting is ineffective on MS-Windows, presumably any relevant time stamps were generated in local time instead, which is not wanted. Perhaps no MS-Windows users noticed, or none of them bothered to file a bug report. Or perhaps "nothing will happen" means "no offset from UTC will be applied", which means that unrecognized TZ settings act like UTC; this is what tzcode does. Or it could be something else, though I don't know what. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 13 10:47:54 2016 Received: (at 22302) by debbugs.gnu.org; 13 Jan 2016 15:47:54 +0000 Received: from localhost ([127.0.0.1]:48398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJNeM-0000DV-Ch for submit@debbugs.gnu.org; Wed, 13 Jan 2016 10:47:54 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47429) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJNeL-0000DK-FP for 22302@debbugs.gnu.org; Wed, 13 Jan 2016 10:47:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJNeC-0002JB-GR for 22302@debbugs.gnu.org; Wed, 13 Jan 2016 10:47:48 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:59864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJNdy-00027k-Vm; Wed, 13 Jan 2016 10:47:30 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1580 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aJNdu-00008e-WB; Wed, 13 Jan 2016 10:47:27 -0500 Date: Wed, 13 Jan 2016 17:47:39 +0200 Message-Id: <83twmhiiqs.fsf@gnu.org> From: Eli Zaretskii To: Paul Eggert In-reply-to: <56957033.6090304@cs.ucla.edu> (message from Paul Eggert on Tue, 12 Jan 2016 13:29:23 -0800) Subject: Re: bug#22302: 25.1.50; time-stamp ignores time-stamp-time-zone References: <3tziwb4dgz.fsf@fencepost.gnu.org> <56953489.20700@cs.ucla.edu> <2hd1t63d2d.fsf@fencepost.gnu.org> <56955FBE.70806@cs.ucla.edu> <83wpreiksc.fsf@gnu.org> <56957033.6090304@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22302 Cc: rgm@gnu.org, 22302@debbugs.gnu.org, hanche@math.ntnu.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Cc: rgm@gnu.org, 22302@debbugs.gnu.org, hanche@math.ntnu.no > From: Paul Eggert > Date: Tue, 12 Jan 2016 13:29:23 -0800 > > On 01/12/2016 12:51 PM, Eli Zaretskii wrote: > >> don't know what MS-Windows does with TZ="UTC" > > Nothing. It doesn't understand that. The MS-Windows time routines > > need an explicit offset from UTC to be able to account for the > > timezone. So unless you say UTC-0, nothing will happen. > > In that case I'm a bit puzzled. Before today, lines like this: > > # time-stamp-time-zone: "UTC" > > appeared in files like build-aux/gitlog-to-changelog. Emacs implements > these lines by temporarily setting the TZ environment variable to "UTC". > If that setting is ineffective on MS-Windows, presumably any relevant > time stamps were generated in local time instead, which is not wanted. > > Perhaps no MS-Windows users noticed, or none of them bothered to file a > bug report. > > Or perhaps "nothing will happen" means "no offset from UTC will be > applied", which means that unrecognized TZ settings act like UTC; this > is what tzcode does. I see that what I said was inaccurate: the MS-Windows runtime indeed doesn't interpret the 3-letter TZ name, but if the offset is missing, it is taken as zero. So "UTC" will indeed be interpreted as "UTC+0" (and so will "EDT" and any other "XXX" with no offset). Of course, currently this doesn't work in time-stamp, for the reasons described in the original bug report. But format-time-string does behave on Windows as described above. Sorry for any confusion I could cause. From unknown Tue Jun 17 01:43:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 11 Feb 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator