From xemacs-m  Thu Mar 13 14:38:49 1997
Received: from jens.metrix.de (jens@jens.metrix.de [194.123.88.124])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id OAA05196
	for <xemacs-beta@xemacs.org>; Thu, 13 Mar 1997 14:38:39 -0600 (CST)
Received: (from jens@localhost) by jens.metrix.de (8.7.6/8.7.3) id VAA01006; Thu, 13 Mar 1997 21:37:55 +0100
To: xemacs-beta@xemacs.org
Subject: Re: patch to time.el
References: <ocr67yvvay7.fsf@spssunp.spspme.ml.com>
X-Face: Z[@OB)("ZvE?ev~1b+b!0ZUB.$%rh.9qE>dVf>q}Q/V?%d`J3gd!LR\aAZ8<Hwi]xTA(:*c;i3,?K?+rCy*^b$)a,}E?eo},}x2]5LlJysyoUOK"o[>K)'\Ulb7y-7*.If^;rHl['oa)n_M7E6w+LDKMs"G8_`c)uOS1^}.1|8Ill]7X68X-paeUOpBhz<F`B0?~^2Et~GYfw~/0]H]nx4~C_E/_mp#^7Ixc:
Reply-To: jens@lemming0.lem.uni-karlsruhe.de
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: multipart/mixed;
 boundary="Multipart_Thu_Mar_13_21:37:51_1997-1"
Content-Transfer-Encoding: 7bit
From: Jens Lautenbacher <jens@metrix.de>
Date: 13 Mar 1997 21:37:52 +0100
In-Reply-To: Colin Rafferty's message of 13 Mar 1997 14:38:56 -0500
Message-ID: <m3k9nbmstb.fsf@jens.metrix.de>
Lines: 125
X-Mailer: Gnus v5.4.24/XEmacs 19.15

--Multipart_Thu_Mar_13_21:37:51_1997-1
Content-Type: text/plain; charset=US-ASCII

Colin Rafferty <craffert@ml.com> writes:

> Howdy-
> 
> I love the new mail icon.  In fact, it has made me get rid of xbiff and
> switch to display-time.  I have one nit to pick (and I have patched
> time.el to get rid of the nit).
> 
> I prefer the mail icon to mean that there is new mail in the mailbox
> since the last time I looked, not that there is any mail at all.
> 
> I have added a variable `display-time-ignore-read-mail' whose non-nil
> value gives the old logic, but a nil value handles read mail.

As gnus (and vm as I belive) always empty the system mailbox, there was
never a difference for me... But nevertheless I think you're
right. time.el should behave your way. 

I patched my latest version with this, added customization support,
and even made it the default. The patch is appended below. It also
removes some compiler warnings (nothing important)


--Multipart_Thu_Mar_13_21:37:51_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="timepatch"
Content-Transfer-Encoding: 7bit

*** time.el.orig	Wed Mar 12 23:48:41 1997
--- time.el	Thu Mar 13 21:21:01 1997
***************
*** 95,100 ****
--- 95,105 ----
     "Time when mail file's file system was recorded to be down.
  If that file system seems to be up, the value is nil.")
  
+ (defcustom display-time-ignore-read-mail nil
+   "*Non-nil means displays the mail icon on any non-empty mailbox."
+   :group 'display-time
+   :type 'boolean)
+ 
  ;;;###autoload
  (defun display-time ()
    "Display current time, load level, and mail flag in mode line of each buffer.
***************
*** 282,294 ****
         
  (defun display-time-convert-num (time-string &optional textual)
    (let ((list (display-time-string-to-char-list time-string))
! 	elem result tmp)
      (if (not (display-time-can-do-graphical-display textual)) time-string 
        (while (setq elem (pop list))
  	(push (eval (intern-soft (concat "display-time-"
  					 (char-to-string elem)
  					 "-glyph"))) tmp))
!       (setq result (reverse tmp))))) 
  
  (defun display-time-convert-load (load-string &optional textual)
    (let ((load-number (string-to-number load-string))
--- 287,299 ----
         
  (defun display-time-convert-num (time-string &optional textual)
    (let ((list (display-time-string-to-char-list time-string))
! 	elem tmp)
      (if (not (display-time-can-do-graphical-display textual)) time-string 
        (while (setq elem (pop list))
  	(push (eval (intern-soft (concat "display-time-"
  					 (char-to-string elem)
  					 "-glyph"))) tmp))
!       (reverse tmp)))) 
  
  (defun display-time-convert-load (load-string &optional textual)
    (let ((load-number (string-to-number load-string))
***************
*** 581,587 ****
  	    (save-window-excursion
  	      (select-window (minibuffer-window))
  	      (erase-buffer)
! 	      (indent-to (- (screen-width) (length display-time-string) 1))
  	      (insert display-time-string)
  	      (message (buffer-string)))))
      (force-mode-line-update)
--- 586,592 ----
  	    (save-window-excursion
  	      (select-window (minibuffer-window))
  	      (erase-buffer)
! 	      (indent-to (- (frame-width) (length display-time-string) 1))
  	      (insert display-time-string)
  	      (message (buffer-string)))))
      (force-mode-line-update)
***************
*** 589,596 ****
      (sit-for 0)))
  
  (defun display-time-file-nonempty-p (file)
!   (and (file-exists-p file)
!        (< 0 (nth 7 (file-attributes (file-chase-links file))))))
  
  (provide 'time)
  
--- 594,606 ----
      (sit-for 0)))
  
  (defun display-time-file-nonempty-p (file)
!   (let ((attributes (file-attributes (file-chase-links file))))
!     (and attributes
! 	 (< 0 (nth 7 attributes))
! 	 (or display-time-ignore-read-mail
! 	     (> (car (nth 5 attributes)) (car (nth 4 attributes)))
! 	     (and (= (car (nth 5 attributes)) (car (nth 4 attributes)))
! 		  (> (cadr (nth 5 attributes)) (cadr (nth 4 attributes))))))))
  
  (provide 'time)
  

--Multipart_Thu_Mar_13_21:37:51_1997-1
Content-Type: text/plain; charset=US-ASCII

 


--Multipart_Thu_Mar_13_21:37:51_1997-1--

