# HG changeset patch # User Richard M. Stallman # Date 816133904 0 # Node ID 75c6a5e1ee7a5ac8c6a38d7cc1b952fe618c7c6f # Parent 6a97ea1245b5c290f641fec516d677f85171f071 (balance-windows): Don't count the menu bar's lines in the frame height. diff -r 6a97ea1245b5 -r 75c6a5e1ee7a lisp/window.el --- a/lisp/window.el Sat Nov 11 23:50:10 1995 +0000 +++ b/lisp/window.el Sat Nov 11 23:51:44 1995 +0000 @@ -98,7 +98,10 @@ (defun balance-windows () "Makes all visible windows the same height (approximately)." (interactive) - (let ((count -1) levels newsizes size) + (let ((count -1) levels newsizes size + ;; Don't count the lines that are above the uppermost windows. + ;; (These are the menu bar lines, if any.) + (mbl (nth 1 (window-edges (frame-first-window (selected-frame)))))) ;; Find all the different vpos's at which windows start, ;; then count them. But ignore levels that differ by only 1. (save-window-excursion @@ -116,7 +119,7 @@ (setq tops (cdr tops))) (setq count (1+ count)))) ;; Subdivide the frame into that many vertical levels. - (setq size (/ (frame-height) count)) + (setq size (/ (- (frame-height) mbl) count)) (walk-windows (function (lambda (w) (select-window w)