[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/time.el
From: |
Pavel Janík |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/time.el |
Date: |
Sun, 27 Jan 2002 13:14:56 -0500 |
Index: emacs/lisp/time.el
diff -c emacs/lisp/time.el:1.73 emacs/lisp/time.el:1.74
*** emacs/lisp/time.el:1.73 Sat Jan 19 09:05:57 2002
--- emacs/lisp/time.el Sun Jan 27 13:14:55 2002
***************
*** 1,6 ****
;;; time.el --- display time, load and mail indicator in mode line of Emacs
! ;; Copyright (C) 1985, 86, 87, 93, 94, 96, 2000, 2001
;; Free Software Foundation, Inc.
;; Maintainer: FSF
--- 1,6 ----
;;; time.el --- display time, load and mail indicator in mode line of Emacs
! ;; Copyright (C) 1985, 86, 87, 93, 94, 96, 2000, 2001, 2002
;; Free Software Foundation, Inc.
;; Maintainer: FSF
***************
*** 44,52 ****
(file :format "%v"))
:group 'display-time)
(defcustom display-time-mail-function nil
"*Function to call, for indicating existence of new mail.
! nil means use the default method of checking `display-time-mail-file'."
:type '(choice (const :tag "Default" nil)
(function))
:group 'display-time)
--- 44,61 ----
(file :format "%v"))
:group 'display-time)
+ (defcustom display-time-mail-directory nil
+ "*Name of mail inbox directory, for indicating existence of new mail.
+ Non-nil and not a string means don't check for mail.
+ When nil, no checking for mail in directory is done."
+ :type '(choice (const :tag "None" nil)
+ (directory :format "%v"))
+ :group 'display-time)
+
(defcustom display-time-mail-function nil
"*Function to call, for indicating existence of new mail.
! nil means use the default method of checking `display-time-mail-file'
! or files in `display-time-mail-directory'."
:type '(choice (const :tag "Default" nil)
(function))
:group 'display-time)
***************
*** 118,124 ****
:type 'face)
(defvar display-time-mail-icon
! (find-image '((:type xbm :file "letter.xbm" :ascent center)))
"Image specification to offer as the mail indicator on a graphic
display. See `display-time-use-mail-icon' and
`display-time-mail-face'.")
--- 127,134 ----
:type 'face)
(defvar display-time-mail-icon
! (find-image '((:type xpm :file "letter.xpm" :ascent center)
! (:type xbm :file "letter.xbm" :ascent center)))
"Image specification to offer as the mail indicator on a graphic
display. See `display-time-use-mail-icon' and
`display-time-mail-face'.")
***************
*** 158,164 ****
,@(list :background (face-attribute
display-time-mail-face
:background)))
! 'help-echo "mouse-2: Read mail"
'local-map (make-mode-line-mouse-map 'mouse-2
read-mail-command)))
""))
--- 168,174 ----
,@(list :background (face-attribute
display-time-mail-face
:background)))
! 'help-echo "You have new mail; mouse-2: Read mail"
'local-map (make-mode-line-mouse-map 'mouse-2
read-mail-command)))
""))
***************
*** 214,219 ****
--- 224,242 ----
(display-time-update)
(sit-for 0))
+ (defun display-time-mail-check-directory ()
+ (let ((mail-files (directory-files display-time-mail-directory t))
+ (size 0))
+ (while (and mail-files (= size 0))
+ ;; Count size of regular files only.
+ (setq size (+ size (or (and (file-regular-p (car mail-files))
+ (nth 7 (file-attributes (car mail-files))))
+ 0)))
+ (setq mail-files (cdr mail-files)))
+ (if (> size 0)
+ size
+ nil)))
+
;; Update the display-time info for the mode line
;; but don't redisplay right now. This is used for
;; things like Rmail `g' that want to force an update
***************
*** 247,252 ****
--- 270,277 ----
(user-login-name))))
(mail (or (and display-time-mail-function
(funcall display-time-mail-function))
+ (and display-time-mail-directory
+ (display-time-mail-check-directory))
(and (stringp mail-spool-file)
(or (null display-time-server-down-time)
;; If have been down for 20 min, try again.