Function: appt-activate

appt-activate is an autoloaded, interactive and byte-compiled function defined in appt.el.gz.

Signature

(appt-activate &optional ARG)

Documentation

Toggle checking of appointments.

With optional numeric argument ARG, turn appointment checking on if ARG is positive, otherwise off.

View in manual

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/appt.el.gz
;;;###autoload
(defun appt-activate (&optional arg)
  "Toggle checking of appointments.
With optional numeric argument ARG, turn appointment checking on if
ARG is positive, otherwise off."
  (interactive "P")
  (let ((appt-active appt-timer))
    (setq appt-active (if arg (> (prefix-numeric-value arg) 0)
                        (not appt-active)))
    (remove-hook 'write-file-functions #'appt-update-list)
    (or global-mode-string (setq global-mode-string '("")))
    (setq global-mode-string (delq 'appt-mode-string global-mode-string))
    (when appt-timer
      (cancel-timer appt-timer)
      (setq appt-timer nil))
    (if appt-active
        (progn
          (add-hook 'write-file-functions #'appt-update-list)
          (setq appt-timer (run-at-time t 60 #'appt-check)
                global-mode-string
                (append global-mode-string '(appt-mode-string)))
          (appt-check t)
          (message "Appointment reminders enabled%s"
                   ;; Someone might want to use appt-add without a diary.
                   (if (ignore-errors (diary-check-diary-file))
                       ""
                     " (no diary file found)")))
      (message "Appointment reminders disabled"))))