Gnus development mailing list
 help / color / mirror / Atom feed
From: David Moore <dmoore@UCSD.EDU>
Cc: XEmacs Beta Discussion List <xemacs-beta-discuss@xemacs.org>
Subject: Re: gnus date suggestion
Date: 12 Jan 1997 14:07:54 -0800	[thread overview]
Message-ID: <rvd8vah7id.fsf@sdnp5.ucsd.edu> (raw)
In-Reply-To: jason@mastaler.com's message of 12 Jan 1997 14:12:38 -0500

jason@mastaler.com (Jason R. Mastaler) writes:

> Don't you think it would be more standard and helpful for gnus to
> display the day of the week in the "Date" mail header by default?
>
> Gnus =       Date: 12 Jan 1997 13:17:58 -0500
> MH/Mozilla = Date: Sun, 12 Jan 1997 14:06:24 -0500
> ELM/Pine =   Date: Sun, 12 Jan 1997 14:08:29 -0500 (EST)


	Yeah, that might be nice, or more generally provide you with a
format for displaying article times.  Gnus currently uses
timezone-make-date-arpa-standard to generate those times, but that is
only truly needed in message.el for outgoing messages.

	It'd be great to be able to use format-time-string for this.
And I just spent an hour trying to fake it out to do so, but it's not
friendly enough.


Thoughts & proposal:

	Being able to do that helps a lot with strftime in general,
which is why one should try to provide that functionality whenever
you make strftime available to people.  And also the ability to tell it
not to use 'localtime' on the time but 'gmtime'.  This is great, because
you can then use strftime to display time deltas conviently also.  If
something runs N seconds, but you want it in hour, minute, second format
you just do (format-time-string "%H:%M:%S" (list 0 N) t).

	And if you want'd to have differently displayed time messages in
Gnus, you could use something like:

(defcustom gnus-article-time-format "%a, %b %d %Y %T %Z"
  "Format for display of Date headers in article bodies.
See `format-time-zone' for the possible values."
  :type 'string
  :group 'article)


(defun gnus-art-make-date (date &optional local timezone)
  (let ((tz-date (timezone-fix-time date local timezone)))
    (format-time-string "%a, %b %d %Y %T %Z"
			(encode-time (aref tz-date 5) (aref tz-date 4)
				     (aref tz-date 3) (aref tz-date 2) 
				     (aref tz-date 1) (aref tz-date 0)
				     (aref tz-date 6))
			(aref tz-date 6) ; let %Z get the right name
		  ))
    ))


Proposed changed interface to format-time-string:

format-time-string: (FORMAT-STRING TIME &optional ZONE)
  -- a built-in function.
Use FORMAT-STRING to format the time TIME.
TIME is specified as (HIGH LOW . IGNORED) or (HIGH . LOW), as from
`current-time' and `file-attributes'.
FORMAT-STRING may contain %-sequences to substitute parts of the time.
ZONE defaults to the current time zone rule.  This can be a string
(as from `set-time-zone-rule'), or it can be a list
(as from `current-time-zone'), or an integer (as from `decode-time')
applied without consideration for daylight savings time, or it can be
T which specifies the time is a delta rather than a true time.


	I would like to see this, or equivalent functionality, in
xemacs (and gnu emacs), and I'm quite willing to code it, if there is a
consensus on how it should be done.


-- 
David Moore <dmoore@ucsd.edu>       | Computer Systems Lab      __o
UCSD Dept. Computer Science - 0114  | Work: (619) 534-8604    _ \<,_
La Jolla, CA 92093-0114             | Fax:  (619) 534-1445   (_)/ (_)
<URL:http://oj.egbt.org/dmoore/>    | In cloud bones of steel.


  reply	other threads:[~1997-01-12 22:07 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-12 19:12 Jason R. Mastaler
1997-01-12 22:07 ` David Moore [this message]
1997-01-15  1:09   ` Lars Magne Ingebrigtsen
1997-05-01 14:21   ` Jason R. Mastaler
1997-05-01 21:30     ` François Pinard
1997-05-03  4:17       ` Jason R. Mastaler
1997-05-03 14:53         ` François Pinard
1997-05-03 15:13           ` Hrvoje Niksic
1997-05-03 16:41             ` Lars Magne Ingebrigtsen
1997-05-05  6:45               ` Steinar Bang
1997-05-08 12:39                 ` Lars Magne Ingebrigtsen
1997-05-03 17:31             ` Jason R. Mastaler
1997-08-05 23:07             ` François Pinard
     [not found]               ` <x73eooi146.fsf@peorth.gweep.net>
1997-08-08  5:43                 ` Greg Stark
1997-05-03 15:35           ` Johan Danielsson
1997-08-05 22:59             ` François Pinard
1997-08-06 23:11               ` Kyle Jones
1997-08-07 16:32                 ` Johan Danielsson
1997-10-21 14:04                 ` François Pinard
1997-10-21 19:03                   ` Jason R Mastaler
1997-10-21 19:59                     ` Valdis.Kletnieks
1998-02-08 19:06                     ` François Pinard
1998-02-08 19:55                       ` Lars Magne Ingebrigtsen
1998-02-08 20:09                       ` Kyle Jones
1998-02-09  1:13                         ` François Pinard
1998-02-09 10:06                           ` Per Abrahamsen
1998-02-09 15:31                           ` Lars Magne Ingebrigtsen
1998-02-08 22:53                       ` Jason R Mastaler
1998-02-09  3:49                       ` Stephen J. Turnbull
1998-02-09 15:49                         ` Lars Magne Ingebrigtsen
1997-05-03  8:14       ` David Moore
1997-05-04  0:00       ` Ken Raeburn
1997-05-02  4:53     ` Paul Graham
1997-05-02  5:17       ` Jason R. Mastaler
1997-05-03  8:19     ` David Moore
1997-05-03  8:40       ` Steven L Baur
1997-05-03  9:15         ` Hrvoje Niksic
1997-05-03  8:58       ` Per Abrahamsen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rvd8vah7id.fsf@sdnp5.ucsd.edu \
    --to=dmoore@ucsd.edu \
    --cc=xemacs-beta-discuss@xemacs.org \
    /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 NNTP newsgroup(s).