mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-12 22:40:46 -08:00
upstream
This commit is contained in:
commit
8520d9c4e5
9 changed files with 183 additions and 140 deletions
|
|
@ -1,3 +1,9 @@
|
|||
2011-11-07 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* windows.texi (Resizing Windows, Splitting Windows)
|
||||
(Window Configurations): Use "child window" instead of
|
||||
"subwindow".
|
||||
|
||||
2011-11-06 Chong Yidong <cyd@gnu.org>
|
||||
|
||||
* windows.texi (Basic Windows): Clarify various definitions.
|
||||
|
|
|
|||
|
|
@ -719,7 +719,7 @@ Optional argument @var{noup} non-@code{nil} means don't go up in the
|
|||
window tree but try to steal or distribute the space needed for the
|
||||
resize operation among the other windows within @var{window}'s
|
||||
combination. Optional argument @var{nodown} non-@code{nil} means don't
|
||||
check whether @var{window} itself and its subwindows can be resized.
|
||||
check whether @var{window} itself and its child windows can be resized.
|
||||
@end defun
|
||||
|
||||
The function @code{window-resizable} does not change any window sizes.
|
||||
|
|
@ -1352,15 +1352,15 @@ windows only.
|
|||
|
||||
@cindex nest status
|
||||
The @dfn{nest status} of a window specifies whether that window may be
|
||||
removed and its subwindows recombined with that window's siblings when
|
||||
such a sibling's subwindow is deleted. The nest status is initially
|
||||
assigned by @code{split-window} from the current value of the variable
|
||||
@code{window-nest} (see above) and can be reset by the function
|
||||
removed and its child windows recombined with that window's siblings
|
||||
when such a sibling's child window is deleted. The nest status is
|
||||
initially assigned by @code{split-window} from the current value of the
|
||||
variable @code{window-nest} (see above) and can be reset by the function
|
||||
@code{set-window-nest} (see below).
|
||||
|
||||
If the return value is @code{nil}, subwindows of @var{window} may be
|
||||
If the return value is @code{nil}, child windows of @var{window} may be
|
||||
recombined with @var{window}'s siblings when a window gets deleted. A
|
||||
return value of @code{nil} means that subwindows of @var{window} are
|
||||
return value of @code{nil} means that child windows of @var{window} are
|
||||
never (re-)combined with @var{window}'s siblings in such a case.
|
||||
@end defun
|
||||
|
||||
|
|
@ -3740,7 +3740,7 @@ selected one.
|
|||
|
||||
The optional argument @var{ignore} non-@code{nil} means to ignore
|
||||
minimum window sizes and fixed size restrictions. If @var{ignore}
|
||||
equals @code{safe}, this means subwindows can get as small as one line
|
||||
equals @code{safe}, this means windows can get as small as one line
|
||||
and/or two columns.
|
||||
@end defun
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,24 @@
|
|||
2011-11-07 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* files.el (find-file): Always use selected-window.
|
||||
|
||||
2011-11-07 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* window.el (window-combinations): Make WINDOW argument
|
||||
mandatory. Rewrite doc-string.
|
||||
(walk-window-subtree, window-atom-check, window-min-delta)
|
||||
(window-max-delta, window--resize-this-window)
|
||||
(window--resize-root-window-vertically, window-tree)
|
||||
(balance-windows, window-state-put): Rewrite doc-strings as to
|
||||
not mention the term "subwindow".
|
||||
(window--resize-subwindows-skip-p): Rename to
|
||||
window--resize-child-windows-skip-p.
|
||||
(window--resize-subwindows-normal): Rename to
|
||||
window--resize-child-windows-normal.
|
||||
(window--resize-subwindows): Rename to
|
||||
window--resize-child-windows.
|
||||
(window-or-subwindow-p): Rename to window--in-subtree-p.
|
||||
|
||||
2011-11-07 Mark Lillibridge <mark.lillibridge@hp.com> (tiny change)
|
||||
|
||||
* mail/rmail.el (rmail-get-new-mail, rmail-insert-inbox-text):
|
||||
|
|
|
|||
|
|
@ -1343,7 +1343,7 @@ automatically choosing a major mode, use \\[find-file-literally]."
|
|||
(let ((value (find-file-noselect filename nil nil wildcards)))
|
||||
(if (listp value)
|
||||
(mapcar 'switch-to-buffer (nreverse value))
|
||||
(switch-to-buffer value))))
|
||||
(switch-to-buffer value nil 'force-same-window))))
|
||||
|
||||
(defun find-file-other-window (filename &optional wildcards)
|
||||
"Edit file FILENAME, in another window.
|
||||
|
|
|
|||
185
lisp/window.el
185
lisp/window.el
|
|
@ -211,11 +211,11 @@ horizontal window combination."
|
|||
(window-left-child parent)
|
||||
(window-top-child parent)))))
|
||||
|
||||
(defun window-combinations (&optional window horizontal)
|
||||
"Return largest number of vertically arranged subwindows of WINDOW.
|
||||
(defun window-combinations (window &optional horizontal)
|
||||
"Return largest number of windows vertically arranged within WINDOW.
|
||||
If WINDOW is omitted or nil, it defaults to the selected window.
|
||||
If HORIZONTAL is non-nil, return the largest number of
|
||||
horizontally arranged subwindows of WINDOW."
|
||||
windows horizontally arranged within WINDOW."
|
||||
(setq window (window-normalize-window window))
|
||||
(cond
|
||||
((window-live-p window)
|
||||
|
|
@ -225,7 +225,7 @@ horizontally arranged subwindows of WINDOW."
|
|||
(window-left-child window)
|
||||
(window-top-child window))
|
||||
;; If WINDOW is iso-combined, return the sum of the values for all
|
||||
;; subwindows of WINDOW.
|
||||
;; child windows of WINDOW.
|
||||
(let ((child (window-child window))
|
||||
(count 0))
|
||||
(while child
|
||||
|
|
@ -236,7 +236,7 @@ horizontally arranged subwindows of WINDOW."
|
|||
count))
|
||||
(t
|
||||
;; If WINDOW is not iso-combined, return the maximum value of any
|
||||
;; subwindow of WINDOW.
|
||||
;; child window of WINDOW.
|
||||
(let ((child (window-child window))
|
||||
(count 1))
|
||||
(while child
|
||||
|
|
@ -279,14 +279,16 @@ unpredictable."
|
|||
proc (frame-root-window walk-window-tree-frame) any)))
|
||||
|
||||
(defun walk-window-subtree (proc &optional window any)
|
||||
"Run function PROC on each live subwindow of WINDOW.
|
||||
"Run function PROC on the subtree of windows rooted at WINDOW.
|
||||
WINDOW defaults to the selected window. PROC must be a function
|
||||
with one argument - a window. ANY, if non-nil means to run PROC
|
||||
on all live and internal subwindows of WINDOW.
|
||||
with one argument - a window. By default, run PROC only on live
|
||||
windows of the subtree. If the optional argument ANY is non-nil,
|
||||
run PROC on all live and internal windows of the subtree. If
|
||||
WINDOW is live, run PROC on WINDOW only.
|
||||
|
||||
This function performs a pre-order, depth-first traversal of the
|
||||
window tree rooted at WINDOW. If PROC changes that window tree,
|
||||
the result is unpredictable."
|
||||
subtree rooted at WINDOW. If PROC changes that tree, the result
|
||||
is unpredictable."
|
||||
(setq window (window-normalize-window window))
|
||||
(walk-window-tree-1 proc window any t))
|
||||
|
||||
|
|
@ -381,9 +383,9 @@ WINDOW must be an internal window. Return WINDOW."
|
|||
(defun window-atom-check (&optional frame)
|
||||
"Check atomicity of all windows on FRAME.
|
||||
FRAME defaults to the selected frame. If an atomic window is
|
||||
wrongly configured, reset the atomicity of all its subwindows to
|
||||
nil. An atomic window is wrongly configured if it has no
|
||||
subwindows or one of its subwindows is not atomic."
|
||||
wrongly configured, reset the atomicity of all its windows on
|
||||
FRAME to nil. An atomic window is wrongly configured if it has
|
||||
no child windows or one of its child windows is not atomic."
|
||||
(window-atom-check-1 (frame-root-window frame)))
|
||||
|
||||
;; Side windows.
|
||||
|
|
@ -555,13 +557,13 @@ restrictions for that window only."
|
|||
;; WINDOW is an internal window.
|
||||
(if (window-combined-p sub horizontal)
|
||||
;; The minimum size of an iso-combination is the sum of
|
||||
;; the minimum sizes of its subwindows.
|
||||
;; the minimum sizes of its child windows.
|
||||
(while sub
|
||||
(setq value (+ value
|
||||
(window-min-size-1 sub horizontal ignore)))
|
||||
(setq sub (window-right sub)))
|
||||
;; The minimum size of an ortho-combination is the maximum of
|
||||
;; the minimum sizes of its subwindows.
|
||||
;; the minimum sizes of its child windows.
|
||||
(while sub
|
||||
(setq value (max value
|
||||
(window-min-size-1 sub horizontal ignore)))
|
||||
|
|
@ -619,8 +621,9 @@ Optional argument HORIZONTAL non-nil means return DELTA if DELTA
|
|||
columns can be added to WINDOW. A return value of zero means
|
||||
that no lines (or columns) can be added to WINDOW.
|
||||
|
||||
This function looks only at WINDOW and its subwindows. The
|
||||
function `window-resizable' looks at other windows as well.
|
||||
This function looks only at WINDOW and, recursively, its child
|
||||
windows. The function `window-resizable' looks at other windows
|
||||
as well.
|
||||
|
||||
DELTA positive means WINDOW shall be enlarged by DELTA lines or
|
||||
columns. If WINDOW cannot be enlarged by DELTA lines or columns
|
||||
|
|
@ -668,24 +671,24 @@ doc-string of `window-sizable'."
|
|||
(if sub
|
||||
;; WINDOW is an internal window.
|
||||
(if (window-combined-p sub horizontal)
|
||||
;; An iso-combination is fixed size if all its subwindows
|
||||
;; are fixed-size.
|
||||
;; An iso-combination is fixed size if all its child
|
||||
;; windows are fixed-size.
|
||||
(progn
|
||||
(while sub
|
||||
(unless (window-size-fixed-1 sub horizontal)
|
||||
;; We found a non-fixed-size subwindow, so WINDOW's
|
||||
;; size is not fixed.
|
||||
;; We found a non-fixed-size child window, so
|
||||
;; WINDOW's size is not fixed.
|
||||
(throw 'fixed nil))
|
||||
(setq sub (window-right sub)))
|
||||
;; All subwindows are fixed-size, so WINDOW's size is
|
||||
;; All child windows are fixed-size, so WINDOW's size is
|
||||
;; fixed.
|
||||
(throw 'fixed t))
|
||||
;; An ortho-combination is fixed-size if at least one of its
|
||||
;; subwindows is fixed-size.
|
||||
;; child windows is fixed-size.
|
||||
(while sub
|
||||
(when (window-size-fixed-1 sub horizontal)
|
||||
;; We found a fixed-size subwindow, so WINDOW's size is
|
||||
;; fixed.
|
||||
;; We found a fixed-size child window, so WINDOW's size
|
||||
;; is fixed.
|
||||
(throw 'fixed t))
|
||||
(setq sub (window-right sub))))
|
||||
;; WINDOW is a live window.
|
||||
|
|
@ -717,8 +720,8 @@ WINDOW can be resized in the desired direction. The functions
|
|||
(catch 'done
|
||||
(if (window-combined-p sub horizontal)
|
||||
;; In an iso-combination throw DELTA if we find at least one
|
||||
;; subwindow and that subwindow is either not of fixed-size
|
||||
;; or we can ignore fixed-sizeness.
|
||||
;; child window and that window is either not fixed-size or
|
||||
;; we can ignore fixed-sizeness.
|
||||
(let ((skip (eq trail 'after)))
|
||||
(while sub
|
||||
(cond
|
||||
|
|
@ -728,11 +731,11 @@ WINDOW can be resized in the desired direction. The functions
|
|||
((and (not (window-size-ignore window ignore))
|
||||
(window-size-fixed-p sub horizontal)))
|
||||
(t
|
||||
;; We found a non-fixed-size subwindow.
|
||||
;; We found a non-fixed-size child window.
|
||||
(throw 'done delta)))
|
||||
(setq sub (window-right sub))))
|
||||
;; In an ortho-combination set DELTA to the minimum value by
|
||||
;; which other subwindows can shrink.
|
||||
;; which other child windows can shrink.
|
||||
(while sub
|
||||
(unless (eq sub window)
|
||||
(setq delta
|
||||
|
|
@ -768,8 +771,8 @@ Optional argument NOUP non-nil means don't go up in the window
|
|||
tree but try to enlarge windows within WINDOW's combination only.
|
||||
|
||||
Optional argument NODOWN non-nil means don't check whether WINDOW
|
||||
itself \(and its subwindows) can be shrunk; check only whether at
|
||||
least one other windows can be enlarged appropriately."
|
||||
itself \(and its child windows) can be shrunk; check only whether
|
||||
at least one other windows can be enlarged appropriately."
|
||||
(setq window (window-normalize-window window))
|
||||
(let ((size (window-total-size window horizontal))
|
||||
(minimum (window-min-size window horizontal ignore)))
|
||||
|
|
@ -797,7 +800,7 @@ least one other windows can be enlarged appropriately."
|
|||
(catch 'fixed
|
||||
(if (window-combined-p sub horizontal)
|
||||
;; For an iso-combination calculate how much we can get from
|
||||
;; other subwindows.
|
||||
;; other child windows.
|
||||
(let ((skip (eq trail 'after)))
|
||||
(while sub
|
||||
(cond
|
||||
|
|
@ -811,7 +814,7 @@ least one other windows can be enlarged appropriately."
|
|||
(window-min-size sub horizontal ignore))))))
|
||||
(setq sub (window-right sub))))
|
||||
;; For an ortho-combination throw DELTA when at least one
|
||||
;; subwindow is fixed-size.
|
||||
;; child window is fixed-size.
|
||||
(while sub
|
||||
(when (and (not (eq sub window))
|
||||
(not (window-size-ignore sub ignore))
|
||||
|
|
@ -850,8 +853,8 @@ tree but try to obtain the entire space from windows within
|
|||
WINDOW's combination.
|
||||
|
||||
Optional argument NODOWN non-nil means do not check whether
|
||||
WINDOW itself \(and its subwindows) can be enlarged; check only
|
||||
whether other windows can be shrunk appropriately."
|
||||
WINDOW itself \(and its child windows) can be enlarged; check
|
||||
only whether other windows can be shrunk appropriately."
|
||||
(setq window (window-normalize-window window))
|
||||
(if (and (not (window-size-ignore window ignore))
|
||||
(not nodown) (window-size-fixed-p window horizontal))
|
||||
|
|
@ -895,7 +898,7 @@ tree but try to distribute the space among the other windows
|
|||
within WINDOW's combination.
|
||||
|
||||
Optional argument NODOWN non-nil means don't check whether WINDOW
|
||||
and its subwindows can be resized."
|
||||
and its child windows can be resized."
|
||||
(setq window (window-normalize-window window))
|
||||
(cond
|
||||
((< delta 0)
|
||||
|
|
@ -1463,9 +1466,9 @@ as small) as possible but don't signal an error."
|
|||
|
||||
;; Resize now.
|
||||
(window--resize-reset frame)
|
||||
;; Ideally we should be able to resize just the last subwindow of
|
||||
;; root here. See the comment in `resize-root-window-vertically'
|
||||
;; for why we do not do that.
|
||||
;; Ideally we should be able to resize just the last child of root
|
||||
;; here. See the comment in `resize-root-window-vertically' for
|
||||
;; why we do not do that.
|
||||
(window--resize-this-window root (- delta) nil nil t)
|
||||
(set-window-new-total window (+ height delta))
|
||||
;; The following routine catches the case where we want to resize
|
||||
|
|
@ -1532,14 +1535,14 @@ instead."
|
|||
(t
|
||||
(error "Cannot resize window %s" window)))))
|
||||
|
||||
(defsubst window--resize-subwindows-skip-p (window)
|
||||
(defsubst window--resize-child-windows-skip-p (window)
|
||||
"Return non-nil if WINDOW shall be skipped by resizing routines."
|
||||
(memq (window-new-normal window) '(ignore stuck skip)))
|
||||
|
||||
(defun window--resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta)
|
||||
"Set the new normal height of subwindows of window PARENT.
|
||||
(defun window--resize-child-windows-normal (parent horizontal window this-delta &optional trail other-delta)
|
||||
"Recursively set new normal height of child windows of window PARENT.
|
||||
HORIZONTAL non-nil means set the new normal width of these
|
||||
windows. WINDOW specifies a subwindow of PARENT that has been
|
||||
windows. WINDOW specifies a child window of PARENT that has been
|
||||
resized by THIS-DELTA lines \(columns).
|
||||
|
||||
Optional argument TRAIL either 'before or 'after means set values
|
||||
|
|
@ -1561,8 +1564,8 @@ PARENT in order to resize WINDOW."
|
|||
(parent-normal 0.0)
|
||||
(skip (eq trail 'after)))
|
||||
|
||||
;; Set parent-normal to the sum of the normal sizes of all
|
||||
;; subwindows of PARENT that shall be resized, excluding only WINDOW
|
||||
;; Set parent-normal to the sum of the normal sizes of all child
|
||||
;; windows of PARENT that shall be resized, excluding only WINDOW
|
||||
;; and any windows specified by the optional TRAIL argument.
|
||||
(while sub
|
||||
(cond
|
||||
|
|
@ -1574,7 +1577,7 @@ PARENT in order to resize WINDOW."
|
|||
(+ parent-normal (window-normal-size sub horizontal)))))
|
||||
(setq sub (window-right sub)))
|
||||
|
||||
;; Set the new normal size of all subwindows of PARENT from what
|
||||
;; Set the new normal size of all child windows of PARENT from what
|
||||
;; they should have contributed for recovering THIS-DELTA lines
|
||||
;; (columns).
|
||||
(setq sub (window-child parent))
|
||||
|
|
@ -1633,11 +1636,11 @@ PARENT in order to resize WINDOW."
|
|||
;; Don't get larger than 1 or smaller than 0.
|
||||
(min 1.0 (max (- 1.0 sum) 0.0))))))
|
||||
|
||||
(defun window--resize-subwindows (parent delta &optional horizontal window ignore trail edge)
|
||||
"Resize subwindows of window PARENT vertically by DELTA lines.
|
||||
(defun window--resize-child-windows (parent delta &optional horizontal window ignore trail edge)
|
||||
"Resize child windows of window PARENT vertically by DELTA lines.
|
||||
PARENT must be a vertically combined internal window.
|
||||
|
||||
Optional argument HORIZONTAL non-nil means resize subwindows of
|
||||
Optional argument HORIZONTAL non-nil means resize child windows of
|
||||
PARENT horizontally by DELTA columns. In this case PARENT must
|
||||
be a horizontally combined internal window.
|
||||
|
||||
|
|
@ -1669,10 +1672,10 @@ already set by this routine."
|
|||
(setq sub first)
|
||||
(while (and (window-right sub)
|
||||
(or (and (eq trail 'before)
|
||||
(not (window--resize-subwindows-skip-p
|
||||
(not (window--resize-child-windows-skip-p
|
||||
(window-right sub))))
|
||||
(and (eq trail 'after)
|
||||
(window--resize-subwindows-skip-p sub))))
|
||||
(window--resize-child-windows-skip-p sub))))
|
||||
(setq sub (window-right sub)))
|
||||
sub)
|
||||
(if horizontal
|
||||
|
|
@ -1700,7 +1703,7 @@ already set by this routine."
|
|||
window (- (window-normal-size window horizontal)
|
||||
(- (window-new-normal sub)
|
||||
(window-normal-size sub horizontal)))))
|
||||
(window--resize-subwindows-normal
|
||||
(window--resize-child-windows-normal
|
||||
parent horizontal sub 0 trail delta))
|
||||
;; Return 'normalized to notify `window--resize-siblings' that
|
||||
;; normal sizes have been already set.
|
||||
|
|
@ -1709,9 +1712,9 @@ already set by this routine."
|
|||
(setq sub first)
|
||||
(while sub
|
||||
(cond
|
||||
((or (window--resize-subwindows-skip-p sub)
|
||||
;; Ignore windows to skip and fixed-size subwindows - in
|
||||
;; the latter case make it a window to skip.
|
||||
((or (window--resize-child-windows-skip-p sub)
|
||||
;; Ignore windows to skip and fixed-size child windows -
|
||||
;; in the latter case make it a window to skip.
|
||||
(and (not ignore)
|
||||
(window-size-fixed-p sub horizontal)
|
||||
(set-window-new-normal sub 'ignore))))
|
||||
|
|
@ -1799,7 +1802,7 @@ already set by this routine."
|
|||
(set-window-new-normal sub))
|
||||
|
||||
(unless (eq (window-new-normal sub) 'ignore)
|
||||
;; Resize this subwindow's subwindows (back-engineering
|
||||
;; Resize this window's child windows (back-engineering
|
||||
;; delta from sub's old and new total sizes).
|
||||
(let ((delta (- (window-new-total sub)
|
||||
(window-total-size sub horizontal))))
|
||||
|
|
@ -1882,19 +1885,19 @@ preferably only resize windows adjacent to EDGE."
|
|||
(if (zerop this-delta)
|
||||
;; We haven't got anything from WINDOW's siblings but we
|
||||
;; must update the normal sizes to respect other-delta.
|
||||
(window--resize-subwindows-normal
|
||||
(window--resize-child-windows-normal
|
||||
parent horizontal window this-delta trail other-delta)
|
||||
;; We did get something from WINDOW's siblings which means
|
||||
;; we have to resize their subwindows.
|
||||
(unless (eq (window--resize-subwindows
|
||||
;; we have to resize their child windows.
|
||||
(unless (eq (window--resize-child-windows
|
||||
parent (- this-delta) horizontal
|
||||
window ignore trail edge)
|
||||
;; If `window--resize-subwindows' returns
|
||||
;; If `window--resize-child-windows' returns
|
||||
;; 'normalized, this means it has set the
|
||||
;; normal sizes already.
|
||||
'normalized)
|
||||
;; Set the normal sizes.
|
||||
(window--resize-subwindows-normal
|
||||
(window--resize-child-windows-normal
|
||||
parent horizontal window this-delta trail other-delta))
|
||||
;; Set DELTA to what we still have to get from ancestor
|
||||
;; windows.
|
||||
|
|
@ -1934,7 +1937,7 @@ resize only windows on the left or above EDGE. If TRAIL equals
|
|||
`after', resize only windows on the right or below EDGE. Also,
|
||||
preferably only resize windows adjacent to EDGE.
|
||||
|
||||
This function recursively resizes WINDOW's subwindows to fit the
|
||||
This function recursively resizes WINDOW's child windows to fit the
|
||||
new size. Make sure that WINDOW is `window-resizable' before
|
||||
calling this function. Note that this function does not resize
|
||||
siblings of WINDOW or WINDOW's parent window. You have to
|
||||
|
|
@ -1948,11 +1951,11 @@ actually take effect."
|
|||
(cond
|
||||
((not sub))
|
||||
((window-combined-p sub horizontal)
|
||||
;; In an iso-combination resize subwindows according to their
|
||||
;; In an iso-combination resize child windows according to their
|
||||
;; normal sizes.
|
||||
(window--resize-subwindows
|
||||
(window--resize-child-windows
|
||||
window delta horizontal nil ignore trail edge))
|
||||
;; In an ortho-combination resize each subwindow by DELTA.
|
||||
;; In an ortho-combination resize each child window by DELTA.
|
||||
(t
|
||||
(while sub
|
||||
(window--resize-this-window
|
||||
|
|
@ -1978,7 +1981,7 @@ resizes windows proportionally and never deletes any windows."
|
|||
"Resize root window WINDOW vertically by DELTA lines.
|
||||
If DELTA is less than zero and we can't shrink WINDOW by DELTA
|
||||
lines, shrink it as much as possible. If DELTA is greater than
|
||||
zero, this function can resize fixed-size subwindows in order to
|
||||
zero, this function can resize fixed-size windows in order to
|
||||
recover the necessary lines.
|
||||
|
||||
Return the number of lines that were recovered.
|
||||
|
|
@ -2214,9 +2217,9 @@ is the frame's minibuffer window.
|
|||
If the root window is not split, ROOT is the root window itself.
|
||||
Otherwise, ROOT is a list (DIR EDGES W1 W2 ...) where DIR is nil
|
||||
for a horizontal split, and t for a vertical split. EDGES gives
|
||||
the combined size and position of the subwindows in the split,
|
||||
and the rest of the elements are the subwindows in the split.
|
||||
Each of the subwindows may again be a window or a list
|
||||
the combined size and position of the child windows in the split,
|
||||
and the rest of the elements are the child windows in the split.
|
||||
Each of the child windows may again be a window or a list
|
||||
representing a window split, and so on. EDGES is a list \(LEFT
|
||||
TOP RIGHT BOTTOM) as returned by `window-edges'."
|
||||
(setq frame (window-normalize-frame frame))
|
||||
|
|
@ -2352,13 +2355,13 @@ frame."
|
|||
;; frame.
|
||||
t))))
|
||||
|
||||
(defun window-or-subwindow-p (subwindow window)
|
||||
"Return t if SUBWINDOW is either WINDOW or a subwindow of WINDOW."
|
||||
(or (eq subwindow window)
|
||||
(let ((parent (window-parent subwindow)))
|
||||
(defun window--in-subtree-p (window root)
|
||||
"Return t if WINDOW is either ROOT or a member of ROOT's subtree."
|
||||
(or (eq window root)
|
||||
(let ((parent (window-parent window)))
|
||||
(catch 'done
|
||||
(while parent
|
||||
(if (eq parent window)
|
||||
(if (eq parent root)
|
||||
(throw 'done t)
|
||||
(setq parent (window-parent parent))))))))
|
||||
|
||||
|
|
@ -2410,7 +2413,7 @@ non-side window, signal an error."
|
|||
(let* ((horizontal (window-left-child parent))
|
||||
(size (window-total-size window horizontal))
|
||||
(frame-selected
|
||||
(window-or-subwindow-p (frame-selected-window frame) window))
|
||||
(window--in-subtree-p (frame-selected-window frame) window))
|
||||
;; Emacs 23 preferably gives WINDOW's space to its left
|
||||
;; sibling.
|
||||
(sibling (or (window-left window) (window-right window))))
|
||||
|
|
@ -3126,8 +3129,8 @@ frame. The selected window is not changed by this function."
|
|||
;; The `split-window' parameter specifies the function to call.
|
||||
;; If that function is `ignore', do nothing.
|
||||
(throw 'done (funcall function window size side)))
|
||||
;; If WINDOW is a subwindow of an atomic window, split the root
|
||||
;; window of that atomic window instead.
|
||||
;; If WINDOW is part of an atomic window, split the root window
|
||||
;; of that atomic window instead.
|
||||
((and (window-parameter window 'window-atom)
|
||||
(setq atom-root (window-atom-root window))
|
||||
(not (eq atom-root window)))
|
||||
|
|
@ -3249,7 +3252,7 @@ frame. The selected window is not changed by this function."
|
|||
;; we won't be able to return space to those windows when we
|
||||
;; delete the one we create here. Hence we do not go up.
|
||||
(progn
|
||||
(window--resize-subwindows parent (- new-size) horizontal)
|
||||
(window--resize-child-windows parent (- new-size) horizontal)
|
||||
(let* ((normal (- 1.0 new-normal))
|
||||
(sub (window-child parent)))
|
||||
(while sub
|
||||
|
|
@ -3365,8 +3368,8 @@ right, if any."
|
|||
;;; Balancing windows.
|
||||
|
||||
;; The following routine uses the recycled code from an old version of
|
||||
;; `window--resize-subwindows'. It's not very pretty, but coding it the way the
|
||||
;; new `window--resize-subwindows' code does would hardly make it any shorter or
|
||||
;; `window--resize-child-windows'. It's not very pretty, but coding it the way the
|
||||
;; new `window--resize-child-windows' code does would hardly make it any shorter or
|
||||
;; more readable (FWIW we'd need three loops - one to calculate the
|
||||
;; minimum sizes per window, one to enlarge or shrink windows until the
|
||||
;; new parent-size matches, and one where we shrink the largest/enlarge
|
||||
|
|
@ -3395,14 +3398,14 @@ is non-nil."
|
|||
(setq failed nil)
|
||||
(setq sub first)
|
||||
(while (and sub (not failed))
|
||||
;; Ignore subwindows that should be ignored or are stuck.
|
||||
(unless (window--resize-subwindows-skip-p sub)
|
||||
;; Ignore child windows that should be ignored or are stuck.
|
||||
(unless (window--resize-child-windows-skip-p sub)
|
||||
(setq found t)
|
||||
(setq sub-total (window-total-size sub horizontal))
|
||||
(setq sub-delta (- size sub-total))
|
||||
(setq sub-amount
|
||||
(window-sizable sub sub-delta horizontal))
|
||||
;; Register the new total size for this subwindow.
|
||||
;; Register the new total size for this child window.
|
||||
(set-window-new-total sub (+ sub-total sub-amount))
|
||||
(unless (= sub-amount sub-delta)
|
||||
(setq total-sum (- total-sum sub-total sub-amount))
|
||||
|
|
@ -3417,7 +3420,7 @@ is non-nil."
|
|||
;; (column) until `rest' is zero.
|
||||
(setq sub first)
|
||||
(while (and sub (> rest 0))
|
||||
(unless (window--resize-subwindows-skip-p window)
|
||||
(unless (window--resize-child-windows-skip-p window)
|
||||
(set-window-new-total sub 1 t)
|
||||
(setq rest (1- rest)))
|
||||
(setq sub (window-right sub)))
|
||||
|
|
@ -3439,7 +3442,7 @@ is non-nil."
|
|||
(window-total-size sub horizontal)
|
||||
(window-new-total sub))
|
||||
(float parent-size)))
|
||||
;; Recursively balance each subwindow's subwindows.
|
||||
;; Recursively balance each window's child windows.
|
||||
(balance-windows-1 sub horizontal)
|
||||
(setq sub (window-right sub)))))
|
||||
|
||||
|
|
@ -3456,11 +3459,11 @@ is non-nil."
|
|||
(setq sub (window-right sub))))))))
|
||||
|
||||
(defun balance-windows (&optional window-or-frame)
|
||||
"Balance the sizes of subwindows of WINDOW-OR-FRAME.
|
||||
"Balance the sizes of windows of WINDOW-OR-FRAME.
|
||||
WINDOW-OR-FRAME is optional and defaults to the selected frame.
|
||||
If WINDOW-OR-FRAME denotes a frame, balance the sizes of all
|
||||
subwindows of that frame's root window. If WINDOW-OR-FRAME
|
||||
denots a window, balance the sizes of all subwindows of that
|
||||
windows of that frame. If WINDOW-OR-FRAME denots a window,
|
||||
recursively balance the sizes of all child windows of that
|
||||
window."
|
||||
(interactive)
|
||||
(let* ((window
|
||||
|
|
@ -3680,8 +3683,8 @@ value can be also stored on disk and read back in a new session."
|
|||
(error "%s is not a live or internal window" window))
|
||||
(frame-root-window)))
|
||||
;; The return value is a cons whose car specifies some constraints on
|
||||
;; the size of WINDOW. The cdr lists the states of the subwindows of
|
||||
;; WINDOW.
|
||||
;; the size of WINDOW. The cdr lists the states of the child windows
|
||||
;; of WINDOW.
|
||||
(cons
|
||||
;; Frame related things would go into a function, say `frame-state',
|
||||
;; calling `window-state-get' to insert the frame's root window.
|
||||
|
|
@ -3843,7 +3846,7 @@ specify a live window and defaults to the selected one.
|
|||
|
||||
Optional argument IGNORE non-nil means ignore minimum window
|
||||
sizes and fixed size restrictions. IGNORE equal `safe' means
|
||||
subwindows can get as small as `window-safe-min-height' and
|
||||
windows can get as small as `window-safe-min-height' and
|
||||
`window-safe-min-width'."
|
||||
(setq window (window-normalize-window window t))
|
||||
(let* ((frame (window-frame window))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
2011-11-07 Martin Rudalics <rudalics@gmx.at>
|
||||
|
||||
* window.h: Declare delete_all_child_windows instead of
|
||||
delete_all_subwindows.
|
||||
* window.c (Fwindow_nest, Fset_window_nest)
|
||||
(Fset_window_new_total, Fset_window_new_normal)
|
||||
(Fwindow_resize_apply): Don't use term subwindow in doc-strings.
|
||||
(delete_all_subwindows): Rename to delete_all_child_windows.
|
||||
(Fdelete_other_windows_internal, Fset_window_configuration):
|
||||
Call delete_all_child_windows instead of delete_all_subwindows.
|
||||
* frame.c (delete_frame): Call delete_all_child_windows instead
|
||||
of delete_all_subwindows.
|
||||
|
||||
2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
|
||||
|
|
|
|||
|
|
@ -1320,7 +1320,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
|
|||
|
||||
/* Mark all the windows that used to be on FRAME as deleted, and then
|
||||
remove the reference to them. */
|
||||
delete_all_subwindows (f->root_window);
|
||||
delete_all_child_windows (f->root_window);
|
||||
f->root_window = Qnil;
|
||||
|
||||
Vframe_list = Fdelq (frame, Vframe_list);
|
||||
|
|
|
|||
76
src/window.c
76
src/window.c
|
|
@ -506,8 +506,8 @@ DEFUN ("window-nest", Fwindow_nest, Swindow_nest, 0, 1, 0,
|
|||
doc: /* Return nest status of window WINDOW.
|
||||
If WINDOW is omitted or nil, it defaults to the selected window.
|
||||
|
||||
If the return value is nil, subwindows of WINDOW can be recombined with
|
||||
WINDOW's siblings. A return value of non-nil means that subwindows of
|
||||
If the return value is nil, child windows of WINDOW can be recombined with
|
||||
WINDOW's siblings. A return value of non-nil means that child windows of
|
||||
WINDOW are never \(re-)combined with WINDOW's siblings. */)
|
||||
(Lisp_Object window)
|
||||
{
|
||||
|
|
@ -518,8 +518,8 @@ DEFUN ("set-window-nest", Fset_window_nest, Sset_window_nest, 2, 2, 0,
|
|||
doc: /* Set nest status of window WINDOW to STATUS; return STATUS.
|
||||
If WINDOW is omitted or nil, it defaults to the selected window.
|
||||
|
||||
If STATUS is nil, subwindows of WINDOW can be recombined with WINDOW's
|
||||
siblings. STATUS non-nil means that subwindows of WINDOW are never
|
||||
If STATUS is nil, child windows of WINDOW can be recombined with WINDOW's
|
||||
siblings. STATUS non-nil means that child windows of WINDOW are never
|
||||
\(re-)combined with WINDOW's siblings. */)
|
||||
(Lisp_Object window, Lisp_Object status)
|
||||
{
|
||||
|
|
@ -2573,9 +2573,9 @@ DEFUN ("delete-other-windows-internal", Fdelete_other_windows_internal,
|
|||
Only the frame WINDOW is on is affected. WINDOW may be any window and
|
||||
defaults to the selected one.
|
||||
|
||||
Optional argument ROOT, if non-nil, must specify an internal window
|
||||
containing WINDOW as a subwindow. If this is the case, replace ROOT by
|
||||
WINDOW and leave alone any windows not contained in ROOT.
|
||||
Optional argument ROOT, if non-nil, must specify an internal window such
|
||||
that WINDOW is in its window subtree. If this is the case, replace ROOT
|
||||
by WINDOW and leave alone any windows not part of ROOT's subtree.
|
||||
|
||||
When WINDOW is live try to reduce display jumps by keeping the text
|
||||
previously visible in WINDOW in the same place on the frame. Doing this
|
||||
|
|
@ -2639,10 +2639,10 @@ window-start value is reasonable when this function is called. */)
|
|||
}
|
||||
else
|
||||
{
|
||||
/* See if the frame's selected window is a subwindow of WINDOW, by
|
||||
finding all the selected window's parents and comparing each
|
||||
one with WINDOW. If it isn't we need a new selected window for
|
||||
this frame. */
|
||||
/* See if the frame's selected window is a part of the window
|
||||
subtree rooted at WINDOW, by finding all the selected window's
|
||||
parents and comparing each one with WINDOW. If it isn't we
|
||||
need a new selected window for this frame. */
|
||||
swindow = FRAME_SELECTED_WINDOW (f);
|
||||
while (1)
|
||||
{
|
||||
|
|
@ -2678,7 +2678,7 @@ window-start value is reasonable when this function is called. */)
|
|||
|
||||
if (NILP (w->buffer))
|
||||
{
|
||||
/* Resize subwindows vertically. */
|
||||
/* Resize child windows vertically. */
|
||||
XSETINT (delta, XINT (r->total_lines) - XINT (w->total_lines));
|
||||
w->top_line = r->top_line;
|
||||
resize_root_window (window, delta, Qnil, Qnil);
|
||||
|
|
@ -2693,7 +2693,7 @@ window-start value is reasonable when this function is called. */)
|
|||
resize_failed = 1;
|
||||
}
|
||||
|
||||
/* Resize subwindows horizontally. */
|
||||
/* Resize child windows horizontally. */
|
||||
if (!resize_failed)
|
||||
{
|
||||
w->left_col = r->left_col;
|
||||
|
|
@ -2742,15 +2742,15 @@ window-start value is reasonable when this function is called. */)
|
|||
XWINDOW (w->parent)->hchild = sibling;
|
||||
}
|
||||
|
||||
/* Delete ROOT and all subwindows of ROOT. */
|
||||
/* Delete ROOT and all child windows of ROOT. */
|
||||
if (!NILP (r->vchild))
|
||||
{
|
||||
delete_all_subwindows (r->vchild);
|
||||
delete_all_child_windows (r->vchild);
|
||||
r->vchild = Qnil;
|
||||
}
|
||||
else if (!NILP (r->hchild))
|
||||
{
|
||||
delete_all_subwindows (r->hchild);
|
||||
delete_all_child_windows (r->hchild);
|
||||
r->hchild = Qnil;
|
||||
}
|
||||
|
||||
|
|
@ -3351,7 +3351,7 @@ Return SIZE.
|
|||
Optional argument ADD non-nil means add SIZE to the new total size of
|
||||
WINDOW and return the sum.
|
||||
|
||||
Note: This function does not operate on any subwindows of WINDOW. */)
|
||||
Note: This function does not operate on any child windows of WINDOW. */)
|
||||
(Lisp_Object window, Lisp_Object size, Lisp_Object add)
|
||||
{
|
||||
struct window *w = decode_any_window (window);
|
||||
|
|
@ -3369,7 +3369,7 @@ DEFUN ("set-window-new-normal", Fset_window_new_normal, Sset_window_new_normal,
|
|||
doc: /* Set new normal size of WINDOW to SIZE.
|
||||
Return SIZE.
|
||||
|
||||
Note: This function does not operate on any subwindows of WINDOW. */)
|
||||
Note: This function does not operate on any child windows of WINDOW. */)
|
||||
(Lisp_Object window, Lisp_Object size)
|
||||
{
|
||||
struct window *w = decode_any_window (window);
|
||||
|
|
@ -3380,7 +3380,7 @@ Note: This function does not operate on any subwindows of WINDOW. */)
|
|||
|
||||
/* Return 1 if setting w->total_lines (w->total_cols if HORFLAG is
|
||||
non-zero) to w->new_total would result in correct heights (widths)
|
||||
for window W and recursively all subwindows of W.
|
||||
for window W and recursively all child windows of W.
|
||||
|
||||
Note: This function does not check any of `window-fixed-size-p',
|
||||
`window-min-height' or `window-min-width'. It does check that window
|
||||
|
|
@ -3395,7 +3395,7 @@ window_resize_check (struct window *w, int horflag)
|
|||
{
|
||||
c = XWINDOW (w->vchild);
|
||||
if (horflag)
|
||||
/* All subwindows of W must have the same width as W. */
|
||||
/* All child windows of W must have the same width as W. */
|
||||
{
|
||||
while (c)
|
||||
{
|
||||
|
|
@ -3407,8 +3407,8 @@ window_resize_check (struct window *w, int horflag)
|
|||
return 1;
|
||||
}
|
||||
else
|
||||
/* The sum of the heights of the subwindows of W must equal W's
|
||||
height. */
|
||||
/* The sum of the heights of the child windows of W must equal
|
||||
W's height. */
|
||||
{
|
||||
int sum_of_sizes = 0;
|
||||
while (c)
|
||||
|
|
@ -3426,7 +3426,7 @@ window_resize_check (struct window *w, int horflag)
|
|||
{
|
||||
c = XWINDOW (w->hchild);
|
||||
if (horflag)
|
||||
/* The sum of the widths of the subwindows of W must equal W's
|
||||
/* The sum of the widths of the child windows of W must equal W's
|
||||
width. */
|
||||
{
|
||||
int sum_of_sizes = 0;
|
||||
|
|
@ -3440,7 +3440,7 @@ window_resize_check (struct window *w, int horflag)
|
|||
return (sum_of_sizes == XINT (w->new_total));
|
||||
}
|
||||
else
|
||||
/* All subwindows of W must have the same height as W. */
|
||||
/* All child windows of W must have the same height as W. */
|
||||
{
|
||||
while (c)
|
||||
{
|
||||
|
|
@ -3460,9 +3460,9 @@ window_resize_check (struct window *w, int horflag)
|
|||
}
|
||||
|
||||
/* Set w->total_lines (w->total_cols if HORIZONTAL is non-zero) to
|
||||
w->new_total for window W and recursively all subwindows of W. Also
|
||||
calculate and assign the new vertical (horizontal) start positions of
|
||||
each of these windows.
|
||||
w->new_total for window W and recursively all child windows of W.
|
||||
Also calculate and assign the new vertical (horizontal) start
|
||||
positions of each of these windows.
|
||||
|
||||
This function does not perform any error checks. Make sure you have
|
||||
run window_resize_check on W before applying this function. */
|
||||
|
|
@ -3536,8 +3536,8 @@ Optional argument HORIZONTAL omitted or nil means apply requested height
|
|||
values. HORIZONTAL non-nil means apply requested width values.
|
||||
|
||||
This function checks whether the requested values sum up to a valid
|
||||
window layout, recursively assigns the new sizes of all subwindows and
|
||||
calculates and assigns the new start positions of these windows.
|
||||
window layout, recursively assigns the new sizes of all child windows
|
||||
and calculates and assigns the new start positions of these windows.
|
||||
|
||||
Note: This function does not check any of `window-fixed-size-p',
|
||||
`window-min-height' or `window-min-width'. All these checks have to
|
||||
|
|
@ -3936,12 +3936,12 @@ Signal an error when WINDOW is the only window on its frame. */)
|
|||
|
||||
if (!NILP (w->vchild))
|
||||
{
|
||||
delete_all_subwindows (w->vchild);
|
||||
delete_all_child_windows (w->vchild);
|
||||
w->vchild = Qnil;
|
||||
}
|
||||
else if (!NILP (w->hchild))
|
||||
{
|
||||
delete_all_subwindows (w->hchild);
|
||||
delete_all_child_windows (w->hchild);
|
||||
w->hchild = Qnil;
|
||||
}
|
||||
else if (!NILP (w->buffer))
|
||||
|
|
@ -5520,7 +5520,7 @@ the return value is nil. Otherwise the value is t. */)
|
|||
Save their current buffers in their height fields, since we may
|
||||
need it later, if a buffer saved in the configuration is now
|
||||
dead. */
|
||||
delete_all_subwindows (FRAME_ROOT_WINDOW (f));
|
||||
delete_all_child_windows (FRAME_ROOT_WINDOW (f));
|
||||
|
||||
for (k = 0; k < saved_windows->header.size; k++)
|
||||
{
|
||||
|
|
@ -5734,10 +5734,10 @@ the return value is nil. Otherwise the value is t. */)
|
|||
}
|
||||
|
||||
|
||||
/* Delete all subwindows reachable via the next, vchild, and hchild
|
||||
slots of WINDOW. */
|
||||
/* Recursively delete all child windows reachable via the next, vchild,
|
||||
and hchild slots of WINDOW. */
|
||||
void
|
||||
delete_all_subwindows (Lisp_Object window)
|
||||
delete_all_child_windows (Lisp_Object window)
|
||||
{
|
||||
register struct window *w;
|
||||
|
||||
|
|
@ -5745,18 +5745,18 @@ delete_all_subwindows (Lisp_Object window)
|
|||
|
||||
if (!NILP (w->next))
|
||||
/* Delete WINDOW's siblings (we traverse postorderly). */
|
||||
delete_all_subwindows (w->next);
|
||||
delete_all_child_windows (w->next);
|
||||
|
||||
w->total_lines = w->buffer; /* See Fset_window_configuration for excuse. */
|
||||
|
||||
if (!NILP (w->vchild))
|
||||
{
|
||||
delete_all_subwindows (w->vchild);
|
||||
delete_all_child_windows (w->vchild);
|
||||
w->vchild = Qnil;
|
||||
}
|
||||
else if (!NILP (w->hchild))
|
||||
{
|
||||
delete_all_subwindows (w->hchild);
|
||||
delete_all_child_windows (w->hchild);
|
||||
w->hchild = Qnil;
|
||||
}
|
||||
else if (!NILP (w->buffer))
|
||||
|
|
|
|||
|
|
@ -824,7 +824,7 @@ extern Lisp_Object window_from_coordinates (struct frame *, int, int,
|
|||
enum window_part *, int);
|
||||
EXFUN (Fwindow_dedicated_p, 1);
|
||||
extern void resize_frame_windows (struct frame *, int, int);
|
||||
extern void delete_all_subwindows (Lisp_Object);
|
||||
extern void delete_all_child_windows (Lisp_Object);
|
||||
extern void freeze_window_starts (struct frame *, int);
|
||||
extern void grow_mini_window (struct window *, int);
|
||||
extern void shrink_mini_window (struct window *);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue