changeset 13816:777c7668b8b0

(report-emacs-bug): Don't die if *Messages* buf is gone.
author Karl Heuer <kwzh@gnu.org>
date Thu, 21 Dec 1995 19:02:46 +0000
parents 2a2eaca9d6bb
children ec73462ad90c
files lisp/mail/emacsbug.el
diffstat 1 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/emacsbug.el	Thu Dec 21 18:20:21 1995 +0000
+++ b/lisp/mail/emacsbug.el	Thu Dec 21 19:02:46 1995 +0000
@@ -77,17 +77,19 @@
 	  (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)))