From fb7234019fe279e9122c4178fce975bffa0d8c55 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 10 Jun 2015 17:04:54 -0400 Subject: [PATCH] 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'. --- lisp/calendar/appt.el | 4 ++-- lisp/calendar/calendar.el | 4 ++-- lisp/calendar/diary-lib.el | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index f143b2dfcb7..d5d8a400218 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -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))) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 1612f48a019..233d2cfcd22 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -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) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index d5bd26a9277..1cb13e412b6 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -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)))) -- 2.39.2