Subject: bug#13066: 24.2.90; setting rmail-summary-window-size causes error

From: martin rudalics <[email-masked]>
Date: Sun, 30 Dec 2012 10:28:42 +0100

> It seems that the new code changed the logic.  Now
 > rmail-summary-window-size doesn't take effect.  As I didn't
 > customize rmail-redisplay-summary, its value is nil.  And
 > the new code handles rmail-summary-window-size only if its
 > value is non-nil.
 >
 >     (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
 > 	 rmail-redisplay-summary   ;; <--- !!!
 > 	 (setq window
 > 	       (display-buffer
 > 		rmail-summary-buffer '(nil (reusable-frames . visible))))
 > 	 rmail-summary-window-size
 > 	 (setq size (- rmail-summary-window-size (window-height window)))
 > 	 (window--resizable-p window size)
 > 	 (window-resize window size))))

I obviously have no idea how this is supposed to work :-(

We could replace the condition

   (when (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
	     rmail-redisplay-summary)

in `rmail-maybe-display-summary' either by

   (when (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
	     (or rmail-redisplay-summary
		 (get-buffer-window rmail-summary-buffer 0)))

or by

   (when (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
	     (or rmail-redisplay-summary rmail-summary-window-size))

Both should work if the summary window was specially created for the
summary.  They won't work when the window got merely reused - but in
that case resizing the window doesn't strike me as a good idea in the
first place.  Can you try them?

If this doesn't help, can you please tell me when and why you want to
resize the summary window and why you want to do that with
`rmail-redisplay-summary' set to nil?  I can obviously restore the old
logic but would like to understand it first.

Thanks, martin