comparison lisp/packages/time.el @ 189:489f57a838ef r20-3b21

Import from CVS: tag r20-3b21
author cvs
date Mon, 13 Aug 2007 09:57:07 +0200
parents 3d6bfa290dbd
children 41ff10fd062f
comparison
equal deleted inserted replaced
188:e29a8e7498d9 189:489f57a838ef
70 ;;;(if display-time-keymap () 70 ;;;(if display-time-keymap ()
71 ;;; (setq display-time-keymap (make-sparse-keymap)) 71 ;;; (setq display-time-keymap (make-sparse-keymap))
72 ;;; (suppress-keymap display-time-keymap) 72 ;;; (suppress-keymap display-time-keymap)
73 ;;; (define-key display-time-keymap 'button1 'balloon-help)) 73 ;;; (define-key display-time-keymap 'button1 'balloon-help))
74 74
75 ;; We need the progn to kill off the defgroup-tracking mechanism.
76 ;; This package changes the state of XEmacs by loading it, which is
77 ;; why it's potentially dangerous.
78 (progn
79 (defgroup display-time nil 75 (defgroup display-time nil
80 "Facilities to display the current time/date/load and a new-mail indicator 76 "Facilities to display the current time/date/load and a new-mail indicator
81 in the XEmacs mode line or echo area." 77 in the XEmacs mode line or echo area."
82 :group 'applications) 78 :group 'applications)
83 79
84 (defgroup display-time-balloon nil 80 (defgroup display-time-balloon nil
85 "Fancy add-ons to display-time for using the `balloon-help' feature. 81 "Fancy add-ons to display-time for using the `balloon-help' feature.
86 balloon-help must be loaded before these settings take effect." 82 balloon-help must be loaded before these settings take effect."
87 :group 'display-time) 83 :group 'display-time)
88 ) ;progn 84
89 85
90 (defcustom display-time-mail-file nil 86 (defcustom display-time-mail-file nil
91 "*File name of mail inbox file, for indicating existence of new mail. 87 "*File name of mail inbox file, for indicating existence of new mail.
92 Non-nil and not a string means don't check for mail. nil means use 88 Non-nil and not a string means don't check for mail. nil means use
93 default, which is system-dependent, and is the same as used by Rmail." 89 default, which is system-dependent, and is the same as used by Rmail."
141 are displayed as well. 137 are displayed as well.
142 After each update, `display-time-hook' is run with `run-hooks'. 138 After each update, `display-time-hook' is run with `run-hooks'.
143 If `display-time-echo-area' is non-nil, the time is displayed in the 139 If `display-time-echo-area' is non-nil, the time is displayed in the
144 echo area instead of in the mode-line." 140 echo area instead of in the mode-line."
145 (interactive) 141 (interactive)
142 (or display-time-insinuated
143 (display-time-insinuate))
146 ;; if the "display-time" itimer already exists, nuke it first. 144 ;; if the "display-time" itimer already exists, nuke it first.
147 (let ((old (get-itimer "display-time"))) 145 (let ((old (get-itimer "display-time")))
148 (if old (delete-itimer old))) 146 (if old (delete-itimer old)))
149 147
150 (if (memq 'display-time-string global-mode-string) 148 (if (memq 'display-time-string global-mode-string)
494 elem "-glyph"))) mlist)) 492 elem "-glyph"))) mlist))
495 (let ((global-mode-string mlist)) 493 (let ((global-mode-string mlist))
496 (redisplay-frame)) 494 (redisplay-frame))
497 )) 495 ))
498 496
499 (if (featurep 'xpm) 497 (defvar display-time-insinuated nil)
500 (progn 498
501 (defvar display-time-mail-sign 499 ;; This used to be at top-level!
502 (cons (make-extent nil nil) 500 (defun display-time-insinuate ()
503 (make-glyph (concat display-time-icons-dir "letter.xpm")))) 501 (when (featurep 'xpm)
504 (set-extent-property (car display-time-mail-sign) 'balloon-help 502 (defvar display-time-mail-sign
505 'display-time-mail-balloon) 503 (cons (make-extent nil nil)
504 (make-glyph (concat display-time-icons-dir "letter.xpm"))))
505 (set-extent-property (car display-time-mail-sign) 'balloon-help
506 'display-time-mail-balloon)
506 ;;; (set-extent-keymap (car display-time-mail-sign) 507 ;;; (set-extent-keymap (car display-time-mail-sign)
507 ;;; display-time-keymap) 508 ;;; display-time-keymap)
508 (defvar display-time-no-mail-sign 509 (defvar display-time-no-mail-sign
509 (cons (make-extent nil nil) 510 (cons (make-extent nil nil)
510 (make-glyph (concat display-time-icons-dir "no-letter.xpm")))) 511 (make-glyph (concat display-time-icons-dir "no-letter.xpm"))))
511 (set-extent-property (car display-time-no-mail-sign) 'balloon-help 512 (set-extent-property (car display-time-no-mail-sign) 'balloon-help
512 display-time-no-mail-balloon) 513 display-time-no-mail-balloon)
513 ;;; (set-extent-keymap (car display-time-no-mail-sign) 514 ;;; (set-extent-keymap (car display-time-no-mail-sign)
514 ;;; display-time-keymap) 515 ;;; display-time-keymap)
515 (defvar display-time-1-glyph nil) 516 (defvar display-time-1-glyph nil)
516 (defvar display-time-2-glyph nil) 517 (defvar display-time-2-glyph nil)
517 (defvar display-time-3-glyph nil) 518 (defvar display-time-3-glyph nil)
518 (defvar display-time-4-glyph nil) 519 (defvar display-time-4-glyph nil)
519 (defvar display-time-5-glyph nil) 520 (defvar display-time-5-glyph nil)
520 (defvar display-time-6-glyph nil) 521 (defvar display-time-6-glyph nil)
521 (defvar display-time-7-glyph nil) 522 (defvar display-time-7-glyph nil)
522 (defvar display-time-8-glyph nil) 523 (defvar display-time-8-glyph nil)
523 (defvar display-time-9-glyph nil) 524 (defvar display-time-9-glyph nil)
524 (defvar display-time-0-glyph nil) 525 (defvar display-time-0-glyph nil)
525 (defvar display-time-:-glyph nil) 526 (defvar display-time-:-glyph nil)
526 (defvar display-time-am-glyph nil) 527 (defvar display-time-am-glyph nil)
527 (defvar display-time-pm-glyph nil) 528 (defvar display-time-pm-glyph nil)
528 (defvar display-time-load-0.0-glyph nil) 529 (defvar display-time-load-0.0-glyph nil)
529 (defvar display-time-load-0.5-glyph nil) 530 (defvar display-time-load-0.5-glyph nil)
530 (defvar display-time-load-1.0-glyph nil) 531 (defvar display-time-load-1.0-glyph nil)
531 (defvar display-time-load-1.5-glyph nil) 532 (defvar display-time-load-1.5-glyph nil)
532 (defvar display-time-load-2.0-glyph nil) 533 (defvar display-time-load-2.0-glyph nil)
533 (defvar display-time-load-2.5-glyph nil) 534 (defvar display-time-load-2.5-glyph nil)
534 (defvar display-time-load-3.0-glyph nil) 535 (defvar display-time-load-3.0-glyph nil)
535 (display-time-generate-time-glyphs 'force) 536 (display-time-generate-time-glyphs 'force)
536 (display-time-generate-load-glyphs 'force) 537 (display-time-generate-load-glyphs 'force)
537 (display-time-init-glyphs) 538 (display-time-init-glyphs)
538 (sit-for 0) 539 (sit-for 0))
539 )) 540 (setq display-time-insinuated t))
540 541
541 542
542 (defun display-time-can-do-graphical-display (&optional textual) 543 (defun display-time-can-do-graphical-display (&optional textual)
543 (and display-time-show-icons-maybe 544 (and display-time-show-icons-maybe
544 (not textual) 545 (not textual)