]> git.eshelyaron.com Git - emacs.git/commitdiff
(report-emacs-bug): Don't die if *Messages* buf is gone.
authorKarl Heuer <kwzh@gnu.org>
Thu, 21 Dec 1995 19:02:46 +0000 (19:02 +0000)
committerKarl Heuer <kwzh@gnu.org>
Thu, 21 Dec 1995 19:02:46 +0000 (19:02 +0000)
lisp/mail/emacsbug.el

index fe6b52f7cc085d50f821847a38807878b2625fc1..9d5afd601a230c2b59ffc961b573180d2b50434c 100644 (file)
@@ -77,17 +77,19 @@ Prompts for bug subject.  Leaves you in a mail buffer."
          (while (progn (move-to-column 50) (not (eobp)))
            (search-forward " " nil t)
            (insert "\n")))
-       (insert "\n\n")
-       (insert "Recent messages:\n")
-       (insert-buffer-substring "*Messages*"
-                                (save-excursion
-                                  (set-buffer "*Messages*")
-                                  (goto-char (point-max))
-                                  (forward-line -10)
-                                  (point))
-                                (save-excursion
-                                  (set-buffer "*Messages*")
-                                  (point-max)))
+       (let ((message-buf (get-buffer "*Messages*")))
+         (if message-buf
+             (progn
+               (insert "\n\nRecent messages:\n")
+               (insert-buffer-substring message-buf
+                                        (save-excursion
+                                          (set-buffer message-buf)
+                                          (goto-char (point-max))
+                                          (forward-line -10)
+                                          (point))
+                                        (save-excursion
+                                          (set-buffer message-buf)
+                                          (point-max))))))
        ;; This is so the user has to type something
        ;; in order to send easily.
        (use-local-map (nconc (make-sparse-keymap) (current-local-map)))