emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r111388: Once more fix resizing of rm


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111388: Once more fix resizing of rmail summary window.
Date: Mon, 31 Dec 2012 12:35:13 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111388
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Mon 2012-12-31 12:35:13 +0100
message:
  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.
modified:
  lisp/ChangeLog
  lisp/mail/rmail.el
  lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-12-31 04:43:35 +0000
+++ b/lisp/ChangeLog    2012-12-31 11:35:13 +0000
@@ -1,3 +1,11 @@
+2012-12-31  Martin Rudalics  <address@hidden>
+
+       * 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.
+
 2012-12-31  Stefan Monnier  <address@hidden>
 
        * subr.el (special-form-p): Don't signal errors on undef aliases.

=== modified file 'lisp/mail/rmail.el'
--- a/lisp/mail/rmail.el        2012-12-31 11:20:58 +0000
+++ b/lisp/mail/rmail.el        2012-12-31 11:35:13 +0000
@@ -4224,15 +4224,25 @@
 
 ;; Put the summary buffer back on the screen, if user wants that.
 (defun rmail-maybe-display-summary ()
-  ;; If requested, make sure the summary is displayed.
-  (when (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
-            rmail-redisplay-summary)
+  (cond
+   ((or (not rmail-summary-buffer)
+       (not (buffer-name rmail-summary-buffer))))
+   (rmail-redisplay-summary
+    ;; If `rmail-redisplay-summary' is non-nil, make sure the summary
+    ;; buffer is displayed.
     (display-buffer
      rmail-summary-buffer
      `(nil
        (reusable-frames . 0)
        ,(when rmail-summary-window-size
-         `(window-height . ,rmail-summary-window-size))))))
+         `(window-height . ,rmail-summary-window-size)))))
+   (rmail-summary-window-size
+    ;; If `rmail-summary-window-size' is non-nil and the summary buffer
+    ;; is displayed, make sure it gets resized.
+    (let ((window (get-buffer-window rmail-summary-buffer 0)))
+      (when window
+       (window-resize-no-error
+        window (- rmail-summary-window-size (window-height window))))))))
 
 ;;;; *** Rmail Local Fontification ***
 

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2012-11-19 03:16:03 +0000
+++ b/lisp/window.el    2012-12-31 11:35:13 +0000
@@ -1340,7 +1340,7 @@
         delta))
    (t 0)))
 
-(defun window--resizable-p (window delta &optional horizontal ignore trail 
noup nodown)
+(defun window-resizable-p (window delta &optional horizontal ignore trail noup 
nodown)
   "Return t if WINDOW can be resized vertically by DELTA lines.
 WINDOW must be a valid window and defaults to the selected one.
 For the meaning of the arguments of this function see the
@@ -1943,7 +1943,7 @@
       ;; nil or the minibuffer window is active, resize the minibuffer
       ;; window.
       (window--resize-mini-window minibuffer-window (- delta)))
-     ((window--resizable-p window delta horizontal ignore)
+     ((window-resizable-p window delta horizontal ignore)
       (window--resize-reset frame horizontal)
       (window--resize-this-window window delta horizontal ignore t)
       (if (and (not window-combination-resize)
@@ -1969,6 +1969,14 @@
      (t
       (error "Cannot resize window %s" window)))))
 
+(defun window-resize-no-error (window delta &optional horizontal ignore)
+  "Resize WINDOW vertically if it is resizable by DELTA lines.
+This function is like `window-resize' but does not signal an
+error when WINDOW cannot be resized.  For the meaning of the
+optional arguments see the documentation of `window-resize'."
+  (when (window-resizable-p window delta horizontal ignore)
+    (window-resize window delta horizontal ignore)))
+
 (defun window--resize-child-windows-skip-p (window)
   "Return non-nil if WINDOW shall be skipped by resizing routines."
   (memq (window-new-normal window) '(ignore stuck skip)))
@@ -2594,7 +2602,7 @@
       ;; If the selected window is full height and `resize-mini-windows'
       ;; is nil, resize the minibuffer window.
       (window--resize-mini-window minibuffer-window (- delta)))
-     ((window--resizable-p nil delta horizontal)
+     ((window-resizable-p nil delta horizontal)
       (window-resize nil delta horizontal))
      (t
       (window-resize
@@ -2627,7 +2635,7 @@
       ;; If the selected window is full height and `resize-mini-windows'
       ;; is nil, resize the minibuffer window.
       (window--resize-mini-window minibuffer-window delta))
-     ((window--resizable-p nil (- delta) horizontal)
+     ((window-resizable-p nil (- delta) horizontal)
       (window-resize nil (- delta) horizontal))
      (t
       (window-resize
@@ -2901,7 +2909,7 @@
          (set-window-new-normal
           sibling (+ (window-normal-size sibling horizontal)
                      (window-normal-size window horizontal))))
-        ((window--resizable-p window (- size) horizontal nil nil nil t)
+        ((window-resizable-p window (- size) horizontal nil nil nil t)
          ;; Can do without resizing fixed-size windows.
          (window--resize-siblings window (- size) horizontal))
         (t
@@ -4440,13 +4448,13 @@
              (let ((delta (- (cdr (assq 'total-height item))
                              (window-total-height window)))
                    window-size-fixed)
-               (when (window--resizable-p window delta)
+               (when (window-resizable-p window delta)
                  (window-resize window delta)))
            ;; Else check whether the window is not high enough.
            (let* ((min-size (window-min-size window nil ignore))
                   (delta (- min-size (window-total-size window))))
              (when (and (> delta 0)
-                        (window--resizable-p window delta nil ignore))
+                        (window-resizable-p window delta nil ignore))
                (window-resize window delta nil ignore))))
          ;; Adjust horizontally.
          (if (memq window-size-fixed '(t width))
@@ -4454,13 +4462,13 @@
              (let ((delta (- (cdr (assq 'total-width item))
                              (window-total-width window)))
                    window-size-fixed)
-               (when (window--resizable-p window delta)
+               (when (window-resizable-p window delta)
                  (window-resize window delta)))
            ;; Else check whether the window is not wide enough.
            (let* ((min-size (window-min-size window t ignore))
                   (delta (- min-size (window-total-size window t))))
              (when (and (> delta 0)
-                        (window--resizable-p window delta t ignore))
+                        (window-resizable-p window delta t ignore))
                (window-resize window delta t ignore))))
          ;; Set dedicated status.
          (set-window-dedicated-p window (cdr (assq 'dedicated state)))
@@ -5211,7 +5219,7 @@
                     (* (window-total-size (frame-root-window window))
                        height))))
                 (delta (- new-height (window-total-size window))))
-           (when (and (window--resizable-p window delta nil 'safe)
+           (when (and (window-resizable-p window delta nil 'safe)
                       (window-combined-p window))
              (window-resize window delta nil 'safe))))
         ((functionp height)
@@ -5227,7 +5235,7 @@
                     (* (window-total-size (frame-root-window window) t)
                        width))))
                 (delta (- new-width (window-total-size window t))))
-           (when (and (window--resizable-p window delta t 'safe)
+           (when (and (window-resizable-p window delta t 'safe)
                       (window-combined-p window t))
              (window-resize window delta t 'safe))))
         ((functionp width)


reply via email to

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