* mail/emacsbug.el (report-emacs-bug): Trap load-path-shadows errors.
[bpt/emacs.git] / lisp / mail / emacsbug.el
index aa98da8..742c05b 100644 (file)
@@ -182,7 +182,9 @@ Prompts for bug subject.  Leaves you in a mail buffer."
       (set (make-local-variable 'message-strip-special-text-properties) nil))
     (rfc822-goto-eoh)
     (forward-line 1)
-    (let ((signature (buffer-substring (point) (point-max))))
+    ;; Move the mail signature to the proper place.
+    (let ((signature (buffer-substring (point) (point-max)))
+         (inhibit-read-only t))
       (delete-region (point) (point-max))
       (insert signature)
       (backward-char (length signature)))
@@ -302,9 +304,14 @@ usually do not have translators for other languages.\n\n")))
       (insert "\n"))
     (insert "\n")
     (insert "Load-path shadows:\n")
-    (message "Checking for load-path shadows...")
-    (let ((shadows (list-load-path-shadows t)))
-      (message "Checking for load-path shadows...done")
+    (let* ((msg "Checking for load-path shadows...")
+          (result "done")
+          (shadows (progn (message "%s" msg)
+                          (condition-case nil (list-load-path-shadows t)
+                            (error
+                             (setq result "error")
+                             "Error during checking")))))
+      (message "%s%s" msg result)
       (insert (if (zerop (length shadows))
                   "None found.\n"
                 shadows)))
@@ -395,8 +402,7 @@ and send the mail again%s."
     ;; questions about From header validity if the user is going to
     ;; use mailclient, anyway.
     (when (or (and (derived-mode-p 'message-mode)
-                  (eq (message-default-send-mail-function)
-                      'sendmail-query-once))
+                  (eq message-send-mail-function 'sendmail-query-once))
              (and (not (derived-mode-p 'message-mode))
                   (eq send-mail-function 'sendmail-query-once)))
       (sendmail-query-user-about-smtp)