From xemacs-m  Sat Mar  1 07:52:58 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 HAA20516
	for <xemacs-beta@xemacs.org>; Sat, 1 Mar 1997 07:52:55 -0600 (CST)
Received: (from jens@localhost) by jens.metrix.de (8.7.6/8.7.3) id FAA02074; Sat, 1 Mar 1997 05:45:50 +0100
To: xemacs-beta@xemacs.org
Subject: xemacsify time.el.... 
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_Sat_Mar__1_05:45:48_1997-1"
Content-Transfer-Encoding: 7bit
From: Jens Lautenbacher <jens@metrix.de>
Date: 01 Mar 1997 05:45:48 +0100
Message-ID: <m3ybc8usn7.fsf@jens.metrix.de>
Lines: 183
X-Mailer: Gnus v5.4.15/XEmacs 19.15

--Multipart_Sat_Mar__1_05:45:48_1997-1
Content-Type: text/plain; charset=US-ASCII


Hi,

this patch and the two enclosed xpm's (which should reside in a
../etc/time directory) xemacsify the old time.el package by making the
mail indicator into a small yellow (letter) icon if mail is present
and a dim icon if not.

Additionally this provides for display-time-show-load which defaults
to t for compatibility and gives the user the possibility to switch
the load display off without actually having to change the whole
format spec.


--Multipart_Sat_Mar__1_05:45:48_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="letter.xpm"
Content-Transfer-Encoding: base64

LyogWFBNICovCnN0YXRpYyBjaGFyICogam1haWxfeHBtW10gPSB7CiIxOCAxMyA0IDEiLAoi
IAlzIE5vbmUJYyBOb25lIiwKIi4JYyBncmF5ODUiLAoiWAljIHllbGxvdyIsCiJvCWMgYmxh
Y2siLAoiICAgICAgICAgICAgICAgICAgIiwKIiAgICAgICAgICAgICAgICAgICIsCiIgICAu
WFhYWFhYWFhYWFguICAiLAoiICAgWG9YWFhYWFhYWFhvWG9vIiwKIiAgIFhYb1hYWFhYWFhv
WFhvbyIsCiIgICBYWFhvWFhYWFhvWFhYb28iLAoiICAgWFhYLm9YWFhvLlhYWG9vIiwKIiAg
IFhYWG8ub1hvLm9YWFhvbyIsCiIgICBYWG9YWFhvWFhYb1hYb28iLAoiICAgWG9YWFhYWFhY
WFhvWG9vIiwKIiAgIC5YWFhYWFhYWFhYWC5vbyIsCiIgICAgIG9vb29vb29vb29vb28iLAoi
ICAgICBvb29vb29vb29vb29vIn07Cg==

--Multipart_Sat_Mar__1_05:45:48_1997-1
Content-Type: text/plain; charset=US-ASCII



--Multipart_Sat_Mar__1_05:45:48_1997-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="no-letter.xpm"
Content-Transfer-Encoding: base64

LyogWFBNICovCnN0YXRpYyBjaGFyICogam1haWxfeHBtW10gPSB7CiIxOCAxMyAzIDEiLAoi
IAlzIE5vbmUJYyBOb25lIiwKIi4JYyBncmF5MzUiLAoibwljIGJsYWNrIiwKIiAgICAgICAg
ICAgICAgICAgICIsCiIgICAgICAgICAgICAgICAgICAiLAoiICAgLi4uLi4uLi4uLi4uLiAg
IiwKIiAgIC5vICAgICAgICAgby4gICIsCiIgICAuIG8gICAgICAgbyAuICAiLAoiICAgLiAg
byAgICAgbyAgLiAgIiwKIiAgIC4gIC5vICAgby4gIC4gICIsCiIgICAuICBvLm8gby5vICAu
ICAiLAoiICAgLiBvICAgbyAgIG8gLiAgIiwKIiAgIC5vICAgICAgICAgby4gICIsCiIgICAu
Li4uLi4uLi4uLi4uICAiLAoiICAgICAgICAgICAgICAgICAgIiwKIiAgICAgICAgICAgICAg
ICAgICJ9Owo=

--Multipart_Sat_Mar__1_05:45:48_1997-1
Content-Type: text/plain; charset=US-ASCII



--Multipart_Sat_Mar__1_05:45:48_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="time.patch"
Content-Transfer-Encoding: 7bit

*** time.el.orig	Sat Mar  1 05:35:33 1997
--- time.el	Sat Mar  1 05:29:37 1997
***************
*** 103,108 ****
--- 103,152 ----
    (start-itimer "display-time" 'display-time-function
  		display-time-interval display-time-interval))
  
