]> git.eshelyaron.com Git - emacs.git/commitdiff
(sendmail-query-once): Restore the current buffer after querying
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 2 Aug 2011 19:43:09 +0000 (21:43 +0200)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Tue, 2 Aug 2011 19:43:09 +0000 (21:43 +0200)
Fixes: debbugs:9074
lisp/ChangeLog
lisp/mail/sendmail.el

index b75d042c5dbd069e37d8faaae9b9a01252ae871a..f6c1b8a5fdfee6c1fe5e8842912758cbfcc3fd16 100644 (file)
@@ -1,5 +1,8 @@
 2011-08-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * mail/sendmail.el (sendmail-query-once): Restore the current
+       buffer after querying (bug#9074).
+
        * dired.el (dired-flagged): Use different faces for marked and
        flagged files (bug#6117).
 
index fe20ad921dacbacfdfdf3dd34a0b2bb85e31914e..158435de86bfe00485ba0a83730f521847196d74 100644 (file)
@@ -165,7 +165,8 @@ This is used by the default mail-sending commands.  See also
 If `sendmail-query-once-function' is `query', ask the user what
 function to use, and then save that choice."
   (when (equal sendmail-query-once-function 'query)
-    (let* ((default
+    (let* ((mail-buffer (current-buffer))
+          (default
             (cond
              ((or (and window-system (eq system-type 'darwin))
                   (eq system-type 'windows-nt))
@@ -195,7 +196,8 @@ function to use, and then save that choice."
                    (if (y-or-n-p "Configure outgoing SMTP in Emacs? ")
                        'smtpmail-send-it
                      default))
-               (kill-buffer (current-buffer))))))
+               (kill-buffer (current-buffer))
+               (set-buffer mail-buffer)))))
       (customize-save-variable 'sendmail-query-once-function function)))
   (funcall sendmail-query-once-function))