]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix last fix for adjust-window-trailing-edge.
authorMartin Rudalics <rudalics@gmx.at>
Thu, 14 Apr 2011 18:24:49 +0000 (20:24 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Thu, 14 Apr 2011 18:24:49 +0000 (20:24 +0200)
* window.el (adjust-window-trailing-edge): Assign normal sizes
to the windows affected in window-splits nil case.

lisp/ChangeLog
lisp/window.el

index 05cf4c2489ec227c1e944846db46557f13ed4c12..425abfd5a40772fb59c10bbf93408264bb5ce796 100644 (file)
@@ -1,3 +1,8 @@
+2011-04-14  Martin Rudalics  <rudalics@gmx.at>
+
+       * window.el (adjust-window-trailing-edge): Assign normal sizes
+       to the windows affected in window-splits nil case.
+
 2011-04-14  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * minibuffer.el (completion-in-region-mode-predicate)
index 51da9014db9cb4c0d0d8e18daa79b85d14c24741..91fa80d876884fbbadf6584bd10ee07e925ef2c0 100644 (file)
@@ -2117,21 +2117,26 @@ possible in the desired direction."
                 (window-sizable-p left delta horizontal)
                 (window-sizable-p right (- delta) horizontal))
            ;; For the window-splits nil case proceed conventionally.
-           (progn
+           (let ((parent-size
+                  (window-total-size (window-parent left) horizontal)))
              (resize-this-window left delta horizontal nil t)
-             (resize-this-window right (- delta) horizontal nil t))
-       ;; Try to enlarge LEFT first.
-       (setq this-delta (window-resizable left delta horizontal))
-       (unless (zerop this-delta)
-         (resize-this-window left this-delta horizontal nil t 'left))
-       (unless (= this-delta delta)
-         ;; We didn't get it all from LEFT, enlarge windows on left of
-         ;; LEFT (for this purpose make `resize-other-windows' believe
-         ;; that we shrink LEFT).
-         (resize-other-windows
-          left (- this-delta delta) horizontal nil 'left))
-       ;; Shrink windows on right of LEFT.
-       (resize-other-windows left delta horizontal nil 'right))))
+             (resize-this-window right (- delta) horizontal nil t)
+             (resize-window-normal
+              left (/ (float (window-new-total-size left)) parent-size))
+             (resize-window-normal
+              right (/ (float (window-new-total-size right)) parent-size)))
+         ;; Try to enlarge LEFT first.
+         (setq this-delta (window-resizable left delta horizontal))
+         (unless (zerop this-delta)
+           (resize-this-window left this-delta horizontal nil t 'left))
+         (unless (= this-delta delta)
+           ;; We didn't get it all from LEFT, enlarge windows on left of
+           ;; LEFT (for this purpose make `resize-other-windows' believe
+           ;; that we shrink LEFT).
+           (resize-other-windows
+            left (- this-delta delta) horizontal nil 'left))
+         ;; Shrink windows on right of LEFT.
+         (resize-other-windows left delta horizontal nil 'right))))
      ((< delta 0)
       (setq max-delta (window-max-delta-1 right 0 horizontal nil 'left))
       (setq min-delta (window-min-delta-1 left delta horizontal nil 'right))
@@ -2145,21 +2150,26 @@ possible in the desired direction."
                 (window-sizable-p left delta horizontal)
                 (window-sizable-p right (- delta) horizontal))
            ;; For the window-splits nil case proceed conventionally.
-           (progn
+           (let ((parent-size
+                  (window-total-size (window-parent left) horizontal)))
              (resize-this-window left delta horizontal nil t)
-             (resize-this-window right (- delta) horizontal nil t))
-       ;; Try to enlarge RIGHT.
-       (setq this-delta (window-resizable right (- delta) horizontal))
-       (unless (zerop this-delta)
-         (resize-this-window right this-delta horizontal nil t 'right))
-       (unless (= (- this-delta) delta)
-         ;; We didn't get it all from RIGHT, enlarge windows on right of
-         ;; RIGHT (for this purpose make `resize-other-windows' believe
-         ;; that we grow RIGHT).
-         (resize-other-windows
-          right (- this-delta delta) horizontal nil 'right))
-       ;; Shrink windows on left of RIGHT.
-       (resize-other-windows right (- delta) horizontal nil 'left)))))
+             (resize-this-window right (- delta) horizontal nil t)
+             (resize-window-normal
+              left (/ (float (window-new-total-size left)) parent-size))
+             (resize-window-normal
+              right (/ (float (window-new-total-size right)) parent-size)))
+         ;; Try to enlarge RIGHT.
+         (setq this-delta (window-resizable right (- delta) horizontal))
+         (unless (zerop this-delta)
+           (resize-this-window right this-delta horizontal nil t 'right))
+         (unless (= (- this-delta) delta)
+           ;; We didn't get it all from RIGHT, enlarge windows on right of
+           ;; RIGHT (for this purpose make `resize-other-windows' believe
+           ;; that we grow RIGHT).
+           (resize-other-windows
+            right (- this-delta delta) horizontal nil 'right))
+         ;; Shrink windows on left of RIGHT.
+         (resize-other-windows right (- delta) horizontal nil 'left)))))
     (unless (zerop delta)
       ;; Don't report an error in the standard case.
       (unless (resize-window-apply frame horizontal)