]> code.delx.au - gnu-emacs/commitdiff
In sendmail-send-it don't switch to non-existent buffer. (Bug#20211)
authorRichard Ryniker <ryniker@alum.mit.edu>
Mon, 30 Mar 2015 15:38:25 +0000 (17:38 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Mon, 30 Mar 2015 15:38:25 +0000 (17:38 +0200)
* mail/sendmail.el (sendmail-send-it): Do not attempt to switch
to non-existent buffer (errbuf is not created when customization
variable mail-interactive is nil).  (Bug#20211)

lisp/ChangeLog
lisp/mail/sendmail.el

index fd346f05afbaeec80e95c0457d30593092b1bfc3..69d9ab9f977e3769a199f980a6f59d0ad2887df3 100644 (file)
@@ -1,3 +1,9 @@
+2015-03-30  Richard Ryniker  <ryniker@alum.mit.edu>  (tiny change)
+
+       * mail/sendmail.el (sendmail-send-it): Do not attempt to switch
+       to non-existent buffer (errbuf is not created when customization
+       variable mail-interactive is nil).  (Bug#20211)
+
 2015-03-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/smie.el (smie-backward-sexp-command)
index 7e9bd5bca2fda64e072c991e8f45b826cf1199c7..9fa7aa5a6f24b51b4c28d69a0d912dbffc8fa0ea 100644 (file)
@@ -1299,10 +1299,10 @@ external program defined by `sendmail-program'."
                   (error "Sending...failed to %s"
                          (buffer-substring (point-min) (point-max)))))))
       (kill-buffer tembuf)
-      (if (and (bufferp errbuf)
-               (not error))
-          (kill-buffer errbuf)
-        (switch-to-buffer-other-window errbuf)))))
+      (when (buffer-live-p errbuf)
+        (if error
+            (switch-to-buffer-other-window errbuf)
+          (kill-buffer errbuf))))))
 
 (autoload 'rmail-output-to-rmail-buffer "rmailout")