emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r109773: Handle evening window height


From: martin rudalics
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r109773: Handle evening window heights more correctly (Bug#11880) and (Bug#12091).
Date: Sat, 25 Aug 2012 16:52:02 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 109773
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Sat 2012-08-25 16:52:02 +0200
message:
  Handle evening window heights more correctly (Bug#11880) and (Bug#12091).
  
  * window.el (window--even-window-heights): Even heights when
  WINDOW and the selected window form a vertical combination.
  (display-buffer-use-some-window): Provide that window used gets
  sized back by quit-window.  (Bug#11880) and (Bug#12091)
modified:
  lisp/ChangeLog
  lisp/window.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-08-24 04:05:25 +0000
+++ b/lisp/ChangeLog    2012-08-25 14:52:02 +0000
@@ -1,3 +1,10 @@
+2012-08-25  Martin Rudalics  <address@hidden>
+
+       * window.el (window--even-window-heights): Even heights when
+       WINDOW and the selected window form a vertical combination.
+       (display-buffer-use-some-window): Provide that window used gets
+       sized back by quit-window.  (Bug#11880) and (Bug#12091)
+
 2012-08-24  Paul Eggert  <address@hidden>
 
        Fix file time stamp problem with bzr and CVS (Bug#12001).

=== modified file 'lisp/window.el'
--- a/lisp/window.el    2012-08-22 09:22:08 +0000
+++ b/lisp/window.el    2012-08-25 14:52:02 +0000
@@ -4911,23 +4911,19 @@
 other, `even-window-heights' is non-nil, and the selected window
 is higher than WINDOW."
   (when (and even-window-heights
-            (not (eq window (selected-window)))
-            ;; Don't resize minibuffer windows.
-            (not (window-minibuffer-p (selected-window)))
-            (> (window-height (selected-window)) (window-height window))
-            (eq (window-frame window) (window-frame (selected-window)))
-            (let ((sel-edges (window-edges (selected-window)))
-                  (win-edges (window-edges window)))
-              (and (= (nth 0 sel-edges) (nth 0 win-edges))
-                   (= (nth 2 sel-edges) (nth 2 win-edges))
-                   (or (= (nth 1 sel-edges) (nth 3 win-edges))
-                       (= (nth 3 sel-edges) (nth 1 win-edges))))))
-    (let ((window-min-height 1))
-      ;; Don't throw an error if we can't even window heights for
-      ;; whatever reason.
-      (condition-case nil
-         (enlarge-window (/ (- (window-height window) (window-height)) 2))
-       (error nil)))))
+            ;; Even iff WINDOW forms a vertical combination with the
+            ;; selected window, and WINDOW's height exceeds that of the
+            ;; selected window, see also bug#11880.
+            (window-combined-p window)
+            (= (window-child-count (window-parent window)) 2)
+            (eq (window-parent) (window-parent window))
+            (> (window-total-height) (window-total-height window)))
+    ;; Don't throw an error if we can't even window heights for
+    ;; whatever reason.
+    (condition-case nil
+       (enlarge-window
+        (/ (- (window-total-height window) (window-total-height)) 2))
+      (error nil))))
 
 (defun window--display-buffer (buffer window type &optional dedicated)
   "Display BUFFER in WINDOW and make its frame visible.
@@ -5334,8 +5330,9 @@
                  window))
              (get-largest-window 0 not-this-window))))
     (when (window-live-p window)
-      (window--even-window-heights window)
-      (prog1 (window--display-buffer buffer window 'reuse)
+      (prog1
+         (window--display-buffer buffer window 'reuse)
+       (window--even-window-heights window)
        (unless (cdr (assq 'inhibit-switch-frame alist))
          (window--maybe-raise-frame (window-frame window)))))))
 


reply via email to

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