diff options
| author | Glenn Morris | 2012-08-20 14:13:03 -0400 |
|---|---|---|
| committer | Glenn Morris | 2012-08-20 14:13:03 -0400 |
| commit | 327576483cd198b11b39bb88a42d0495f5724684 (patch) | |
| tree | 0efbd15706e786ab4e0fcf0b3fb1595412156877 | |
| parent | 0a05a035f680b0fcd50b5e5201e056ead479511d (diff) | |
| download | emacs-327576483cd198b11b39bb88a42d0495f5724684.tar.gz emacs-327576483cd198b11b39bb88a42d0495f5724684.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 31 | ||||
| -rw-r--r-- | lisp/calendar/holidays.el | 13 |
3 files changed, 31 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f16d8c36344..a1464b52e6c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-08-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * calendar/diary-lib.el (diary-include-files, diary-sexp-entry): | ||
| 4 | * calendar/holidays.el (calendar-holiday-list): | ||
| 5 | Report errors with display-warning rather than beep'n'sleep. | ||
| 6 | |||
| 1 | 2012-08-20 Michael Albinus <michael.albinus@gmx.de> | 7 | 2012-08-20 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 8 | ||
| 3 | * net/tramp.el (tramp-accept-process-output): Accept only output | 9 | * net/tramp.el (tramp-accept-process-output): Accept only output |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 2e073fd1267..8fa5b0ddb07 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -951,12 +951,12 @@ This is recursive; that is, included files may include other files." | |||
| 951 | (setq diary-entries-list | 951 | (setq diary-entries-list |
| 952 | (append diary-entries-list | 952 | (append diary-entries-list |
| 953 | (diary-list-entries original-date number t))))) | 953 | (diary-list-entries original-date number t))))) |
| 954 | (beep) | 954 | (display-warning |
| 955 | (message "Can't read included diary file %s" diary-file) | 955 | :error |
| 956 | (sleep-for 2)) | 956 | (format "Can't read included diary file %s\n" diary-file))) |
| 957 | (beep) | 957 | (display-warning |
| 958 | (message "Can't find included diary file %s" diary-file) | 958 | :error |
| 959 | (sleep-for 2)))) | 959 | (format "Can't find included diary file %s\n" diary-file))))) |
| 960 | (goto-char (point-min))) | 960 | (goto-char (point-min))) |
| 961 | 961 | ||
| 962 | (defun diary-include-other-diary-files () | 962 | (defun diary-include-other-diary-files () |
| @@ -1456,14 +1456,17 @@ marks. This is intended to deal with deleted diary entries." | |||
| 1456 | (let ((result (if calendar-debug-sexp | 1456 | (let ((result (if calendar-debug-sexp |
| 1457 | (let ((debug-on-error t)) | 1457 | (let ((debug-on-error t)) |
| 1458 | (eval (car (read-from-string sexp)))) | 1458 | (eval (car (read-from-string sexp)))) |
| 1459 | (condition-case nil | 1459 | (let (err) |
| 1460 | (eval (car (read-from-string sexp))) | 1460 | (condition-case err |
| 1461 | (error | 1461 | (eval (car (read-from-string sexp))) |
| 1462 | (beep) | 1462 | (error |
| 1463 | (message "Bad sexp at line %d in %s: %s" | 1463 | (display-warning |
| 1464 | (count-lines (point-min) (point)) | 1464 | :error |
| 1465 | diary-file sexp) | 1465 | (format "Bad diary sexp at line %d in %s:\n%s\n\ |
| 1466 | (sleep-for 2)))))) | 1466 | Error: %s\n" |
| 1467 | (count-lines (point-min) (point)) | ||
| 1468 | diary-file sexp err)) | ||
| 1469 | nil)))))) | ||
| 1467 | (cond ((stringp result) result) | 1470 | (cond ((stringp result) result) |
| 1468 | ((and (consp result) | 1471 | ((and (consp result) |
| 1469 | (stringp (cdr result))) result) | 1472 | (stringp (cdr result))) result) |
diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 0bb3c231840..043d402f612 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el | |||
| @@ -458,17 +458,20 @@ with descriptive strings such as | |||
| 458 | (defun calendar-holiday-list () | 458 | (defun calendar-holiday-list () |
| 459 | "Form the list of holidays that occur on dates in the calendar window. | 459 | "Form the list of holidays that occur on dates in the calendar window. |
| 460 | The holidays are those in the list `calendar-holidays'." | 460 | The holidays are those in the list `calendar-holidays'." |
| 461 | (let (res h) | 461 | (let (res h err) |
| 462 | (sort | 462 | (sort |
| 463 | (dolist (p calendar-holidays res) | 463 | (dolist (p calendar-holidays res) |
| 464 | (if (setq h (if calendar-debug-sexp | 464 | (if (setq h (if calendar-debug-sexp |
| 465 | (let ((debug-on-error t)) | 465 | (let ((debug-on-error t)) |
| 466 | (eval p)) | 466 | (eval p)) |
| 467 | (condition-case nil | 467 | (condition-case err |
| 468 | (eval p) | 468 | (eval p) |
| 469 | (error (beep) | 469 | (error |
| 470 | (message "Bad holiday list item: %s" p) | 470 | (display-warning |
| 471 | (sleep-for 2))))) | 471 | :error |
| 472 | (format "Bad holiday list item: %s\nError: %s\n" | ||
| 473 | p err)) | ||
| 474 | nil)))) | ||
| 472 | (setq res (append h res)))) | 475 | (setq res (append h res)))) |
| 473 | 'calendar-date-compare))) | 476 | 'calendar-date-compare))) |
| 474 | 477 | ||