-;;;###autoload
-(defun display-time-mode (arg)
- "Toggle display of time, load level, and mail flag in mode lines.
-With a numeric arg, enable this display if arg is positive.
-
-When this display is enabled, it updates automatically every minute.
-If `display-time-day-and-date' is non-nil, the current day and date
-are displayed as well.
-This runs the normal hook `display-time-hook' after each update."
- (interactive "P")
- (let ((on (if (null arg)
- (not display-time-timer)
- (> (prefix-numeric-value arg) 0))))
- (setq display-time-mode on)
- (and display-time-timer (cancel-timer display-time-timer))
- (setq display-time-timer nil)
- (setq display-time-string "")
- (or global-mode-string (setq global-mode-string '("")))
- (if on
- (progn
- (or (memq 'display-time-string global-mode-string)
- (setq global-mode-string
- (append global-mode-string '(display-time-string))))
- ;; Set up the time timer.
- (setq display-time-timer
- (run-at-time t display-time-interval
- 'display-time-event-handler))
- ;; Make the time appear right away.
- (display-time-update)
- ;; When you get new mail, clear "Mail" from the mode line.
- (add-hook 'rmail-after-get-new-mail-hook
- 'display-time-event-handler))
- (remove-hook 'rmail-after-get-new-mail-hook
- 'display-time-event-handler))))
+;; This business used to be simpler when all mode lines had the same
+;; face and the image could just be pbm. Now we try to rely on an xpm
+;; image with a transparent background. Otherwise, set the background
+;; for pbm.
+
+(defcustom display-time-mail-face nil
+ "Face to use for `display-time-mail-string'.
+If `display-time-use-mail-icon' is non-nil, the image's
+background colour is the background of this face. Set this to
+make the mail indicator stand out on a colour display."
+ :group 'faces
+ :group 'display-time
+ :version "21.4"
+ :type '(choice (const :tag "None" nil) face))
+
+(defvar display-time-mail-icon
+ (find-image '((:type xpm :file "letter.xpm" :ascent center)
+ (:type pbm :file "letter.pbm" :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'.")
+
+;; Fixme: Default to icon on graphical display?
+(defcustom display-time-use-mail-icon nil
+ "Non-nil means use an icon as the mail indicator on a graphic display.
+Otherwise use `display-time-mail-string'. The icon may consume less
+of the mode line. It is specified by `display-time-mail-icon'."
+ :group 'display-time
+ :type 'boolean)