]> git.eshelyaron.com Git - emacs.git/commitdiff
Use display-warning in a few places in calendar
authorGlenn Morris <rgm@gnu.org>
Mon, 20 Aug 2012 18:13:03 +0000 (14:13 -0400)
committerGlenn Morris <rgm@gnu.org>
Mon, 20 Aug 2012 18:13:03 +0000 (14:13 -0400)
* 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.

lisp/ChangeLog
lisp/calendar/diary-lib.el
lisp/calendar/holidays.el

index f16d8c3634433a56c90bcf1e169d50608e491524..a1464b52e6cfd0a39979924b8dd3e2eae4bf1e6d 100644 (file)
@@ -1,3 +1,9 @@
+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
index 2e073fd12674e5eeaf98f0851d1f2fead1580a44..8fa5b0ddb0726c5e8bc6a3f6f84e8fd10883e90a 100644 (file)
@@ -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)
index 0bb3c23184020d4d48aa99b5e9de7b648e5e47c8..043d402f612b46ef7aa1691f4d2619cdb73e9be5 100644 (file)
@@ -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)))