From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/13853 Path: main.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.gnus.general Subject: patch: gnus-article-time-format; extending customization Date: 09 Feb 1998 14:04:19 +0200 Sender: owner-ding@hpc.uh.edu Message-ID: Reply-To: jari.aalto@ntc.nokia.com NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: multipart/mixed; boundary="Multipart_Mon_Feb__9_14:04:19_1998-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035153144 11509 80.91.224.250 (20 Oct 2002 22:32:24 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:32:24 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id EAA25408 for ; Mon, 9 Feb 1998 04:10:23 -0800 Original-Received: from gizmo.hpc.uh.edu (gizmo.hpc.uh.edu [129.7.102.31]) by xemacs.org (8.8.5/8.8.5) with ESMTP id GAA25725 for ; Mon, 9 Feb 1998 06:07:21 -0600 (CST) Original-Received: from sina.hpc.uh.edu (sina.hpc.uh.edu [129.7.3.5]) by gizmo.hpc.uh.edu (8.7.6/8.7.3) with ESMTP id GAN05169; Mon, 9 Feb 1998 06:43:38 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 09 Feb 1998 06:05:06 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by sina.hpc.uh.edu (8.7.3/8.7.3) with SMTP id GAA21151 for ; Mon, 9 Feb 1998 06:04:53 -0600 (CST) Original-Received: (qmail 11850 invoked by uid 504); 9 Feb 1998 12:04:41 -0000 Original-Received: (qmail 11847 invoked from network); 9 Feb 1998 12:04:41 -0000 Original-Received: from axl01it.ntc.nokia.com (131.228.118.232) by claymore.vcinet.com with SMTP; 9 Feb 1998 12:04:41 -0000 Original-Received: from zeus.tele.nokia.fi (zeus.tele.nokia.fi [131.228.134.50]) by axl01it.ntc.nokia.com (8.8.5/8.6.9) with SMTP id OAA14873 for ; Mon, 9 Feb 1998 14:03:34 +0200 (EET) Original-Received: from pegasus.tele.nokia.fi (pegasus.ntc.nokia.com [131.228.169.148]) by zeus.tele.nokia.fi (8.6.4/8.6.4) with ESMTP id OAA13737 for ; Mon, 9 Feb 1998 14:05:44 +0200 Original-Received: (from jaalto@localhost) by pegasus.tele.nokia.fi (8.7.5/8.7.1) id OAA15305; Mon, 9 Feb 1998 14:04:21 +0200 (EET) Original-To: Ding mailing list X-info: Quassia Gnus v0.22 Original-Lines: 77 X-Mailer: Quassia Gnus v0.22/Emacs 19.34 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:13853 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:13853 --Multipart_Mon_Feb__9_14:04:19_1998-1 Content-Type: text/plain; charset=US-ASCII I follewed the discussion about the Date values and at the same time I noticed that the 'user option restricted to only formats known to `format-time-string' function. The following patch will extend the variable gnus-article-time-format to accept a function symbol as well, so that user can have complete control over generated Date: field. In my case I prefer seeing the both lapsed time (without seconds) and the ISO date in the same field, like this after hitting W t s Date: 1 hour, 45 minutes -- 1998-02-09 12:08 Mon EET The patch makes this possible. (I have signed and returned the Gnus disclaimer) Cheers! jari --Multipart_Mon_Feb__9_14:04:19_1998-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="gnus-art.el.diff" Content-Transfer-Encoding: 7bit Prereq: 1.1 =================================================================== RCS file: RCS/gnus-art.el,v retrieving revision 1.1 diff -u -bw -r1.1 gnus-art.el --- 1.1 1998/02/09 11:39:48 +++ gnus-art.el 1998/02/09 11:56:00 @@ -247,8 +247,12 @@ (defcustom gnus-article-time-format "%a, %b %d %Y %T %Z" "Format for display of Date headers in article bodies. -See `format-time-string' for the possible values." - :type 'string +See `format-time-string' for the possible values. + +The avalue can also be function symbol, which should return a complete +'Date: ' header. Function is called with one argument, `date' which can +be feed to `format-time-string'." + :type '(choice string symbol) :link '(custom-manual "(gnus)Article Date") :group 'gnus-article-washing) @@ -1336,6 +1340,13 @@ (concat "Date: " date)) ;; Let the user define the format. ((eq type 'user) + (if (symbolp gnus-article-time-format) + (funcall + gnus-article-time-format + (ignore-errors + (gnus-encode-date + (timezone-make-date-arpa-standard + date nil "UT")))) (concat "Date: " (format-time-string gnus-article-time-format @@ -1342,7 +1353,7 @@ (ignore-errors (gnus-encode-date (timezone-make-date-arpa-standard - date nil "UT")))))) + date nil "UT"))))))) ;; Do an X-Sent lapsed format. ((eq type 'lapsed) ;; If the date is seriously mangled, the timezone functions are --Multipart_Mon_Feb__9_14:04:19_1998-1--