aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2012-12-31 12:35:13 +0100
committerMartin Rudalics2012-12-31 12:35:13 +0100
commit27fcfe31010c45f2e87ce51fa2fe99183731e261 (patch)
tree7f0a28c296ea2132a8d0cf6ac675277a9d05ddbb
parent393e7ee04463305dfbd0027e3e7c72fc80888186 (diff)
downloademacs-27fcfe31010c45f2e87ce51fa2fe99183731e261.tar.gz
emacs-27fcfe31010c45f2e87ce51fa2fe99183731e261.zip
Once more fix resizing of rmail summary window.
* window.el (window-resizable--p): Rename to window-resizable-p. (window-resize-no-error): New function. * mail/rmail.el (rmail-maybe-display-summary): Restore behavior broken in fix from 2012-12-28.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/mail/rmail.el18
-rw-r--r--lisp/window.el30
3 files changed, 41 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 06a5bd7bff4..88200a27133 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12012-12-31 Martin Rudalics <rudalics@gmx.at>
2
3 * window.el (window-resizable--p): Rename to window-resizable-p.
4 (window-resize-no-error): New function.
5
6 * mail/rmail.el (rmail-maybe-display-summary): Restore behavior
7 broken in fix from 2012-12-28.
8
12012-12-31 Stefan Monnier <monnier@iro.umontreal.ca> 92012-12-31 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * subr.el (special-form-p): Don't signal errors on undef aliases. 11 * subr.el (special-form-p): Don't signal errors on undef aliases.
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 096b53c6cab..947d8e2cb4c 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -4224,15 +4224,25 @@ This has an effect only if a summary buffer exists."
4224 4224
4225;; Put the summary buffer back on the screen, if user wants that. 4225;; Put the summary buffer back on the screen, if user wants that.
4226(defun rmail-maybe-display-summary () 4226(defun rmail-maybe-display-summary ()
4227 ;; If requested, make sure the summary is displayed. 4227 (cond
4228 (when (and rmail-summary-buffer (buffer-name rmail-summary-buffer) 4228 ((or (not rmail-summary-buffer)
4229 rmail-redisplay-summary) 4229 (not (buffer-name rmail-summary-buffer))))
4230 (rmail-redisplay-summary
4231 ;; If `rmail-redisplay-summary' is non-nil, make sure the summary
4232 ;; buffer is displayed.
4230 (display-buffer 4233 (display-buffer
4231 rmail-summary-buffer 4234 rmail-summary-buffer
4232 `(nil 4235 `(nil
4233 (reusable-frames . 0) 4236 (reusable-frames . 0)
4234 ,(when rmail-summary-window-size 4237 ,(when rmail-summary-window-size
4235 `(window-height . ,rmail-summary-window-size)))))) 4238 `(window-height . ,rmail-summary-window-size)))))
4239 (rmail-summary-window-size
4240 ;; If `rmail-summary-window-size' is non-nil and the summary buffer
4241 ;; is displayed, make sure it gets resized.
4242 (let ((window (get-buffer-window rmail-summary-buffer 0)))
4243 (when window
4244 (window-resize-no-error
4245 window (- rmail-summary-window-size (window-height window))))))))
4236 4246
4237;;;; *** Rmail Local Fontification *** 4247;;;; *** Rmail Local Fontification ***
4238 4248
diff --git a/lisp/window.el b/lisp/window.el
index 52909fa9e5f..250978d0053 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1340,7 +1340,7 @@ violate size restrictions of WINDOW or its child windows."
1340 delta)) 1340 delta))
1341 (t 0))) 1341 (t 0)))
1342 1342
1343(defun window--resizable-p (window delta &optional horizontal ignore trail noup nodown) 1343(defun window-resizable-p (window delta &optional horizontal ignore trail noup nodown)
1344 "Return t if WINDOW can be resized vertically by DELTA lines. 1344 "Return t if WINDOW can be resized vertically by DELTA lines.
1345WINDOW must be a valid window and defaults to the selected one. 1345WINDOW must be a valid window and defaults to the selected one.
1346For the meaning of the arguments of this function see the 1346For the meaning of the arguments of this function see the
@@ -1943,7 +1943,7 @@ instead."
1943 ;; nil or the minibuffer window is active, resize the minibuffer 1943 ;; nil or the minibuffer window is active, resize the minibuffer
1944 ;; window. 1944 ;; window.
1945 (window--resize-mini-window minibuffer-window (- delta))) 1945 (window--resize-mini-window minibuffer-window (- delta)))
1946 ((window--resizable-p window delta horizontal ignore) 1946 ((window-resizable-p window delta horizontal ignore)
1947 (window--resize-reset frame horizontal) 1947 (window--resize-reset frame horizontal)
1948 (window--resize-this-window window delta horizontal ignore t) 1948 (window--resize-this-window window delta horizontal ignore t)
1949 (if (and (not window-combination-resize) 1949 (if (and (not window-combination-resize)
@@ -1969,6 +1969,14 @@ instead."
1969 (t 1969 (t
1970 (error "Cannot resize window %s" window))))) 1970 (error "Cannot resize window %s" window)))))
1971 1971
1972(defun window-resize-no-error (window delta &optional horizontal ignore)
1973 "Resize WINDOW vertically if it is resizable by DELTA lines.
1974This function is like `window-resize' but does not signal an
1975error when WINDOW cannot be resized. For the meaning of the
1976optional arguments see the documentation of `window-resize'."
1977 (when (window-resizable-p window delta horizontal ignore)
1978 (window-resize window delta horizontal ignore)))
1979
1972(defun window--resize-child-windows-skip-p (window) 1980(defun window--resize-child-windows-skip-p (window)
1973 "Return non-nil if WINDOW shall be skipped by resizing routines." 1981 "Return non-nil if WINDOW shall be skipped by resizing routines."
1974 (memq (window-new-normal window) '(ignore stuck skip))) 1982 (memq (window-new-normal window) '(ignore stuck skip)))
@@ -2594,7 +2602,7 @@ negative, shrink selected window by -DELTA lines or columns."
2594 ;; If the selected window is full height and `resize-mini-windows' 2602 ;; If the selected window is full height and `resize-mini-windows'
2595 ;; is nil, resize the minibuffer window. 2603 ;; is nil, resize the minibuffer window.
2596 (window--resize-mini-window minibuffer-window (- delta))) 2604 (window--resize-mini-window minibuffer-window (- delta)))
2597 ((window--resizable-p nil delta horizontal) 2605 ((window-resizable-p nil delta horizontal)
2598 (window-resize nil delta horizontal)) 2606 (window-resize nil delta horizontal))
2599 (t 2607 (t
2600 (window-resize 2608 (window-resize
@@ -2627,7 +2635,7 @@ Also see the `window-min-height' variable."
2627 ;; If the selected window is full height and `resize-mini-windows' 2635 ;; If the selected window is full height and `resize-mini-windows'
2628 ;; is nil, resize the minibuffer window. 2636 ;; is nil, resize the minibuffer window.
2629 (window--resize-mini-window minibuffer-window delta)) 2637 (window--resize-mini-window minibuffer-window delta))
2630 ((window--resizable-p nil (- delta) horizontal) 2638 ((window-resizable-p nil (- delta) horizontal)
2631 (window-resize nil (- delta) horizontal)) 2639 (window-resize nil (- delta) horizontal))
2632 (t 2640 (t
2633 (window-resize 2641 (window-resize
@@ -2901,7 +2909,7 @@ that is its frame's root window."
2901 (set-window-new-normal 2909 (set-window-new-normal
2902 sibling (+ (window-normal-size sibling horizontal) 2910 sibling (+ (window-normal-size sibling horizontal)
2903 (window-normal-size window horizontal)))) 2911 (window-normal-size window horizontal))))
2904 ((window--resizable-p window (- size) horizontal nil nil nil t) 2912 ((window-resizable-p window (- size) horizontal nil nil nil t)
2905 ;; Can do without resizing fixed-size windows. 2913 ;; Can do without resizing fixed-size windows.
2906 (window--resize-siblings window (- size) horizontal)) 2914 (window--resize-siblings window (- size) horizontal))
2907 (t 2915 (t
@@ -4440,13 +4448,13 @@ value can be also stored on disk and read back in a new session."
4440 (let ((delta (- (cdr (assq 'total-height item)) 4448 (let ((delta (- (cdr (assq 'total-height item))
4441 (window-total-height window))) 4449 (window-total-height window)))
4442 window-size-fixed) 4450 window-size-fixed)
4443 (when (window--resizable-p window delta) 4451 (when (window-resizable-p window delta)
4444 (window-resize window delta))) 4452 (window-resize window delta)))
4445 ;; Else check whether the window is not high enough. 4453 ;; Else check whether the window is not high enough.
4446 (let* ((min-size (window-min-size window nil ignore)) 4454 (let* ((min-size (window-min-size window nil ignore))
4447 (delta (- min-size (window-total-size window)))) 4455 (delta (- min-size (window-total-size window))))
4448 (when (and (> delta 0) 4456 (when (and (> delta 0)
4449 (window--resizable-p window delta nil ignore)) 4457 (window-resizable-p window delta nil ignore))
4450 (window-resize window delta nil ignore)))) 4458 (window-resize window delta nil ignore))))
4451 ;; Adjust horizontally. 4459 ;; Adjust horizontally.
4452 (if (memq window-size-fixed '(t width)) 4460 (if (memq window-size-fixed '(t width))
@@ -4454,13 +4462,13 @@ value can be also stored on disk and read back in a new session."
4454 (let ((delta (- (cdr (assq 'total-width item)) 4462 (let ((delta (- (cdr (assq 'total-width item))
4455 (window-total-width window))) 4463 (window-total-width window)))
4456 window-size-fixed) 4464 window-size-fixed)
4457 (when (window--resizable-p window delta) 4465 (when (window-resizable-p window delta)
4458 (window-resize window delta))) 4466 (window-resize window delta)))
4459 ;; Else check whether the window is not wide enough. 4467 ;; Else check whether the window is not wide enough.
4460 (let* ((min-size (window-min-size window t ignore)) 4468 (let* ((min-size (window-min-size window t ignore))
4461 (delta (- min-size (window-total-size window t)))) 4469 (delta (- min-size (window-total-size window t))))
4462 (when (and (> delta 0) 4470 (when (and (> delta 0)
4463 (window--resizable-p window delta t ignore)) 4471 (window-resizable-p window delta t ignore))
4464 (window-resize window delta t ignore)))) 4472 (window-resize window delta t ignore))))
4465 ;; Set dedicated status. 4473 ;; Set dedicated status.
4466 (set-window-dedicated-p window (cdr (assq 'dedicated state))) 4474 (set-window-dedicated-p window (cdr (assq 'dedicated state)))
@@ -5211,7 +5219,7 @@ live."
5211 (* (window-total-size (frame-root-window window)) 5219 (* (window-total-size (frame-root-window window))
5212 height)))) 5220 height))))
5213 (delta (- new-height (window-total-size window)))) 5221 (delta (- new-height (window-total-size window))))
5214 (when (and (window--resizable-p window delta nil 'safe) 5222 (when (and (window-resizable-p window delta nil 'safe)
5215 (window-combined-p window)) 5223 (window-combined-p window))
5216 (window-resize window delta nil 'safe)))) 5224 (window-resize window delta nil 'safe))))
5217 ((functionp height) 5225 ((functionp height)
@@ -5227,7 +5235,7 @@ live."
5227 (* (window-total-size (frame-root-window window) t) 5235 (* (window-total-size (frame-root-window window) t)
5228 width)))) 5236 width))))
5229 (delta (- new-width (window-total-size window t)))) 5237 (delta (- new-width (window-total-size window t))))
5230 (when (and (window--resizable-p window delta t 'safe) 5238 (when (and (window-resizable-p window delta t 'safe)
5231 (window-combined-p window t)) 5239 (window-combined-p window t))
5232 (window-resize window delta t 'safe)))) 5240 (window-resize window delta t 'safe))))
5233 ((functionp width) 5241 ((functionp width)