Rewrite rmail-maybe-display-summary (Bug#13066).
authorMartin Rudalics <rudalics@gmx.at>
Fri, 28 Dec 2012 10:24:04 +0000 (11:24 +0100)
committerMartin Rudalics <rudalics@gmx.at>
Fri, 28 Dec 2012 10:24:04 +0000 (11:24 +0100)
* mail/rmail.el (rmail-maybe-display-summary): Rewrite
(Bug#13066).

lisp/ChangeLog
lisp/mail/rmail.el

index e13ce39..1083dc5 100644 (file)
@@ -1,3 +1,8 @@
+2012-12-28  Martin Rudalics  <rudalics@gmx.at>
+
+       * mail/rmail.el (rmail-maybe-display-summary): Rewrite
+       (Bug#13066).
+
 2012-12-28  Andreas Schwab  <schwab@linux-m68k.org>
 
        * epg.el (epg--start): Modify process-environment locally.
index 9c48788..dbda8a6 100644 (file)
@@ -4224,31 +4224,17 @@ This has an effect only if a summary buffer exists."
 
 ;; Put the summary buffer back on the screen, if user wants that.
 (defun rmail-maybe-display-summary ()
-  (let ((selected (selected-window))
-       (buffer (current-buffer))
-       window)
+  (let (window size)
     ;; If requested, make sure the summary is displayed.
     (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
         rmail-redisplay-summary
-        (if (get-buffer-window rmail-summary-buffer 0)
-            ;; It's already in some frame; show that one.
-            (let ((frame (window-frame
-                          (get-buffer-window rmail-summary-buffer 0))))
-              (make-frame-visible frame)
-              (raise-frame frame))
-          (display-buffer rmail-summary-buffer)))
-    ;; If requested, set the height of the summary window.
-    (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
+        (setq window
+              (display-buffer
+               rmail-summary-buffer '(nil (reusable-frames . visible))))
         rmail-summary-window-size
-        (setq window (get-buffer-window rmail-summary-buffer))
-        ;; Don't try to change the size if just one window in frame.
-        (not (eq window (frame-root-window (window-frame window))))
-        (unwind-protect
-            (progn
-              (select-window window)
-              (enlarge-window (- rmail-summary-window-size (window-height))))
-          (select-window selected)
-          (set-buffer buffer)))))
+        (setq size (- rmail-summary-window-size (window-height window)))
+        (window--resizable-p window size)
+        (window-resize window size))))
 \f
 ;;;; *** Rmail Local Fontification ***