From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/5105 Path: main.gmane.org!not-for-mail From: craffert@ml.com (Colin Rafferty) Newsgroups: gmane.emacs.gnus.general Subject: Re: date group last read Date: 13 Feb 1996 17:02:25 -0500 Sender: craffert@spssunp.sps.ml.com Message-ID: References: <6593.823887034@ibcinc.com> <199602111807.KAA16663@edmonds.home.cs.ubc.ca> <199602120636.AAA25639@sina.hpc.uh.edu> <199602122315.RAA18152@sina.hpc.uh.edu> Reply-To: Colin Rafferty NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035145754 31820 80.91.224.250 (20 Oct 2002 20:29:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:29:14 +0000 (UTC) Cc: Jason L Tibbitts III Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by miranova.com (8.7.3/8.6.9) with SMTP id OAA01847 for ; Tue, 13 Feb 1996 14:46:16 -0800 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 ; Tue, 13 Feb 1996 23:03:21 +0100 Original-Received: from commpost.ml.com ([146.125.4.24]) by mlfire.ml.com (8.6.12/8.6.12) with ESMTP id RAA08783; Tue, 13 Feb 1996 17:04:46 -0500 Original-Received: from sparc10.sps.ml.com ([192.168.111.24]) by commpost.ml.com (8.6.12/8.6.12) with SMTP id RAA22343; Tue, 13 Feb 1996 17:04:24 -0500 (EST) Original-Received: from spssunp.masdev.ml.com by sparc10.sps.ml.com (4.1/SMI-4.1) id AA22267; Tue, 13 Feb 96 17:02:43 EST Original-Received: by spssunp.masdev.ml.com (4.1/SMI-4.1) id AA28591; Tue, 13 Feb 96 17:02:33 EST Original-To: (ding) GNUS Mailing List In-Reply-To: Jason L Tibbitts III's message of 13 Feb 1996 13:58:38 -0600 Original-Lines: 58 X-Face: ""xJff%{>hr-{:QXl"Xk2O@@(+F]e{"%EYQiW@mUuvEsL>=mx96j12qW[%m;|:B^n{J8k?Mz[K1_+H;$v,nYx^1o_=4M,L+]FIU~[[`-w~~xsy-BX,?tAF_.8u&0y*@aCv;a}Y'{w@#*@iwAl?oZpvvv X-Y-Zippy: Actually, what I'd like is a little toy spaceship!! Xref: main.gmane.org gmane.emacs.gnus.general:5105 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:5105 Jason L Tibbitts writes: >>>>>> "JLT" == Jason L Tibbitts writes: JLT> It's pretty easy to do externally (no gnus changes required). This JLT> has been tested lightly. > And, it seems, not enough. gnus-group-add-parameter will blindly add a > parameter even if it already exists, causing a pile of the same parameter > to add up. This could be considered a bug. Currently *-add-parameter just > conses the new parameter to the existing list; it should probably check for > its existence first. My lisp isn't good enough to patch it myself. I have written a new function, gnus-group-set-parameter that will replace an already existing parameter. I have also altered Jason's lisp so that it saves the date in a cons cell rather than a list. Anyway, I think that my function might be useful in Gnus itself, while Jason's should probably be in my .gnus. By the way, this will get rid of all the duplicate entries in the parameter list that have crept in. ; New function: (defun gnus-group-set-parameter (group name value) "Set parameter NAME to VALUE in GROUP." (let ((info (gnus-get-info group))) (if (not info) () ; This is a dead group. We just ignore it. (let ((old-params (gnus-info-params info)) (new-params (list (cons name value)))) (while old-params (if (or (not (listp (car old-params))) (not (eq (car (car old-params)) name))) (setq new-params (append new-params (list (car old-params))))) (setq old-params (cdr old-params))) (gnus-group-set-info new-params group 'params))))) ; Slight alteration of Jason L Tibbitts III 's code: (add-hook 'gnus-select-group-hook (lambda () (gnus-group-set-parameter group 'gnus-group-date-last-entered (substring (current-time-string) 4 16)))) (defun gnus-user-format-function-d (headers) "Return the date the group was last read." (cond ((gnus-group-get-parameter gnus-tmp-group 'gnus-group-date-last-entered)) (t ""))) ; .sig follows -- Colin Rafferty Violate the Communications Decency Act. "...shit, piss, fuck, cunt, cocksucker, mother-fucker, and tits." -FCC v. Pacifica Foundation 438 U.S. 726 (1978)