From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/39275 Path: main.gmane.org!not-for-mail From: Frank Schmitt Newsgroups: gmane.emacs.gnus.general Subject: [Code] New date-format for summary-line Date: Mon, 15 Oct 2001 00:03:48 +0200 Organization: Hamme net, kren mer och nimmi Sender: owner-ding@hpc.uh.edu Message-ID: 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 1035175008 27017 80.91.224.250 (21 Oct 2002 04:36:48 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 04:36:48 +0000 (UTC) Return-Path: Original-Received: (qmail 19126 invoked from network); 14 Oct 2001 22:05:50 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 14 Oct 2001 22:05:50 -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 15stL6-0000Fu-00; Sun, 14 Oct 2001 17:02:32 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 14 Oct 2001 17:02:09 -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 RAA18958 for ; Sun, 14 Oct 2001 17:01:54 -0500 (CDT) Original-Received: (qmail 19090 invoked by alias); 14 Oct 2001 22:02:10 -0000 Original-Received: (qmail 19085 invoked from network); 14 Oct 2001 22:02:09 -0000 Original-Received: from quimby.gnus.org (195.204.10.139) by gnus.org with SMTP; 14 Oct 2001 22:02:09 -0000 Original-Received: (from news@localhost) by quimby.gnus.org (8.9.3/8.9.3) id AAA04983 for ding@gnus.org; Mon, 15 Oct 2001 00:02:07 +0200 (CEST) Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 43 Original-NNTP-Posting-Host: pppin100.max-hochsimmer.rz-online.net Original-X-Trace: quimby.gnus.org 1003096926 17848 212.7.169.100 (14 Oct 2001 22:02:06 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: 14 Oct 2001 22:02:06 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:39275 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:39275 Hi all. The following function gives you the possibility to have different date-formats in gnus-summary-line depending on if the article is of today, this week, or older. I think the best place for this function would be gnus-util.el (at least there are the other gnus-date functions. There should be a new item in gnus-summary-line-format-alist like this: (?q (gnus-user-date (mail-header-date gnus-tmp-header)) ?s) It's my first lisp code, so don't hit me to hard if it's bullshit. At least it does work over here. ;;there should be of course defvars for those three variables (setq gnus-user-date-format-day "%k:%M") (setq gnus-user-date-format-week "%a %k:%M") (setq gnus-user-date-format-old "%d.%m.") (defun gnus-user-date (messy-date) "Format the messy-date acording to gnus-user-date-format-*" (condition-case () (progn (setq messy-date (safe-date-to-time messy-date)) (setq now (current-time)) (setq differenz (+ (lsh (- (car now) (car messy-date)) 16) (- (car (cdr now)) (car (cdr messy-date))))) (setq now (decode-time now)) (setq my-format gnus-user-date-format-old) (if (> (- (+ (car now) (* (car (cdr now)) 60) (* (car (nthcdr 2 now)) 3600)) differenz) -1) ;;today (setq my-format gnus-user-date-format-day) (if (< differenz 604801) ;;this week (setq my-format gnus-user-date-format-week))) (format-time-string (eval my-format) messy-date)) (error " - "))) -- 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