diff options
author | Richard M. Stallman <rms@gnu.org> | 1995-11-11 23:51:44 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1995-11-11 23:51:44 +0000 |
commit | fcf9bc5a2e023d96697015f93675b4663880011c (patch) | |
tree | 82ec9d4c20f30afa54f83d0c7447f2646e20b1ab /lisp/window.el | |
parent | 489793e30f1e98c32174d61e5fc37194ba9e4837 (diff) | |
download | emacs-fcf9bc5a2e023d96697015f93675b4663880011c.tar.gz |
(balance-windows): Don't count the menu bar's lines in the frame height.
Diffstat (limited to 'lisp/window.el')
-rw-r--r-- | lisp/window.el | 7 |
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." (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 @@ even if it is active." (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) |