aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2024-07-06 13:44:57 +0300
committerEli Zaretskii2024-07-06 13:44:57 +0300
commitde3fa00a6140b19e6d62a47be721b5ca9b58438b (patch)
treef5362a1824ee7a84d3ffe6896bcc20fbee647224
parentc986387c79fbae8a99352cad0113bec0b5cb11a5 (diff)
downloademacs-de3fa00a6140b19e6d62a47be721b5ca9b58438b.tar.gz
emacs-de3fa00a6140b19e6d62a47be721b5ca9b58438b.zip
Fix documentation of 'balance-windows'
* lisp/window.el (balance-windows): Doc fix. * doc/emacs/windows.texi (Change Window): Make the description of 'balance-windows' more accurate. (Bug#71915)
-rw-r--r--doc/emacs/windows.texi10
-rw-r--r--lisp/window.el11
2 files changed, 13 insertions, 8 deletions
diff --git a/doc/emacs/windows.texi b/doc/emacs/windows.texi
index 5ad6850fed9..60599d42020 100644
--- a/doc/emacs/windows.texi
+++ b/doc/emacs/windows.texi
@@ -300,7 +300,8 @@ Make selected window narrower (@code{shrink-window-horizontally}).
300Shrink this window if its buffer doesn't need so many lines 300Shrink this window if its buffer doesn't need so many lines
301(@code{shrink-window-if-larger-than-buffer}). 301(@code{shrink-window-if-larger-than-buffer}).
302@item C-x + 302@item C-x +
303Make all windows the same height (@code{balance-windows}). 303Balance the sizes of all the windows of the selected frame
304(@code{balance-windows}).
304@end table 305@end table
305 306
306@kindex C-x 0 307@kindex C-x 0
@@ -373,8 +374,11 @@ lines to other windows in the frame.
373 374
374@kindex C-x + 375@kindex C-x +
375@findex balance-windows 376@findex balance-windows
376 You can also use @kbd{C-x +} (@code{balance-windows}) to even out the 377 You can also use @kbd{C-x +} (@code{balance-windows}) to balance the
377heights of all the windows in the selected frame. 378sizes of all the windows of the selected frame (with the exception of
379the minibuffer window, @pxref{Minibuffer}). This command makes each
380horizontal pair of adjacent windows the same height, and each vertical
381pair of adjacent windows the same width.
378 382
379@node Displaying Buffers 383@node Displaying Buffers
380@section Displaying a Buffer in a Window 384@section Displaying a Buffer in a Window
diff --git a/lisp/window.el b/lisp/window.el
index 0dc9421fde7..60040f18bc7 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5888,12 +5888,13 @@ is non-nil)."
5888 (setq sub (window-right sub)))))))) 5888 (setq sub (window-right sub))))))))
5889 5889
5890(defun balance-windows (&optional window-or-frame) 5890(defun balance-windows (&optional window-or-frame)
5891 "Balance the sizes of windows of WINDOW-OR-FRAME. 5891 "Balance the sizes of windows shown on the selected frame.
5892WINDOW-OR-FRAME is optional and defaults to the selected frame. 5892When called from Lisp, WINDOW-OR-FRAME is optional and defaults to the
5893selected frame.
5893If WINDOW-OR-FRAME denotes a frame, balance the sizes of all 5894If WINDOW-OR-FRAME denotes a frame, balance the sizes of all
5894windows of that frame. If WINDOW-OR-FRAME denotes a window, 5895windows of that frame's root window (which excludes the mini-window).
5895recursively balance the sizes of all child windows of that 5896If WINDOW-OR-FRAME denotes a window, recursively balance the sizes
5896window." 5897of all child windows of that window."
5897 (interactive) 5898 (interactive)
5898 (let* ((window 5899 (let* ((window
5899 (cond 5900 (cond