Commit 32757648 authored by Glenn Morris's avatar Glenn Morris

Use display-warning in a few places in calendar

* lisp/calendar/diary-lib.el (diary-include-files, diary-sexp-entry):
* lisp/calendar/holidays.el (calendar-holiday-list):
Report errors with display-warning rather than beep'n'sleep.
parent 0a05a035
2012-08-20 Glenn Morris <rgm@gnu.org>
* calendar/diary-lib.el (diary-include-files, diary-sexp-entry):
* calendar/holidays.el (calendar-holiday-list):
Report errors with display-warning rather than beep'n'sleep.
2012-08-20 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-accept-process-output): Accept only output
......
......@@ -951,12 +951,12 @@ This is recursive; that is, included files may include other files."
(setq diary-entries-list
(append diary-entries-list
(diary-list-entries original-date number t)))))
(beep)
(message "Can't read included diary file %s" diary-file)
(sleep-for 2))
(beep)
(message "Can't find included diary file %s" diary-file)
(sleep-for 2))))
(display-warning
:error
(format "Can't read included diary file %s\n" diary-file)))
(display-warning
:error
(format "Can't find included diary file %s\n" diary-file)))))
(goto-char (point-min)))
(defun diary-include-other-diary-files ()
......@@ -1456,14 +1456,17 @@ marks. This is intended to deal with deleted diary entries."
(let ((result (if calendar-debug-sexp
(let ((debug-on-error t))
(eval (car (read-from-string sexp))))
(condition-case nil
(eval (car (read-from-string sexp)))
(error
(beep)
(message "Bad sexp at line %d in %s: %s"
(count-lines (point-min) (point))
diary-file sexp)
(sleep-for 2))))))
(let (err)
(condition-case err
(eval (car (read-from-string sexp)))
(error
(display-warning
:error
(format "Bad diary sexp at line %d in %s:\n%s\n\
Error: %s\n"
(count-lines (point-min) (point))
diary-file sexp err))
nil))))))
(cond ((stringp result) result)
((and (consp result)
(stringp (cdr result))) result)
......
......@@ -458,17 +458,20 @@ with descriptive strings such as
(defun calendar-holiday-list ()
"Form the list of holidays that occur on dates in the calendar window.
The holidays are those in the list `calendar-holidays'."
(let (res h)
(let (res h err)
(sort
(dolist (p calendar-holidays res)
(if (setq h (if calendar-debug-sexp
(let ((debug-on-error t))
(eval p))
(condition-case nil
(condition-case err
(eval p)
(error (beep)
(message "Bad holiday list item: %s" p)
(sleep-for 2)))))
(error
(display-warning
:error
(format "Bad holiday list item: %s\nError: %s\n"
p err))
nil))))
(setq res (append h res))))
'calendar-date-compare)))
......
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