Gnus development mailing list
 help / color / mirror / Atom feed
* Feature request: time dependent hiliting
@ 1996-10-01 14:54 David Moore
  1996-10-01 21:00 ` [++] " Colin Rafferty
  1996-10-01 21:59 ` Roderick Schertler
  0 siblings, 2 replies; 5+ messages in thread
From: David Moore @ 1996-10-01 14:54 UTC (permalink / raw)



	I'd find it extremely useful if groups could be colored based on
the amount of time since I last read them.  Or perhaps on a time to the
oldest unread article (although that might be more difficult).  There
are a few groups which tend to have low traffic, so I prefer to let
messages accumulate and read them in batches, but I need to watch out
for news server expiry.  It'd also be good to know just how long it's
been since I haven't read someone's mail.

	Hmm, I guess in the mail case using the oldest unread article
would be good, because I sometimes 'M c' a messsage when I want to get
back to it.  I use '!' to let me know about things which I'm going to
relook at again for myself, as opposed to sending someone a reply.

	With VM I used labels for some of these, by labeling mail to
which I needed to reply and having those available in a seperate virtual
group.  This doesn't help with newsgroups, and I would think time info
for mail would be better than the labels.

-- 
David Moore <dmoore@ucsd.edu>       | SysAdmin/Programmer       __o
UCSD Dept. of Anesthesiology - 0629 | Work: (619) 534-3865    _ \<,_
La Jolla, CA 92093-0629             | Fax:  (619) 534-1445   (_)/ (_)
<URL:http://oj.egbt.org/dmoore/>    | Solo Furnace Creek 508 -- 1996!


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [++] Re: Feature request: time dependent hiliting
  1996-10-01 14:54 Feature request: time dependent hiliting David Moore
@ 1996-10-01 21:00 ` Colin Rafferty
  1996-10-01 23:33   ` Colin Rafferty
  1996-10-02  0:33   ` [++] " Lars Magne Ingebrigtsen
  1996-10-01 21:59 ` Roderick Schertler
  1 sibling, 2 replies; 5+ messages in thread
From: Colin Rafferty @ 1996-10-01 21:00 UTC (permalink / raw)


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.

Below is the code that I use.  When I select a group, I save a formatted
string of the current time as a group parameter.  I then use %ud in the
group-line-format to call a function that gets that parameter out.

If you follow this basic strategy, it should be cool.

.emacs:

(add-hook 'gnus-select-group-hook 'gnus-select-group-hook-update-current-time)

(defun gnus-select-group-hook-update-current-time ()
  "For consideration as a `gnus-select-group-hook'."
  (let ((now (current-time-string)))
    (gnus-group-set-parameter group
			      'gnus-group-date-last-entered
			      (concat (substring now 8 11)
				      (substring now 4 8)
				      (substring now 11 16)))))


(setq gnus-group-line-format "%M%S%p%5y: %(%-35g%) %ud\n")

(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 "")))

-- 
This posting adheres to the SELF-DISCIPLINE guidelines for better
USENET discussions. See http://www.eiffel.com/discipline.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Feature request: time dependent hiliting
  1996-10-01 14:54 Feature request: time dependent hiliting David Moore
  1996-10-01 21:00 ` [++] " Colin Rafferty
@ 1996-10-01 21:59 ` Roderick Schertler
  1 sibling, 0 replies; 5+ messages in thread
From: Roderick Schertler @ 1996-10-01 21:59 UTC (permalink / raw)
  Cc: ding

On 01 Oct 1996 07:54:02 -0700, David Moore <dmoore@UCSD.EDU> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Feature request: time dependent hiliting
  1996-10-01 21:00 ` [++] " Colin Rafferty
@ 1996-10-01 23:33   ` Colin Rafferty
  1996-10-02  0:33   ` [++] " Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Colin Rafferty @ 1996-10-01 23:33 UTC (permalink / raw)


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [++] Re: Feature request: time dependent hiliting
  1996-10-01 21:00 ` [++] " Colin Rafferty
  1996-10-01 23:33   ` Colin Rafferty
@ 1996-10-02  0:33   ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-10-02  0:33 UTC (permalink / raw)


Colin Rafferty <craffert@spspme.ml.com> writes:

> 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.

Yup.  I've now added something very similar to Red Gnus 0.47.

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-10-02  0:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-01 14:54 Feature request: time dependent hiliting David Moore
1996-10-01 21:00 ` [++] " Colin Rafferty
1996-10-01 23:33   ` Colin Rafferty
1996-10-02  0:33   ` [++] " Lars Magne Ingebrigtsen
1996-10-01 21:59 ` Roderick Schertler

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).