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 (list (let ((time (read-string "Time (hh:mm[am/pm]): ")))
(unless (string-match-p appt-time-regexp time)
(user-error "Unacceptable time-string"))
time)
(read-string "Message: ")
(read-string "Minutes before the appointment to start warning: ")))
(unless (string-match-p 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)))))))