dot-emacs: Make `trap' report the erroneous code.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 6 Feb 2008 16:55:31 +0000 (16:55 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 6 Feb 2008 17:00:35 +0000 (17:00 +0000)
This helps a bit when confusing messages appear.

dot-emacs.el

index c5e3dfd..e10f9ed 100644 (file)
@@ -34,7 +34,9 @@
   "Execute FORMS without allowing errors to propagate outside."
   `(condition-case err
        ,(if (cdr forms) (cons 'progn forms) (car forms))
-     (error (message "Error (trapped): %s" (error-message-string err)))))
+     (error (message "Error (trapped): %s in %s"
+                    (error-message-string err)
+                    ',forms))))
 
 ;; --- Configuration reading ---