Gnus development mailing list
 help / color / mirror / Atom feed
From: craffert@ml.com (Colin Rafferty)
Cc: Jason L Tibbitts III <tibbs@uh.edu>
Subject: Re: date group last read
Date: 13 Feb 1996 17:02:25 -0500	[thread overview]
Message-ID: <ocr7mxqyjda.fsf@spssunp.ml.com> (raw)
In-Reply-To: Jason L Tibbitts III's message of 13 Feb 1996 13:58:38 -0600

Jason L Tibbitts writes:
>>>>>> "JLT" == Jason L Tibbitts <tibbs@hpc.uh.edu> 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 <tibbs#uh.edu>'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)


      reply	other threads:[~1996-02-13 22:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-02-09 17:30 Roderick Schertler
1996-02-09 21:44 ` Lars Magne Ingebrigtsen
1996-02-11 18:07   ` Brian Edmonds
1996-02-12  6:36     ` Jason L Tibbitts III
1996-02-12 18:22       ` Lars Magne Ingebrigtsen
1996-02-12 23:15         ` Jason L Tibbitts III
1996-02-13 19:58           ` Jason L Tibbitts III
1996-02-13 22:02             ` Colin Rafferty [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ocr7mxqyjda.fsf@spssunp.ml.com \
    --to=craffert@ml.com \
    --cc=tibbs@uh.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).