+ (defvar display-time-show-load t)
+ 
+ (defvar display-time-show-icons-maybe t
+   "Use icons to indicate the mail status if we're running under X and
+ XEmacs was compiled with xpm support")
+ 
+ (defun display-time-get-icons-dir ()
+   (let ((path load-path)
+ 	dir elem)
+     (while (setq elem (pop path))
+       (setq dir (concat (directory-file-name elem) "/../etc/time/")) 
+       (if (file-directory-p dir) (setq path nil)
+ 	nil))
+     dir))
+ 
+ (defvar display-time-icons-dir (display-time-get-icons-dir))
+ 
+ (defvar display-time-mail-sign 
+   (progn
+     (let* ((file (concat display-time-icons-dir "letter.xpm"))
+ 	   (glyph (if (featurep 'xpm) (make-glyph file) nil))
+ 	   (display-time-mail-ext (detach-extent (make-extent 1 1))))
+       (if (and (featurep 'x) glyph
+ 	       (file-exists-p file))
+ 	  (cons display-time-mail-ext glyph)
+ 	" Mail")))
+   "A variable holding a string or a cons cell (ext . glyph) which gives
+ an indicator for unread mail. The default displays a xpm-file (a yellow letter)
+ if (feturep 'xpm) and (featurep 'x) are both t, a string \" Mail\" otherwise")
+ 
+ (defvar display-time-no-mail-sign
+     (progn
+     (let* ((file (concat display-time-icons-dir "no-letter.xpm"))
+ 	   (glyph (if (featurep 'xpm) (make-glyph file) nil))
+ 	   (display-time-mail-ext (detach-extent (make-extent 1 1))))
+       (if (and (featurep 'x) glyph
+ 	       (file-exists-p file))
+ 	  (cons display-time-mail-ext glyph)
+ 	"")))
+       "A variable holding a string or a cons cell (ext . glyph) which gives
+ an indicator for `no mail'. The default displays a xpm-file
+ if (feturep 'xpm) and (featurep 'x) are both t, and nothing otherwise")
+ 
+ 
  (defvar display-time-string-forms
    '((if display-time-day-and-date
          (format "%s %s %s " dayname monthname day)
***************
*** 111,130 ****
              (if display-time-24hr-format 24-hours 12-hours)
              minutes
              (if display-time-24hr-format "" am-pm))
!     load
!     (if mail " Mail" ""))
!   "*A list of expressions governing display of the time in the mode line.
  This expression is a list of expressions that can involve the keywords
  `load', `day', `month', and `year', `12-hours', `24-hours', `minutes',
  `seconds', all numbers in string form, and `monthname', `dayname', `am-pm',
! and `time-zone' all alphabetic strings, and `mail' a true/nil value.
  
  For example, the form
  
    '((substring year -2) \"/\" month \"/\" day
      \" \" 24-hours \":\" minutes \":\" seconds
!     (if time-zone \" (\") time-zone (if time-zone \")\")
!     (if mail \" Mail\" \"\"))
  
  would give mode line times like `94/12/30 21:07:48 (UTC)'.")
  
--- 155,177 ----
              (if display-time-24hr-format 24-hours 12-hours)
              minutes
              (if display-time-24hr-format "" am-pm))
!     (if display-time-show-load load)
!     (if (and (not display-time-show-icons-maybe) mail) " Mail" ""))
!     "*A list of expressions governing display of the time in the mode line.
  This expression is a list of expressions that can involve the keywords
  `load', `day', `month', and `year', `12-hours', `24-hours', `minutes',
  `seconds', all numbers in string form, and `monthname', `dayname', `am-pm',
! and `time-zone' all alphabetic strings and `mail' a true/nil string value.
! Beware: if display-time-show-icons-maybe is non-nil, the `mail' spec is also
! evaluated after this form and depending on it's result display-time-mail-sign
! or display-time-no-mail-sign is appended to the modeline string.
! This was made so you can also use xpm-files as mail indicator.
  
  For example, the form
  
    '((substring year -2) \"/\" month \"/\" day
      \" \" 24-hours \":\" minutes \":\" seconds
!     (if time-zone \" (\") time-zone (if time-zone \")\"))
  
  would give mode line times like `94/12/30 21:07:48 (UTC)'.")
  
***************
*** 176,181 ****
--- 223,234 ----
           (dayname (substring time 0 3)))
      (setq display-time-string
            (mapconcat 'eval display-time-string-forms ""))
+     (if (and mail display-time-show-icons-maybe)
+ 	(setq display-time-string
+ 	      (list display-time-string display-time-mail-sign))
+       (if display-time-show-icons-maybe
+ 	  (setq display-time-string
+ 		(list display-time-string display-time-no-mail-sign))))
      ;; This is inside the let binding, but we are not going to document
      ;; what variables are available.
      (run-hooks 'display-time-hook))

--Multipart_Sat_Mar__1_05:45:48_1997-1
Content-Type: text/plain; charset=US-ASCII

 

--Multipart_Sat_Mar__1_05:45:48_1997-1--

