From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8148 Path: main.gmane.org!not-for-mail From: Roderick Schertler Newsgroups: gmane.emacs.gnus.general Subject: Re: Feature request: time dependent hiliting Date: 01 Oct 1996 17:59:04 -0400 Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035148356 10390 80.91.224.250 (20 Oct 2002 21:12:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:12:36 +0000 (UTC) Cc: ding@ifi.uio.no Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.6/8.6.9) with SMTP id PAA10043 for ; Tue, 1 Oct 1996 15:22:56 -0700 Original-Received: from relay2.smtp.psi.net (relay2.smtp.psi.net [38.8.188.2]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Wed, 2 Oct 1996 00:01:04 +0200 Original-Received: from uu6.psi.com by relay2.smtp.psi.net (8.6.12/SMI-5.4-PSI) id SAA02340; Tue, 1 Oct 1996 18:00:57 -0400 Original-Received: by uu6.psi.com (5.65b/4.0.071791-PSI/PSINet) via UUCP; id AA03744 for dmoore@UCSD.EDU; Tue, 1 Oct 96 18:00:55 -0400 Original-Received: from eeyore.ibcinc.com with ESMTP by junior.ibcinc.com (8.6.13/IBC-1.30) id RAA06067; Tue, 1 Oct 1996 17:59:01 -0400 Original-Received: by eeyore.ibcinc.com (8.6.13/IBC-s-1.4) id VAA07919; Tue, 1 Oct 1996 21:59:04 GMT Original-To: David Moore Xref: main.gmane.org gmane.emacs.gnus.general:8148 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8148 On 01 Oct 1996 07:54:02 -0700, David Moore said: > > I'd find it extremely useful if groups could be colored based on the > amount of time since I last read them. I got this from a helpful member of the list (Sorry! I didn't record who you were.) Add (add-hook 'gnus-select-group-hook (lambda () (gnus-group-set-parameter group 'gnus-group-date-last-entered (current-time)))) to your ~/.gnus then you can use (gnus-group-get-parameter gnus-tmp-group 'gnus-group-date-last-entered) inside a user format escape to retrieve the date and do something with it. I use (setq gnus-group-line-format "%M%p%P %2ud %2ut %S %5y: %L %(%-40uc%) %18ue\n") along with (defun gnus-user-format-function-e (headers) (let ((prev (gnus-group-get-parameter gnus-tmp-group 'gnus-group-date-last-entered))) (if (not prev) "" (let* ((diff (- (rjs-time-to-epoch (current-time)) (rjs-time-to-epoch prev))) (days (/ diff (* 60 60 24))) (diff (- diff (* days 60 60 24))) (hours (/ diff (* 60 60))) (diff (- diff (* hours 60 60))) (minutes (/ diff 60)) (diff (- diff (* minutes 60))) (seconds diff) (diff nil)) (if (zerop days) (format "%2d:%02d" hours minutes) (substring "------------------------------" 0 (min 30 days))))))) (which I'm sure is suboptimal, I don't know lisp very well). This makes the *Group* buffer look something like * 71 34 0: 2 mail.perl5-porters 1:31 * 4 0: 2 comp.lang.perl.misc 0:01 1 3 23: 2 mail.ding - 241: 2 mail.freebsd.questions 23:52 24: 2 mail.freebsd.ports - 3 7: 2 mail.ssh -- 7: 2 mail.freebsd.security -- 2: 2 mail.freebsd.chat -- 1: 2 comp.windows.x.announce --- 37: 3 comp.mail.mh ------ 57: 3 va.forsale ------ 70: 3 comp.mail.mime ----------- 525: 3 comp.dcom.sys.cisco ------------------ , the rightmost field is either the amount of time it's been since I entered the group (if it's < 1 day) or a histogram of one dash per day since I entered the group. -- Roderick Schertler roderick@gate.net