emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r104681: Make mail exit more nicely w


From: Richard Stallman
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104681: Make mail exit more nicely when Rmail is in use.
Date: Wed, 22 Jun 2011 19:39:29 -0400
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104681
committer: Richard Stallman <address@hidden>
branch nick: trunk
timestamp: Wed 2011-06-22 19:39:29 -0400
message:
  Make mail exit more nicely when Rmail is in use.
modified:
  lisp/ChangeLog
  lisp/mail/sendmail.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-06-22 23:35:21 +0000
+++ b/lisp/ChangeLog    2011-06-22 23:39:29 +0000
@@ -1,5 +1,8 @@
 2011-06-22  Richard Stallman  <address@hidden>
 
+       * mail/sendmail.el (mail-bury): If Rmail is in use, return nicely
+       to Rmail even if not started by a special Rmail command.
+
        * mail/rmailmm.el (rmail-insert-mime-forwarded-message):
        Copy the buffer currently showing just one message.
 

=== modified file 'lisp/mail/sendmail.el'
--- a/lisp/mail/sendmail.el     2011-06-09 05:33:26 +0000
+++ b/lisp/mail/sendmail.el     2011-06-22 23:39:29 +0000
@@ -806,10 +806,18 @@
 
 (defun mail-bury (&optional arg)
   "Bury this mail buffer."
-  (let ((newbuf (other-buffer (current-buffer))))
+  (let ((newbuf (other-buffer (current-buffer)))
+       (return-action mail-return-action)
+       some-rmail)
     (bury-buffer (current-buffer))
-    (if (and (null arg) mail-return-action)
-       (apply (car mail-return-action) (cdr mail-return-action))
+    ;; If there is an Rmail buffer, return to it nicely
+    ;; even if this message was not started by an Rmail command.
+    (unless return-action
+      (dolist (buffer (buffer-list))
+       (if (eq (buffer-local-value 'major-mode buffer) 'rmail-mode)
+           (setq return-action `(rmail-mail-return ,newbuf)))))
+    (if (and (null arg) return-action)
+       (apply (car return-action) (cdr return-action))
       (switch-to-buffer newbuf))))
 
 (defcustom mail-send-hook nil


reply via email to

[Prev in Thread] Current Thread [Next in Thread]