Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
3ca9dd8d
Commit
3ca9dd8d
authored
Nov 11, 1995
by
Richard M. Stallman
Browse files
(balance-windows): Don't count the menu bar's lines in the frame height.
parent
a1aaa23f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lisp/window.el
lisp/window.el
+5
-2
No files found.
lisp/window.el
View file @
3ca9dd8d
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment