From: Eli Zaretskii <eliz@gnu.org>
To: Jason Rumney <jasonr@gnu.org>, Paul Eggert <eggert@cs.ucla.edu>
Cc: 9794@debbugs.gnu.org
Subject: bug#9794: 24.0.90; `format-time-string' no good for %Z
Date: Wed, 19 Oct 2011 18:08:59 +0200 [thread overview]
Message-ID: <83pqhtt144.fsf@gnu.org> (raw)
In-Reply-To: <87fwipgltl.fsf@gnu.org>
> From: Jason Rumney <jasonr@gnu.org>
> Cc: Drew Adams <drew.adams@oracle.com>, 9794@debbugs.gnu.org
> Date: Wed, 19 Oct 2011 21:20:06 +0800
>
> One proposal in that thread was to introduce a new format specifier to
> print the long names (on non-Windows platforms it could output the
> commonly used "Continent/City" format). Another proposal was that %EZ
> could be used, which is especially fitting, for the Windows timezone
> names, which are apparently locale sensitive (which was one of the
> reported problems that led to them being removed in the first place).
I used the %EZ format proposed by Andreas Schwab, and came up with
the Windows-specific patch below.
Paul, would such a change be acceptable by gnulib?
=== modified file 'ChangeLog'
--- ChangeLog 2011-10-18 18:12:53 +0000
+++ ChangeLog 2011-10-19 16:02:14 +0000
@@ -1,3 +1,8 @@
+2011-10-19 Eli Zaretskii <eliz@gnu.org>
+
+ * lib/strftime.c (strftime_case_) [_WIN32 || __WIN32__]: Provide
+ non-empty time-zone string only for the %EZ format specifier.
+
2011-10-18 Jan Djärv <jan.h.d@swipnet.se>
* configure.in (GLIB_REQUIRED, GTK_REQUIRED): Set to 2.10 (Bug#9786).
=== modified file 'lib/strftime.c'
--- lib/strftime.c 2011-03-31 04:24:03 +0000
+++ lib/strftime.c 2011-10-19 15:48:42 +0000
@@ -1302,6 +1302,12 @@ strftime_case_ (bool upcase, STREAM_OR_C
}
#if HAVE_TZNAME
+#if (defined _WIN32 || defined __WIN32__)
+ /* Microsoft runtime produces time-zone names that are not
+ RFC822 compliant, and are also localized. So we only
+ produce them for %EZ. */
+ if (modifier == L_('E'))
+#endif
/* The tzset() call might have changed the value. */
if (!(zone && *zone) && tp->tm_isdst >= 0)
zone = tzname[tp->tm_isdst != 0];
=== modified file 'nt/ChangeLog'
--- nt/ChangeLog 2011-09-04 21:52:59 +0000
+++ nt/ChangeLog 2011-10-19 16:02:25 +0000
@@ -1,3 +1,7 @@
+2011-10-19 Eli Zaretskii <eliz@gnu.org>
+
+ * config.nt (HAVE_TZNAME, HAVE_DECL_TZNAME): Define.
+
2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
* config.nt (HAVE_SNPRINTF): New macro.
=== modified file 'nt/config.nt'
--- nt/config.nt 2011-09-26 03:20:03 +0000
+++ nt/config.nt 2011-10-19 15:57:12 +0000
@@ -187,7 +187,14 @@ along with GNU Emacs. If not, see <http
#undef TM_IN_SYS_TIME
#undef HAVE_TM_ZONE
-#undef HAVE_TZNAME
+
+/* Define to 1 if you don't have `tm_zone' but do have the external array
+ `tzname'. */
+#define HAVE_TZNAME 1
+
+/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
+ */
+#define HAVE_DECL_TZNAME 1
#undef const
next prev parent reply other threads:[~2011-10-19 16:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-19 6:44 bug#9794: 24.0.90; `format-time-string' no good for %Z Drew Adams
2011-10-19 7:43 ` Drew Adams
2011-10-19 8:33 ` Eli Zaretskii
2011-10-19 13:20 ` Jason Rumney
2011-10-19 14:28 ` Drew Adams
2011-10-19 15:26 ` Eli Zaretskii
2011-10-19 16:08 ` Eli Zaretskii [this message]
2011-10-20 7:48 ` Paul Eggert
2011-10-20 9:24 ` Eli Zaretskii
2011-10-20 9:46 ` Andreas Schwab
2011-10-20 10:05 ` Eli Zaretskii
2011-10-20 10:10 ` Andreas Schwab
2011-10-20 10:49 ` Eli Zaretskii
2011-10-20 11:22 ` Andreas Schwab
2011-10-20 12:58 ` Eli Zaretskii
2011-10-20 13:06 ` Andreas Schwab
2011-10-20 13:18 ` Eli Zaretskii
2011-10-20 15:23 ` Paul Eggert
2011-10-20 16:03 ` Eli Zaretskii
2011-10-21 15:40 ` Jason Rumney
2011-10-21 17:34 ` Paul Eggert
2011-10-22 9:21 ` bug#641: " Eli Zaretskii
2011-10-19 14:29 ` Drew Adams
2011-10-19 15:13 ` Eli Zaretskii
2011-10-19 7:47 ` Eli Zaretskii
2011-10-19 14:28 ` Drew Adams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83pqhtt144.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=9794@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=jasonr@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).