aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman1995-11-11 23:51:44 +0000
committerRichard M. Stallman1995-11-11 23:51:44 +0000
commit3ca9dd8d9f849d2045421c38d0ed6f017dd4cc14 (patch)
tree592059b59c3a49b5ced47b9101bba1749936a697 /lisp
parenta1aaa23f9f2c12773f301a0fb427db34d425edb9 (diff)
downloademacs-3ca9dd8d9f849d2045421c38d0ed6f017dd4cc14.tar.gz
emacs-3ca9dd8d9f849d2045421c38d0ed6f017dd4cc14.zip
(balance-windows): Don't count the menu bar's lines in the frame height.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/window.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/window.el b/lisp/window.el
index bfaa657a2e2..8701d121015 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -98,7 +98,10 @@ even if it is active."
98(defun balance-windows () 98(defun balance-windows ()
99 "Makes all visible windows the same height (approximately)." 99 "Makes all visible windows the same height (approximately)."
100 (interactive) 100 (interactive)
101 (let ((count -1) levels newsizes size) 101 (let ((count -1) levels newsizes size
102 ;; Don't count the lines that are above the uppermost windows.
103 ;; (These are the menu bar lines, if any.)
104 (mbl (nth 1 (window-edges (frame-first-window (selected-frame))))))
102 ;; Find all the different vpos's at which windows start, 105 ;; Find all the different vpos's at which windows start,
103 ;; then count them. But ignore levels that differ by only 1. 106 ;; then count them. But ignore levels that differ by only 1.
104 (save-window-excursion 107 (save-window-excursion
@@ -116,7 +119,7 @@ even if it is active."
116 (setq tops (cdr tops))) 119 (setq tops (cdr tops)))
117 (setq count (1+ count)))) 120 (setq count (1+ count))))
118 ;; Subdivide the frame into that many vertical levels. 121 ;; Subdivide the frame into that many vertical levels.
119 (setq size (/ (frame-height) count)) 122 (setq size (/ (- (frame-height) mbl) count))
120 (walk-windows (function 123 (walk-windows (function
121 (lambda (w) 124 (lambda (w)
122 (select-window w) 125 (select-window w)