From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8150 Path: main.gmane.org!not-for-mail From: Colin Rafferty Newsgroups: gmane.emacs.gnus.general Subject: Re: Feature request: time dependent hiliting Date: 01 Oct 1996 19:33:13 -0400 Message-ID: References: Reply-To: Colin Rafferty NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035148358 10409 80.91.224.250 (20 Oct 2002 21:12:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:12:38 +0000 (UTC) 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 RAA11802 for ; Tue, 1 Oct 1996 17:13:03 -0700 Original-Received: from mlfire.ml.com (mlfire.ml.com [192.246.100.1]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Wed, 2 Oct 1996 01:33:54 +0200 Original-Received: from commpost.ml.com ([146.125.4.24]) by mlfire.ml.com (8.7.5/8.7.3/MLgw-2.07) with SMTP id TAA05049 for ; Tue, 1 Oct 1996 19:35:13 -0400 (EDT) Original-Received: from spssunp.spspme.ml.com (spssunp.spspme.ml.com [192.168.111.13]) by commpost.ml.com (8.6.12/8.6.12) with ESMTP id TAA05386 for ; Tue, 1 Oct 1996 19:33:59 -0400 Original-Received: by spssunp.spspme.ml.com (SMI-8.6/SMI-4.1) id TAA11061; Tue, 1 Oct 1996 19:33:15 -0400 Original-To: (ding) GNUS Mailing List X-Face: D>:hrrB{l6#\wU;)0R:OHSTA@ayd.Oq?s@Rrc;[+z0m+<-U"$G-J6L)F2QY`qK~uPu!s1(6{\#uy!Ag/D)?'L[}xErXvxoPn8T_hKi{M]/(`BF{e}X7;hby`p\.E$rJ}Aff#BT,rdDIw\y X-Y-Zippy: Can I have an IMPULSE ITEM instead? In-Reply-To: Colin Rafferty's message of 01 Oct 1996 17:00:52 -0400 Original-Lines: 58 X-Mailer: Red Gnus v0.42/XEmacs 19.14 Xref: main.gmane.org gmane.emacs.gnus.general:8150 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8150 Am I allowed to follow-up to my own postings? Colin Rafferty writes: > David Moore writes: >> I'd find it extremely useful if groups could be colored based on >> the amount of time since I last read them. >> It'd also be good to know just how long it's been since I haven't read >> someone's mail. > There was a discussion a long time ago about this. The basic solution > is to save the current time in a group parameter, and access it in a > user-format-function for display. I have a better strategy than I first posted. I thought about it a little more, and realized that I should be saving current-time (as Roderick does). I also like the look of lapsed time, so I now have the following in my .emacs: (defun gnus-select-group-hook-update-current-time () "For consideration as a `gnus-select-group-hook'." (gnus-group-set-parameter group 'gnus-group-time-last-entered (current-time))) (add-hook 'gnus-select-group-hook 'gnus-select-group-hook-update-current-time) (defun gnus-user-format-function-d (headers) "Return how long it has been since group was last entered." (let ((then (gnus-group-get-parameter gnus-tmp-group 'gnus-group-time-last-entered))) (if then (let ((orig (article-make-date-line (timezone-make-date-arpa-standard (current-time-string then) (current-time-zone then)) 'lapsed))) (if (string-match "^[^:]*: \\([0-9]+ [a-z]+\\).* \\([a-z]+\\)\n$" orig) (concat (substring orig (match-beginning 1) (match-end 1)) " " (substring orig (match-beginning 2) (match-end 2))) "")) ""))) This tells me how old everything is, rounded down to the nearest units. It would work for stuff that is years old. Here is what is now in my *Group*: [ freedom -- 11 ] 1: nnml:list.censor.internet 5 seconds ago 10: nnml:list.censor.fight 1 day ago [ emacs -- 0 ] 4: nnml:list.ding 8 minutes ago 167: comp.emacs.xemacs 6 days ago 75: comp.emacs 6 days ago 151: gnu.emacs.gnus 1 week ago -- Colin