comparison lisp/calendar/appt.el @ 110753:d9ff3c5329a6

Minor appt.el changes. * lisp/calendar/appt.el (appt-add): Ensure reminders are enabled. (appt-activate): Give status messages.
author Glenn Morris <rgm@gnu.org>
date Sun, 03 Oct 2010 18:19:56 -0700
parents 34826102748f
children 45f1e8634472
comparison
equal deleted inserted replaced
110752:a347bc5bfc03 110753:d9ff3c5329a6
444 (setq warntime (unless (string-equal warntime "") 444 (setq warntime (unless (string-equal warntime "")
445 (string-to-number warntime)))) 445 (string-to-number warntime))))
446 (and warntime 446 (and warntime
447 (not (integerp warntime)) 447 (not (integerp warntime))
448 (error "Argument WARNTIME must be an integer, or nil")) 448 (error "Argument WARNTIME must be an integer, or nil"))
449 (or appt-timer (appt-activate))
449 (let ((time-msg (list (list (appt-convert-time time)) 450 (let ((time-msg (list (list (appt-convert-time time))
450 (concat time " " msg) t))) 451 (concat time " " msg) t)))
451 ;; It is presently non-sensical to have multiple warnings about 452 ;; It is presently non-sensical to have multiple warnings about
452 ;; the same appointment with just different delays, but it might 453 ;; the same appointment with just different delays, but it might
453 ;; not always be so. TODO 454 ;; not always be so. TODO
616 (or global-mode-string (setq global-mode-string '(""))) 617 (or global-mode-string (setq global-mode-string '("")))
617 (delq 'appt-mode-string global-mode-string) 618 (delq 'appt-mode-string global-mode-string)
618 (when appt-timer 619 (when appt-timer
619 (cancel-timer appt-timer) 620 (cancel-timer appt-timer)
620 (setq appt-timer nil)) 621 (setq appt-timer nil))
621 (when appt-active 622 (if appt-active
622 (diary-check-diary-file) 623 (progn
623 (add-hook 'write-file-functions 'appt-update-list) 624 (diary-check-diary-file)
624 (setq appt-timer (run-at-time t 60 'appt-check) 625 (add-hook 'write-file-functions 'appt-update-list)
625 global-mode-string 626 (setq appt-timer (run-at-time t 60 'appt-check)
626 (append global-mode-string '(appt-mode-string))) 627 global-mode-string
627 (appt-check t)))) 628 (append global-mode-string '(appt-mode-string)))
629 (appt-check t)
630 (message "Appointment reminders enabled"))
631 (message "Appointment reminders disabled"))))
628 632
629 633
630 (provide 'appt) 634 (provide 'appt)
631 635
632 ;; arch-tag: bf5791c4-8921-499e-a26f-772b1788d347 636 ;; arch-tag: bf5791c4-8921-499e-a26f-772b1788d347