Gnus development mailing list
 help / color / mirror / Atom feed
* bug in gnus-encode-date (in gnus-util.el) with patch
@ 1997-05-31  8:01 Darren/Torin/Who Ever...
  0 siblings, 0 replies; only message in thread
From: Darren/Torin/Who Ever... @ 1997-05-31  8:01 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----

gnus-encode-date is a handy little function that will turn a mail header
date into an Emacs date.  Useful for user-format functions.

Unfortunately, it has a bug.  It calls timezone-parse-date for the meaty
work returning an array of time elements which are then passed to
encode-time in the appropriate order.  The problem occurs since
timezone-parse-date just returns whatever timezone data was in the
message and encode-time expects the timezone data to be in seconds off
of GMT.

The following (simple) patch fixes this.  It's indented two spaces to
foil patch mangling by pgp.  (patch will still like it.)

  --- gnus-5.4.55.old/lisp/gnus-util.el	Sat May 17 22:37:16 1997
  +++ gnus-5.4.55/lisp/gnus-util.el	Thu May 29 19:14:59 1997
  @@ -255,7 +255,7 @@
	   (date (mapcar (lambda (d) (and d (string-to-int d))) parse))
	   (time (mapcar 'string-to-int (timezone-parse-time (aref parse 3)))))
       (encode-time (caddr time) (cadr time) (car time)
  -		 (caddr date) (cadr date) (car date) (nth 4 date))))
  +		 (caddr date) (cadr date) (car date) (* 60 (timezone-zone-to-minute (nth 4 date))))))

   (defun gnus-time-minus (t1 t2)
     "Subtract two internal times."


Darren
- -- 
<torin@daft.com> <http://www.daft.com/~torin> <torin@debian.org> <torin@io.com>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Do you have your clothes on? I probably don't. Take yours off. Feel better. @
@ Sysadmin, webweaver, postmaster for hire.  C/Perl/CGI programmer and tutor. @

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBM4/ayI4wrq++1Ls5AQFtkAP+K+6wnAJx60vxdHiOxrP/pmNJafG1FLqh
QiVNbe8N93T1aj1Zw9/mpT2m35ehr1Fno0hF4qTuLW/92qHyY0kCO9ooCz1ai+ud
qCBePxZdR3qli2u5zKMjeLc0zINd4ja390QYCO6TodCxSGsBEcUqb+Np2fMzRq03
xqsKU9Oqg40=
=riTU
-----END PGP SIGNATURE-----


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-05-31  8:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-31  8:01 bug in gnus-encode-date (in gnus-util.el) with patch Darren/Torin/Who Ever...

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 NNTP newsgroup(s).