From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Bug in format-time-string in emacs 21.1? Date: 13 Mar 2002 19:49:35 +0000 Sender: emacs-devel-admin@gnu.org Message-ID: References: <200203122221.g2CMLEX10014@shade.twinsun.com> <200203122337.g2CNax910197@shade.twinsun.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1016049982 4655 127.0.0.1 (13 Mar 2002 20:06:22 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 13 Mar 2002 20:06:22 +0000 (UTC) Cc: emacs-devel@gnu.org Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16lF0w-0001Cz-00 for ; Wed, 13 Mar 2002 21:06:22 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16lF3h-0000yb-00 for ; Wed, 13 Mar 2002 21:09:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16lF0i-0001tE-00; Wed, 13 Mar 2002 15:06:08 -0500 Original-Received: from tungsten.btinternet.com ([194.73.73.81]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16lExx-0001hL-00 for ; Wed, 13 Mar 2002 15:03:17 -0500 Original-Received: from host213-122-253-129.in-addr.btopenworld.com ([213.122.253.129] helo=nyaumo.btinternet.com) by tungsten.btinternet.com with esmtp (Exim 3.22 #8) id 16lExp-0000ri-00; Wed, 13 Mar 2002 20:03:09 +0000 Original-Received: from nyaumo.btinternet.com (localhost [127.0.0.1]) by nyaumo.btinternet.com (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id TAA00449; Wed, 13 Mar 2002 19:49:36 GMT Original-To: Paul Eggert In-Reply-To: <200203122337.g2CNax910197@shade.twinsun.com> Original-Lines: 62 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:1916 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1916 Paul Eggert writes: > > From: Jason Rumney > > Date: 12 Mar 2002 22:56:44 +0000 > > > > after experimenting with all the documented format specifiers, it > > seems that "%h" is the only one that does not work with the current code > > Surely you not have tested this exhaustively. I didn't test all the %O and %E permutations, as the documentation was vague about which format specifiers they are supposed to work with. It turns out that they do not work on Windows either, though the symptoms are different; %h returns "", while %OY returns "%OY". > > some effort has obviously already been made to make the other > > specifiers that are not supported by the system strftime function > > work. > > I think you may be reading too much into the code here. %C, %G, %g, %V are not supported by the underlying library function either, but they work. That is why I concluded that some effort has already been made to accommodate systems that do not support those format specifiers. > For example, for the %OY format the system merely invokes the > underlying strftime; if the underlying strftime mishandles %OY then > there is no workaround. Perhaps %OY would be better approximated by %Y on systems that do not support it. At least the information gets to the user, even if it is in a different format. So in this respect, %h is similar to %OY, > %Ea, and lots of other formats. > > > > In the case of "%h", it is documented as doing the same as "%b", so > > we can fix that easily. > > But that will introduce either minor runtime overhead, or > hard-to-maintain Microsoft-version-specific ifdefs, I don't propose making this Microsoft-specific. There are likely to be other systems that do not support %h %O and %E, in which case the same conditional code should be used. > and I doubt whether either belongs in the GNU C Library source code > (which is where strftime.c lives). Really? Why does the GNU C Library have all that complicated conditional code to handle the case where it is not the GNU C Library. Surely this code would be better separated into the GNU C Library version (without that code) and the Emacs version (without the special code for the GNU C Library). Most of the conditional code could then disappear. -- Jason Rumney _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel