Commit fb723401 authored by Glenn Morris's avatar Glenn Morris

Use 'user-error' in a few calendar files.

* lisp/calendar/appt.el (appt-add):
* lisp/calendar/calendar.el (calendar-absolute-from-gregorian)
(calendar-generate):
* lisp/calendar/diary-lib.el (diary-mail-entries, diary-cyclic):
Replace 'error' with 'user-error'.
parent 7de81377
......@@ -511,13 +511,13 @@ 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)
(error "Unacceptable time-string"))
(user-error "Unacceptable time-string"))
(and (stringp warntime)
(setq warntime (unless (string-equal warntime "")
(string-to-number warntime))))
(and warntime
(not (integerp warntime))
(error "Argument WARNTIME must be an integer, or nil"))
(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)))
......
......@@ -1194,7 +1194,7 @@ return negative results."
(let ((year (calendar-extract-year date))
offset-years)
(cond ((zerop year)
(error "There was no year zero"))
(user-error "There was no year zero"))
((> year 0)
(setq offset-years (1- year))
(+ (calendar-day-number date) ; days this year
......@@ -1379,7 +1379,7 @@ Optional integers MON and YR are used instead of today's date."
;; stands, almost all other calendar functions (eg holidays) would
;; at best have unpredictable results for such dates.
(if (< (+ month (* 12 (1- year))) 2)
(error "Months before January, 1 AD cannot be displayed"))
(user-error "Months before January, 1 AD cannot be displayed"))
(setq displayed-month month
displayed-year year)
(erase-buffer)
......
......@@ -1197,7 +1197,7 @@ ensure that all relevant variables are set.
"
(interactive "P")
(if (string-equal diary-mail-addr "")
(error "You must set `diary-mail-addr' to use this command")
(user-error "You must set `diary-mail-addr' to use this command")
(let ((diary-display-function 'diary-fancy-display))
(diary-list-entries (calendar-current-date) (or ndays diary-mail-days)))
(compose-mail diary-mail-addr
......@@ -1969,7 +1969,7 @@ and %s by the ordinal ending of that number (that is, `st', `nd',
An optional parameter MARK specifies a face or single-character
string to use when highlighting the day in the calendar."
(or (> n 0)
(error "Day count must be positive"))
(user-error "Day count must be positive"))
(let* ((diff (- (calendar-absolute-from-gregorian date)
(calendar-absolute-from-gregorian
(diary-make-date month day year))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment