Gnus development mailing list
 help / color / mirror / Atom feed
From: Colin Rafferty <craffert@spspme.ml.com>
Subject: Re: Feature request: time dependent hiliting
Date: 01 Oct 1996 19:33:13 -0400	[thread overview]
Message-ID: <ocr3ezy8dl2.fsf_-_@spssunp.spspme.ml.com> (raw)
In-Reply-To: Colin Rafferty's message of 01 Oct 1996 17:00:52 -0400

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


  reply	other threads:[~1996-10-01 23:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-01 14:54 David Moore
1996-10-01 21:00 ` [++] " Colin Rafferty
1996-10-01 23:33   ` Colin Rafferty [this message]
1996-10-02  0:33   ` Lars Magne Ingebrigtsen
1996-10-01 21:59 ` Roderick Schertler

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=ocr3ezy8dl2.fsf_-_@spssunp.spspme.ml.com \
    --to=craffert@spspme.ml.com \
    --cc=craffert@ml.com \
    /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).