all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* timezone-parse-date
@ 2005-07-08  5:32 N. Raghavendra
  2005-07-09  3:40 ` timezone-parse-date rgb
  0 siblings, 1 reply; 5+ messages in thread
From: N. Raghavendra @ 2005-07-08  5:32 UTC (permalink / 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: timezone-parse-date
  2005-07-08  5:32 timezone-parse-date N. Raghavendra
@ 2005-07-09  3:40 ` rgb
  2005-07-09  6:01   ` timezone-parse-date N. Raghavendra
  0 siblings, 1 reply; 5+ messages in thread
From: rgb @ 2005-07-09  3:40 UTC (permalink / raw)


> 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?

I'm running CVS Emacs and get ["1989" "3" "17" "4:01:3" "3"] too so
yes please submit to emacs-pretest-bug@gnu.org

^ permalink raw reply	[flat|nested] 5+ messages in thread

* timezone-parse-date
@ 2005-07-09  5:43 N. Raghavendra
  2005-07-10  5:19 ` timezone-parse-date Richard M. Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: N. Raghavendra @ 2005-07-09  5:43 UTC (permalink / raw)
  Cc: emacs-pretest-bug

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (i386--freebsd, X toolkit, Xaw3d scroll bars)
 of 2005-07-02 on riemann.mri.ernet.in
configured using `configure  --x-libraries=/usr/X11R6/lib --x-includes=/usr/X11R6/include --prefix=/usr/local i386--freebsd'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

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.
----------------------------------------------------------------------

Here is the change log entry, in case the above change is used:

----------------------------------------------------------------------
2005-07-09  N. Raghavendra  <raghu@mri.ernet.in>

        * timezone.el (timezone-parse-date): Changed the first regexp
          in the `cond' expression.
----------------------------------------------------------------------

I use Emacs 21.3, but I notice that the regexp is the same in the CVS
version.  Therefore, I am sending a copy of this message to
`emacs-pretest-bug@gnu.org' too.

Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | See message headers for contact
Harish-Chandra Research Institute   | and OpenPGP details.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: timezone-parse-date
  2005-07-09  3:40 ` timezone-parse-date rgb
@ 2005-07-09  6:01   ` N. Raghavendra
  0 siblings, 0 replies; 5+ messages in thread
From: N. Raghavendra @ 2005-07-09  6:01 UTC (permalink / raw)


At 2005-07-09T09:10:47+05:30, "rgb" <rbielaws@i1.net> wrote:

> > 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?
> 
> I'm running CVS Emacs and get ["1989" "3" "17" "4:01:3" "3"] too so
> yes please submit to emacs-pretest-bug@gnu.org

Thanks for the suggestion.  I have submitted the report.

Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | See message headers for contact
Harish-Chandra Research Institute   | and OpenPGP details.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: timezone-parse-date
  2005-07-09  5:43 timezone-parse-date N. Raghavendra
@ 2005-07-10  5:19 ` Richard M. Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard M. Stallman @ 2005-07-10  5:19 UTC (permalink / raw)
  Cc: emacs-pretest-bug, bug-gnu-emacs

Your fix is correct, and I will install it.  Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-07-10  5:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-09  5:43 timezone-parse-date N. Raghavendra
2005-07-10  5:19 ` timezone-parse-date Richard M. Stallman
  -- strict thread matches above, loose matches on Subject: below --
2005-07-08  5:32 timezone-parse-date N. Raghavendra
2005-07-09  3:40 ` timezone-parse-date rgb
2005-07-09  6:01   ` timezone-parse-date N. Raghavendra

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.