From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "N. Raghavendra" Newsgroups: gmane.emacs.help Subject: timezone-parse-date Date: 08 Jul 2005 11:02:11 +0530 Organization: SunSITE.dk - Supporting Open source Message-ID: <86u0j5kgmc.fsf@riemann.mri.ernet.in> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1120822850 2448 80.91.229.2 (8 Jul 2005 11:40:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 8 Jul 2005 11:40:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 08 13:40:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DqrCy-0001GF-4Y for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jul 2005 13:39:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DqrEN-0001VV-CI for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Jul 2005 07:41:19 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!news.banetele.no!dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help X-Organization: Harish-Chandra Research Institute (HRI) X-Address: Chhatnag Road, Jhusi, Allahabad 211 019, India X-URL: http://www.mri.ernet.in/ X-Phone: +91 (532) 2667 509, 2667 318, 2667 578, 2567 746, 2567 747 X-Fax: +91 (532) 2667 576, 2567 748, 2567 444, 2568 036 X-OpenPGP-Key-ID: 0x03618806 X-OpenPGP-Key-Fingerprint: C75D D0AF 457E 7454 BEC2 37AD C6E1 0407 0361 8806 X-OpenPGP-Public-Key-Available-At: http://www.keyserver.net/ User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Lines: 42 Original-NNTP-Posting-Host: 202.41.87.100 Original-X-Trace: news.sunsite.dk DXC=oi?>fO6i_R:1@QH[VaTAe9YSB=nbEKnk; l58mSL^b028ID5_U; QN1Y3=JDn=l3B; k=ATKI?[mLM1; hGV>7]YX4k; gHjgfQ@2_C< Original-X-Complaints-To: staff@sunsite.dk Original-Xref: shelby.stanford.edu gnu.emacs.help:132362 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:27840 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:27840 The form (timezone-parse-date "Fri, 17 Mar 89 4:01:33") evaluates to the vector ["1989" "3" "17" "4:01:3" "3"] The documentation for the function says "Parse DATE and return a vector [YEAR MONTH DAY TIME TIMEZONE]. ... TIMEZONE is nil for DATEs without a zone field." Therefore, the last element of the above vector should be `nil'. As I understand, the problem is caused by the first regular expression in the `cond' expression in `timezone-parse-date'. The following patch seems to solve the problem: ---------------------------------------------------------------------- diff -ruN emacs/lisp/timezone.el emacs-new/lisp/timezone.el --- emacs/lisp/timezone.el Fri Jul 8 16:54:48 2005 +++ emacs-new/lisp/timezone.el Fri Jul 8 16:56:05 2005 @@ -149,7 +149,7 @@ (time nil) (zone nil)) ;This may be nil. (cond ((string-match - "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]*\\([-+a-zA-Z0-9]+\\)" date) + "\\([0-9]+\\)[ \t]+\\([^ \t,]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+:[0-9:]+\\)[ \t]+\\([-+a-zA-Z0-9]+\\)" date) ;; Styles: (1) and (2) with timezone and buggy timezone ;; This is most common in mail and news, ;; so it is worth trying first. ---------------------------------------------------------------------- I use Emacs 21.3, but I notice that the regexp is the same in the CVS version. Should I submit a bug report or a patch? Raghavendra. -- N. Raghavendra | See message headers for contact Harish-Chandra Research Institute | and OpenPGP details.