changeset 1269:d123cad4373c

(mail-send-and-exit): Do other-buffer before bury-buffer.
author Richard M. Stallman <rms@gnu.org>
date Tue, 29 Sep 1992 20:39:55 +0000
parents 39c6e9d28de2
children db6ef357ba3e
files lisp/mail/sendmail.el
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/sendmail.el	Tue Sep 29 18:30:35 1992 +0000
+++ b/lisp/mail/sendmail.el	Tue Sep 29 20:39:55 1992 +0000
@@ -194,14 +194,15 @@
 Prefix arg means don't delete this window."
   (interactive "P")
   (mail-send)
-  (bury-buffer (current-buffer))
-  (if (and (not arg)
-	   (not (one-window-p))
-	   (save-excursion
-	     (set-buffer (window-buffer (next-window (selected-window) 'not)))
-	     (eq major-mode 'rmail-mode)))
-      (delete-window)
-    (switch-to-buffer (other-buffer (current-buffer)))))
+  (let ((newbuf (other-buffer (current-buffer))))
+    (bury-buffer (current-buffer))
+    (if (and (not arg)
+	     (not (one-window-p))
+	     (save-excursion
+	       (set-buffer (window-buffer (next-window (selected-window) 'not)))
+	       (eq major-mode 'rmail-mode)))
+	(delete-window)
+      (switch-to-buffer newbuf))))
 
 (defun mail-send ()
   "Send the message in the current buffer.