From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/39358 Path: main.gmane.org!not-for-mail From: Frank Schmitt Newsgroups: gmane.emacs.gnus.general Subject: Re: [patch] age depending date-format Date: Wed, 17 Oct 2001 18:09:42 +0200 Organization: Hamme net, kren mer och nimmi Sender: owner-ding@hpc.uh.edu Message-ID: <1yk29rjt.fsf@hschmi22.userfqdn.rz-online.de> References: Reply-To: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1035175076 27438 80.91.224.250 (21 Oct 2002 04:37:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:37:56 +0000 (UTC) Return-Path: Original-Received: (qmail 23492 invoked from network); 17 Oct 2001 16:26:33 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 17 Oct 2001 16:26:33 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 15ttW5-0000v0-00; Wed, 17 Oct 2001 11:26:01 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 17 Oct 2001 11:25:39 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id LAA06277 for ; Wed, 17 Oct 2001 11:25:28 -0500 (CDT) Original-Received: (qmail 23467 invoked by alias); 17 Oct 2001 16:25:26 -0000 Original-Received: (qmail 23462 invoked from network); 17 Oct 2001 16:25:26 -0000 Original-Received: from quimby.gnus.org (195.204.10.139) by gnus.org with SMTP; 17 Oct 2001 16:25:26 -0000 Original-Received: (from news@localhost) by quimby.gnus.org (8.9.3/8.9.3) id SAA09709 for ding@gnus.org; Wed, 17 Oct 2001 18:25:23 +0200 (CEST) Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 47 Original-NNTP-Posting-Host: pppin109.max-hochsimmer.rz-online.net Original-X-Trace: quimby.gnus.org 1003335923 7646 212.7.169.109 (17 Oct 2001 16:25:23 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 17 Oct 2001 16:25:23 GMT User-Agent: Gnus/5.090004 (Oort Gnus v0.04) XEmacs/21.4 (Academic Rigor) Hamster/1.3.23.0 X-Face: "?Hv7MyYveeGDm66,O\f[l6!L*,`Q)c&3'8{9UGIM`EO8<3ASfX`8}W+u;F},&V%/y+cz(z&spQ(`CkKzCJY/@0R]aM#[W7*$(,QA-oO0f}Z2S0Y0~b5}|XDhQds[9}=t$Hf%G2c;zR%;$"~eI+dw3Gy!xKw=oduK(-, Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:39358 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:39358 "Yair Friedman (Jerusalem)" writes: >>gnus-user-date formats the date accordingly to >>gnus-user-date-day >>gnus-user-date-week >>gnus-user-date-old > >Can we have gnus-user-date-month and gnus-user-date-year as well? I'm just working on it. I'll do it the Gnus way: As configurable as possible. Therefor I'll do it like ShengHuo suggested: gnus-user date calculates the difference between the current date and the date it gets as argument. Then it looks in a variable gnus-user-date-format-alist for the first element with a value bigger than the calculated difference and format the date according to the specified value. gnus-user-date-format-alist will look like this: (defvar gnus-user-data-format-alist '((seconds-today "%k:%M") (604800 "%a %k:%M") (seconds-this-month "%a %d") (seconds-this-year "%b %d") (t "%b %m '%y)) ;;this one is used when no other does match "Blah blah") The seconds-* are (will be) functions which return the seconds since today 00:00, since the 1st of this month 00:00, since the 1st of january of this year 00:00. So today the function would do the following: gnus-user-date("Wed, 17 Oct 2001 13:34:39 +0200")=13:39 gnus-user-date("Sun, 14 Oct 2001 13:34:39 +0200")=Sun 13:39 gnus-user-date("Sun, 07 Oct 2001 13:34:39 +0200")=Sun 17 gnus-user-date("Sun, 30 Sep 2001 13:34:39 +0200")=Sep 30 gnus-user-date("Sun, 14 Oct 1999 13:34:39 +0200")=Oct 14 '99 Are this nice default values? I don't really know about the international conventions for this. -- One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them In the Land of Mordor where the Shadows lie. 19. Dezember 2001