unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "N. Raghavendra" <raghu@mri.ernet.in>
Subject: timezone-parse-date
Date: 08 Jul 2005 11:02:11 +0530	[thread overview]
Message-ID: <86u0j5kgmc.fsf@riemann.mri.ernet.in> (raw)

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 <raghu@mri.ernet.in> | See message headers for contact
Harish-Chandra Research Institute | and OpenPGP details.

             reply	other threads:[~2005-07-08  5:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-08  5:32 N. Raghavendra [this message]
2005-07-09  3:40 ` timezone-parse-date rgb
2005-07-09  6:01   ` timezone-parse-date N. Raghavendra

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=86u0j5kgmc.fsf@riemann.mri.ernet.in \
    --to=raghu@mri.ernet.in \
    /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.
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).