Function: appt-add

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

Signature

(appt-add TIME MSG &optional WARNTIME)

Documentation

Add an appointment for today at TIME with message MSG.

The time should be in either 24 hour format or am/pm format. Optional argument WARNTIME is an integer (or string) giving the number of minutes before the appointment at which to start warning. The default is appt-message-warning-time.

Probably introduced at or before Emacs version 23.3.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/calendar/appt.el.gz
;;;###autoload
(defun appt-add (time msg &optional warntime)
  "Add an appointment for today at TIME with message MSG.
The time should be in either 24 hour format or am/pm format.
Optional argument WARNTIME is an integer (or string) giving the number
of minutes before the appointment at which to start warning.
The default is `appt-message-warning-time'."
  (interactive "sTime (hh:mm[am/pm]): \nsMessage: \n\
sMinutes before the appointment to start warning: ")
  (unless (string-match appt-time-regexp time)
    (user-error "Unacceptable time-string"))
  (and (stringp warntime)
       (setq warntime (unless (string-equal warntime "")
                        (string-to-number warntime))))
  (and warntime
       (not (integerp warntime))
       (user-error "Argument WARNTIME must be an integer, or nil"))
  (or appt-timer (appt-activate))
  (let ((time-msg (list (list (appt-convert-time time))
                        (concat time " " msg) t)))
    ;; It is presently nonsensical to have multiple warnings about
    ;; the same appointment with just different delays, but it might
    ;; not always be so.  TODO
    (if warntime (setq time-msg (append time-msg (list warntime))))
    (unless (member time-msg appt-time-msg-list)
      (setq appt-time-msg-list
            (appt-sort-list (nconc appt-time-msg-list (list time-msg)))))))