]> git.eshelyaron.com Git - emacs.git/commitdiff
* message.el (message-bury): Add special-case handling for Rmail.
authorChong Yidong <cyd@stupidchicken.com>
Thu, 13 Jan 2011 04:24:31 +0000 (23:24 -0500)
committerChong Yidong <cyd@stupidchicken.com>
Thu, 13 Jan 2011 04:24:31 +0000 (23:24 -0500)
This should not be merged into the trunk.

lisp/gnus/ChangeLog
lisp/gnus/message.el

index 6a363c0b4f1ba50e0e1c058bdd3b9e09bb80de21..eecbe978c298503e8b9ca1a09fa485911650622b 100644 (file)
@@ -1,3 +1,7 @@
+2011-01-13  Chong Yidong  <cyd@stupidchicken.com>
+
+       * message.el (message-bury): Add special-case handling for Rmail.
+
 2011-01-12  Glenn Morris  <rgm@gnu.org>
 
        * message.el (message-mail): A compose-mail function should
index 0ea0df460607d468ce63f98b05ee19d5fa19ad05..63fcf500189e4ae1e533872096a2c777a0571f99 100644 (file)
@@ -4023,12 +4023,32 @@ Instead, just auto-save the buffer and then bury it."
 
 (defun message-bury (buffer)
   "Bury this mail BUFFER."
-  (let ((newbuf (other-buffer buffer)))
-    (bury-buffer buffer)
-    (if (and (window-dedicated-p (selected-window))
+  (let ((newbuf (other-buffer (current-buffer))))
+    (bury-buffer (current-buffer))
+    (if (and (window-dedicated-p (frame-selected-window))
             (not (null (delq (selected-frame) (visible-frame-list)))))
        (delete-frame (selected-frame))
-      (switch-to-buffer newbuf))))
+      ;; Temporary hack to make this behave like `mail-bury', when
+      ;; used with Rmail.  Replaced in Emacs 24 with
+      (let (rmail-flag summary-buffer)
+       (and (not (one-window-p))
+            (with-current-buffer
+                 (window-buffer (next-window (selected-window) 'not))
+              (setq rmail-flag (eq major-mode 'rmail-mode))
+              (setq summary-buffer
+                    (and (if (boundp 'mail-bury-selects-summary)
+                             mail-bury-selects-summary
+                           t)
+                         (boundp 'rmail-summary-buffer)
+                         rmail-summary-buffer
+                         (buffer-name rmail-summary-buffer)
+                         (not (get-buffer-window rmail-summary-buffer))
+                         rmail-summary-buffer))))
+       (if rmail-flag
+           ;; If the Rmail buffer has a summary, show that.
+           (if summary-buffer (switch-to-buffer summary-buffer)
+             (delete-window))
+         (switch-to-buffer newbuf))))))
 
 (defun message-send (&optional arg)
   "Send the message in the current buffer.