Commit 5386012d authored by Martin Rudalics's avatar Martin Rudalics
Browse files

Rename more functions to use window-/window-- prefixes.

* window.c (resize_root_window, grow_mini_window)
(shrink_mini_window): Rename Qresize_root_window to
Qwindow_resize_root_window and Qresize_root_window_vertically to
Qwindow_resize_root_window_vertically.

* window.el (normalize-live-buffer): Rename to
window-normalize-buffer.
(normalize-live-frame): Rename to window-normalize-frame.
(normalize-any-window): Rename to window-normalize-any-window.
(normalize-live-window): Rename to window-normalize-live-window.
(make-window-atom): Rename to window-make-atom.
(window-resize-reset): Rename to window--resize-reset.
(window-resize-reset-1): Rename to window--resize-reset-1.
(resize-mini-window): Rename to window--resize-mini-window.
(resize-subwindows-skip-p): Rename to
window--resize-subwindows-skip-p.
(resize-subwindows-normal): Rename to
window--resize-subwindows-normal.
(resize-subwindows): Rename to window--resize-subwindows.
(resize-other-windows): Rename to window--resize-siblings.
(resize-this-window): Rename to window--resize-this-window.
(resize-root-window): Rename to window--resize-root-window.
(resize-root-window-vertically): Rename to
window--resize-root-window-vertically.
(normalize-buffer-to-display): Rename to
window-normalize-buffer-to-display.
(normalize-buffer-to-switch-to): Rename to
window-normalize-buffer-to-switch-to.
Correspondingly update all callers of the functions listed
above.
(display-buffer-alist, display-buffer-normalize-arguments)
(display-buffer-normalize-options, display-buffer)
(display-buffer-alist-set): Use "function" instead of
"fun-with-args".
parent 130f1dac
2011-06-29 Martin Rudalics <rudalics@gmx.at>
* window.el (normalize-live-buffer): Rename to
window-normalize-buffer.
(normalize-live-frame): Rename to window-normalize-frame.
(normalize-any-window): Rename to window-normalize-any-window.
(normalize-live-window): Rename to window-normalize-live-window.
(make-window-atom): Rename to window-make-atom.
(window-resize-reset): Rename to window--resize-reset.
(window-resize-reset-1): Rename to window--resize-reset-1.
(resize-mini-window): Rename to window--resize-mini-window.
(resize-subwindows-skip-p): Rename to
window--resize-subwindows-skip-p.
(resize-subwindows-normal): Rename to
window--resize-subwindows-normal.
(resize-subwindows): Rename to window--resize-subwindows.
(resize-other-windows): Rename to window--resize-siblings.
(resize-this-window): Rename to window--resize-this-window.
(resize-root-window): Rename to window--resize-root-window.
(resize-root-window-vertically): Rename to
window--resize-root-window-vertically.
(normalize-buffer-to-display): Rename to
window-normalize-buffer-to-display.
(normalize-buffer-to-switch-to): Rename to
window-normalize-buffer-to-switch-to.
Correspondingly update all callers of the functions listed
above.
(display-buffer-alist, display-buffer-normalize-arguments)
(display-buffer-normalize-options, display-buffer)
(display-buffer-alist-set): Use "function" instead of
"fun-with-args".
2011-06-28 Chong Yidong <cyd@stupidchicken.com>
* mail/emacsbug.el (report-emacs-bug): Handle non-gnu bug
......
......@@ -106,8 +106,7 @@ be any window."
(or (window-buffer object) (window-child object))
t))
;; The following four functions should probably go to subr.el.
(defsubst normalize-live-buffer (buffer-or-name)
(defsubst window-normalize-buffer (buffer-or-name)
"Return buffer specified by BUFFER-OR-NAME.
BUFFER-OR-NAME must be either a buffer or a string naming a live
buffer and defaults to the current buffer."
......@@ -122,7 +121,7 @@ buffer and defaults to the current buffer."
(t
(error "No such buffer %s" buffer-or-name))))
(defsubst normalize-live-frame (frame)
(defsubst window-normalize-frame (frame)
"Return frame specified by FRAME.
FRAME must be a live frame and defaults to the selected frame."
(if frame
......@@ -131,7 +130,7 @@ FRAME must be a live frame and defaults to the selected frame."
(error "%s is not a live frame" frame))
(selected-frame)))
(defsubst normalize-any-window (window)
(defsubst window-normalize-any-window (window)
"Return window specified by WINDOW.
WINDOW must be a window that has not been deleted and defaults to
the selected window."
......@@ -141,7 +140,7 @@ the selected window."
(error "%s is not a window" window))
(selected-window)))
(defsubst normalize-live-window (window)
(defsubst window-normalize-live-window (window)
"Return live window specified by WINDOW.
WINDOW must be a live window and defaults to the selected one."
(if window
......@@ -202,7 +201,7 @@ narrower, explictly specify the SIZE argument of that function."
WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return WINDOW's first
child if WINDOW is a horizontal combination."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(if horizontal
(window-left-child window)
(window-top-child window)))
......@@ -212,7 +211,7 @@ child if WINDOW is a horizontal combination."
WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return non-nil if and
only if WINDOW is horizontally combined."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(let ((parent (window-parent window)))
(and parent (window-iso-combination-p parent horizontal))))
......@@ -221,7 +220,7 @@ only if WINDOW is horizontally combined."
WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means to return the largest
number of horizontally arranged subwindows of WINDOW."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(cond
((window-live-p window)
;; If WINDOW is live, return 1.
......@@ -277,7 +276,7 @@ FRAME.
This function performs a pre-order, depth-first traversal of the
window tree. If PROC changes the window tree, the result is
unpredictable."
(let ((walk-window-tree-frame (normalize-live-frame frame)))
(let ((walk-window-tree-frame (window-normalize-frame frame)))
(walk-window-tree-1
proc (frame-root-window walk-window-tree-frame) any)))
......@@ -290,7 +289,7 @@ on all live and internal subwindows of WINDOW.
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."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(walk-window-tree-1 proc window any t))
(defun windows-with-parameter (parameter &optional value frame any values)
......@@ -336,14 +335,14 @@ too."
"Return root of atomic window WINDOW is a part of.
WINDOW can be any window and defaults to the selected one.
Return nil if WINDOW is not part of a atomic window."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(let (root)
(while (and window (window-parameter window 'window-atom))
(setq root window)
(setq window (window-parent window)))
root))
(defun make-window-atom (window)
(defun window-make-atom (window)
"Make WINDOW an atomic window.
WINDOW must be an internal window. Return WINDOW."
(if (not (window-child window))
......@@ -548,7 +547,7 @@ windows may get as small as `window-safe-min-height' lines and
`window-safe-min-width' columns. IGNORE a window means ignore
restrictions for that window only."
(window-min-size-1
(normalize-any-window window) horizontal ignore))
(window-normalize-any-window window) horizontal ignore))
(defun window-min-size-1 (window horizontal ignore)
"Internal function of `window-min-size'."
......@@ -641,7 +640,7 @@ imposed by fixed size windows, `window-min-height' or
windows may get as small as `window-safe-min-height' lines and
`window-safe-min-width' columns. IGNORE any window means ignore
restrictions for that window only."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(cond
((< delta 0)
(max (- (window-min-size window horizontal ignore)
......@@ -659,7 +658,7 @@ restrictions for that window only."
"Return t if WINDOW can be resized by DELTA lines.
For the meaning of the arguments of this function see the
doc-string of `window-sizable'."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(if (> delta 0)
(>= (window-sizable window delta horizontal ignore) delta)
(<= (window-sizable window delta horizontal ignore) delta)))
......@@ -707,7 +706,7 @@ If this function returns nil, this does not necessarily mean that
WINDOW can be resized in the desired direction. The functions
`window-resizable' and `window-resizable-p' will tell that."
(window-size-fixed-1
(normalize-any-window window) horizontal))
(window-normalize-any-window window) horizontal))
(defun window-min-delta-1 (window delta &optional horizontal ignore trail noup)
"Internal function for `window-min-delta'."
......@@ -773,7 +772,7 @@ 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."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(let ((size (window-total-size window horizontal))
(minimum (window-min-size window horizontal ignore)))
(cond
......@@ -855,7 +854,7 @@ 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."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(if (and (not (window-size-ignore window ignore))
(not nodown) (window-size-fixed-p window horizontal))
;; With IGNORE and NOWDON nil return zero if WINDOW has fixed
......@@ -899,7 +898,7 @@ within WINDOW's combination.
Optional argument NODOWN non-nil means don't check whether WINDOW
and its subwindows can be resized."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(cond
((< delta 0)
(max (- (window-min-delta window horizontal ignore trail noup nodown))
......@@ -913,7 +912,7 @@ and its subwindows can be resized."
"Return t if WINDOW can be resized vertically by DELTA lines.
For the meaning of the arguments of this function see the
doc-string of `window-resizable'."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(if (> delta 0)
(>= (window-resizable window delta horizontal ignore trail noup nodown)
delta)
......@@ -942,7 +941,7 @@ More precisely, return t if and only if the total height of
WINDOW equals the total height of the root window of WINDOW's
frame. WINDOW can be any window and defaults to the selected
one."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(= (window-total-size window)
(window-total-size (frame-root-window window))))
......@@ -961,7 +960,7 @@ otherwise."
More precisely, return t if and only if the total width of WINDOW
equals the total width of the root window of WINDOW's frame.
WINDOW can be any window and defaults to the selected one."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(= (window-total-size window t)
(window-total-size (frame-root-window window) t)))
......@@ -1002,7 +1001,7 @@ or nil).
Unlike `window-scroll-bars', this function reports the scroll bar
type actually used, once frame defaults and `scroll-bar-mode' are
taken into account."
(setq window (normalize-live-window window))
(setq window (window-normalize-live-window window))
(let ((vert (nth 2 (window-scroll-bars window)))
(hor nil))
(when (or (eq vert t) (eq hor t))
......@@ -1077,7 +1076,7 @@ DIRECTION must be one of `above', `below', `left' or `right'.
WINDOW must be a live window and defaults to the selected one.
IGNORE, when non-nil means a window can be returned even if its
`no-other-window' parameter is non-nil."
(setq window (normalize-live-window window))
(setq window (window-normalize-live-window window))
(unless (memq direction '(above below left right))
(error "Wrong direction %s" direction))
(let* ((frame (window-frame window))
......@@ -1334,7 +1333,7 @@ non-nil values of ALL-FRAMES have special meanings:
Anything else means consider all windows on the selected frame
and no others."
(let ((buffer (normalize-live-buffer buffer-or-name))
(let ((buffer (window-normalize-buffer buffer-or-name))
windows)
(dolist (window (window-list-1 (selected-window) minibuf all-frames))
(when (eq (window-buffer window) buffer)
......@@ -1353,7 +1352,7 @@ meaning of this argument."
(length (window-list-1 nil minibuf)))
;;; Resizing windows.
(defun window-resize-reset (&optional frame horizontal)
(defun window--resize-reset (&optional frame horizontal)
"Reset resize values for all windows on FRAME.
FRAME defaults to the selected frame.
......@@ -1361,23 +1360,23 @@ This function stores the current value of `window-total-size' applied
with argument HORIZONTAL in the new total size of all windows on
FRAME. It also resets the new normal size of each of these
windows."
(window-resize-reset-1
(frame-root-window (normalize-live-frame frame)) horizontal))
(window--resize-reset-1
(frame-root-window (window-normalize-frame frame)) horizontal))
(defun window-resize-reset-1 (window horizontal)
"Internal function of `window-resize-reset'."
(defun window--resize-reset-1 (window horizontal)
"Internal function of `window--resize-reset'."
;; Register old size in the new total size.
(set-window-new-total window (window-total-size window horizontal))
;; Reset new normal size.
(set-window-new-normal window)
(when (window-child window)
(window-resize-reset-1 (window-child window) horizontal))
(window--resize-reset-1 (window-child window) horizontal))
(when (window-right window)
(window-resize-reset-1 (window-right window) horizontal)))
(window--resize-reset-1 (window-right window) horizontal)))
;; The following routine is used to manually resize the minibuffer
;; window and is currently used, for example, by ispell.el.
(defun resize-mini-window (window delta)
(defun window--resize-mini-window (window delta)
"Resize minibuffer window WINDOW by DELTA lines.
If WINDOW cannot be resized by DELTA lines make it as large \(or
as small) as possible but don't signal an error."
......@@ -1396,11 +1395,11 @@ as small) as possible but don't signal an error."
(setq delta min-delta)))
;; Resize now.
(window-resize-reset frame)
(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.
(resize-this-window root (- delta) nil nil t)
(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
;; a minibuffer-only frame.
......@@ -1432,17 +1431,17 @@ This function resizes other windows proportionally and never
deletes any windows. If you want to move only the low (right)
edge of WINDOW consider using `adjust-window-trailing-edge'
instead."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(let* ((frame (window-frame window))
sibling)
(cond
((eq window (frame-root-window frame))
(error "Cannot resize the root window of a frame"))
((window-minibuffer-p window)
(resize-mini-window window delta))
(window--resize-mini-window window delta))
((window-resizable-p window delta horizontal ignore)
(window-resize-reset frame horizontal)
(resize-this-window window delta horizontal ignore t)
(window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t)
(if (and (not (window-splits window))
(window-iso-combined-p window horizontal)
(setq sibling (or (window-right window) (window-left window)))
......@@ -1453,7 +1452,7 @@ instead."
(let ((normal-delta
(/ (float delta)
(window-total-size (window-parent window) horizontal))))
(resize-this-window sibling (- delta) horizontal nil t)
(window--resize-this-window sibling (- delta) horizontal nil t)
(set-window-new-normal
window (+ (window-normal-size window horizontal)
normal-delta))
......@@ -1461,16 +1460,16 @@ instead."
sibling (- (window-normal-size sibling horizontal)
normal-delta)))
;; Otherwise, resize all other windows in the same combination.
(resize-other-windows window delta horizontal ignore))
(window--resize-siblings window delta horizontal ignore))
(window-resize-apply frame horizontal))
(t
(error "Cannot resize window %s" window)))))
(defsubst resize-subwindows-skip-p (window)
(defsubst window--resize-subwindows-skip-p (window)
"Return non-nil if WINDOW shall be skipped by resizing routines."
(memq (window-new-normal window) '(ignore stuck skip)))
(defun resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta)
(defun window--resize-subwindows-normal (parent horizontal window this-delta &optional trail other-delta)
"Set the new normal height of subwindows of window PARENT.
HORIZONTAL non-nil means set the new normal width of these
windows. WINDOW specifies a subwindow of PARENT that has been
......@@ -1567,7 +1566,7 @@ 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 resize-subwindows (parent delta &optional horizontal window ignore trail edge)
(defun window--resize-subwindows (parent delta &optional horizontal window ignore trail edge)
"Resize subwindows of window PARENT vertically by DELTA lines.
PARENT must be a vertically combined internal window.
......@@ -1603,10 +1602,10 @@ already set by this routine."
(setq sub first)
(while (and (window-right sub)
(or (and (eq trail 'before)
(not (resize-subwindows-skip-p
(not (window--resize-subwindows-skip-p
(window-right sub))))
(and (eq trail 'after)
(resize-subwindows-skip-p sub))))
(window--resize-subwindows-skip-p sub))))
(setq sub (window-right sub)))
sub)
(if horizontal
......@@ -1623,7 +1622,8 @@ already set by this routine."
(window-sizable-p sub delta horizontal ignore))
;; Resize only windows adjacent to EDGE.
(progn
(resize-this-window sub delta horizontal ignore t trail edge)
(window--resize-this-window
sub delta horizontal ignore t trail edge)
(if (and window (eq (window-parent sub) parent))
(progn
;; Assign new normal sizes.
......@@ -1633,15 +1633,16 @@ already set by this routine."
window (- (window-normal-size window horizontal)
(- (window-new-normal sub)
(window-normal-size sub horizontal)))))
(resize-subwindows-normal parent horizontal sub 0 trail delta))
;; Return 'normalized to notify `resize-other-windows' that
(window--resize-subwindows-normal
parent horizontal sub 0 trail delta))
;; Return 'normalized to notify `window--resize-siblings' that
;; normal sizes have been already set.
'normalized)
;; Resize all windows proportionally.
(setq sub first)
(while sub
(cond
((or (resize-subwindows-skip-p sub)
((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.
(and (not ignore)
......@@ -1738,11 +1739,11 @@ already set by this routine."
(unless (and (zerop delta) (not trail))
;; For the TRAIL non-nil case we have to resize SUB
;; recursively even if it's size does not change.
(resize-this-window
(window--resize-this-window
sub delta horizontal ignore nil trail edge))))
(setq sub (window-right sub)))))))
(defun resize-other-windows (window delta &optional horizontal ignore trail edge)
(defun window--resize-siblings (window delta &optional horizontal ignore trail edge)
"Resize other windows when WINDOW is resized vertically by DELTA lines.
Optional argument HORIZONTAL non-nil means resize other windows
when WINDOW is resized horizontally by DELTA columns. WINDOW
......@@ -1814,17 +1815,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.
(resize-subwindows-normal
(window--resize-subwindows-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 (resize-subwindows parent (- this-delta) horizontal
window ignore trail edge)
;; `resize-subwindows' returning 'normalized,
;; means it has set the normal sizes already.
(unless (eq (window--resize-subwindows
parent (- this-delta) horizontal
window ignore trail edge)
;; If `window--resize-subwindows' returns
;; 'normalized, this means it has set the
;; normal sizes already.
'normalized)
;; Set the normal sizes.
(resize-subwindows-normal
(window--resize-subwindows-normal
parent horizontal window this-delta trail other-delta))
;; Set DELTA to what we still have to get from ancestor
;; windows.
......@@ -1835,14 +1838,15 @@ preferably only resize windows adjacent to EDGE."
(set-window-new-total parent delta 'add)
(while sub
(unless (eq sub window)
(resize-this-window sub delta horizontal ignore t))
(window--resize-this-window sub delta horizontal ignore t))
(setq sub (window-right sub))))
(unless (zerop delta)
;; "Go up."
(resize-other-windows parent delta horizontal ignore trail edge)))))
(window--resize-siblings
parent delta horizontal ignore trail edge)))))
(defun resize-this-window (window delta &optional horizontal ignore add trail edge)
(defun window--resize-this-window (window delta &optional horizontal ignore add trail edge)
"Resize WINDOW vertically by DELTA lines.
Optional argument HORIZONTAL non-nil means resize WINDOW
horizontally by DELTA columns.
......@@ -1879,14 +1883,16 @@ actually take effect."
((window-iso-combined-p sub horizontal)
;; In an iso-combination resize subwindows according to their
;; normal sizes.
(resize-subwindows window delta horizontal nil ignore trail edge))
(window--resize-subwindows
window delta horizontal nil ignore trail edge))
;; In an ortho-combination resize each subwindow by DELTA.
(t
(while sub
(resize-this-window sub delta horizontal ignore t trail edge)
(window--resize-this-window
sub delta horizontal ignore t trail edge)
(setq sub (window-right sub)))))))
(defun resize-root-window (window delta horizontal ignore)
(defun window--resize-root-window (window delta horizontal ignore)
"Resize root window WINDOW vertically by DELTA lines.
HORIZONTAL non-nil means resize root window WINDOW horizontally
by DELTA columns.
......@@ -1898,10 +1904,10 @@ This function is only called by the frame resizing routines. It
resizes windows proportionally and never deletes any windows."
(when (and (windowp window) (numberp delta)
(window-sizable-p window delta horizontal ignore))
(window-resize-reset (window-frame window) horizontal)
(resize-this-window window delta horizontal ignore t)))
(window--resize-reset (window-frame window) horizontal)
(window--resize-this-window window delta horizontal ignore t)))
(defun resize-root-window-vertically (window delta)
(defun window--resize-root-window-vertically (window delta)
"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
......@@ -1922,7 +1928,7 @@ any windows."
(unless (window-sizable window delta)
(setq ignore t))))
(window-resize-reset (window-frame window))
(window--resize-reset (window-frame window))
;; Ideally, we would resize just the last window in a combination
;; but that's not feasible for the following reason: If we grow
;; the minibuffer window and the last window cannot be shrunk any
......@@ -1932,7 +1938,7 @@ any windows."
;; So, in practice, we'd need a history variable to record how to
;; proceed. But I'm not sure how such a variable could work with
;; repeated minibuffer window growing steps.
(resize-this-window window delta nil ignore t)
(window--resize-this-window window delta nil ignore t)
delta)))
(defun adjust-window-trailing-edge (window delta &optional horizontal)
......@@ -1944,7 +1950,7 @@ If DELTA is greater zero, then move the edge downwards or to the
right. If DELTA is less than zero, move the edge upwards or to
the left. If the edge can't be moved by DELTA lines or columns,
move it as far as possible in the desired direction."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(let ((frame (window-frame window))
(right window)
left this-delta min-delta max-delta failed)
......@@ -1955,7 +1961,7 @@ move it as far as possible in the desired direction."
(cond
((and (not right) (not horizontal) (not resize-mini-windows)
(eq (window-frame (minibuffer-window frame)) frame))
(resize-mini-window (minibuffer-window frame) (- delta)))
(window--resize-mini-window (minibuffer-window frame) (- delta)))
((or (not (setq left right)) (not (setq right (window-right right))))
(if horizontal
(error "No window on the right of this one")
......@@ -2000,17 +2006,17 @@ move it as far as possible in the desired direction."
(setq delta (min max-delta (- min-delta))))
(unless (zerop delta)
;; Start resizing.
(window-resize-reset frame horizontal)
(window--resize-reset frame horizontal)
;; Try to enlarge LEFT first.
(setq this-delta (window-resizable left delta horizontal))
(unless (zerop this-delta)
(resize-this-window
(window--resize-this-window
left this-delta horizontal nil t 'before
(if horizontal
(+ (window-left-column left) (window-total-size left t))
(+ (window-top-line left) (window-total-size left)))))
;; Shrink windows on right of LEFT.
(resize-other-windows
(window--resize-siblings
left delta horizontal nil 'after
(if horizontal
(window-left-column right)
......@@ -2023,17 +2029,17 @@ move it as far as possible in the desired direction."
(setq delta (max (- max-delta) min-delta)))
(unless (zerop delta)
;; Start resizing.
(window-resize-reset frame horizontal)
(window--resize-reset frame horizontal)
;; Try to enlarge RIGHT.
(setq this-delta (window-resizable right (- delta) horizontal))
(unless (zerop this-delta)
(resize-this-window
(window--resize-this-window
right this-delta horizontal nil t 'after
(if horizontal
(window-left-column right)
(window-top-line right))))
;; Shrink windows on left of RIGHT.
(resize-other-windows
(window--resize-siblings
right (- delta) horizontal nil 'before
(if horizontal
(+ (window-left-column left) (window-total-size left t))
......@@ -2091,7 +2097,7 @@ Return nil."
Make WINDOW as large as possible without deleting any windows.
WINDOW can be any window and defaults to the selected window."
(interactive)
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(window-resize window (window-max-delta window))
(window-resize window (window-max-delta window t) t))
......@@ -2100,7 +2106,7 @@ WINDOW can be any window and defaults to the selected window."
Make WINDOW as small as possible without deleting any windows.
WINDOW can be any window and defaults to the selected window."
(interactive)
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(window-resize window (- (window-min-delta window)))
(window-resize window (- (window-min-delta window t)) t))
......@@ -2146,7 +2152,7 @@ and the rest of the elements are the subwindows in the split.
Each of the subwindows 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 (normalize-live-frame frame))
(setq frame (window-normalize-frame frame))
(window-tree-1 (frame-root-window frame) t))
(defun other-window (count &optional all-frames)
......@@ -2278,7 +2284,7 @@ variable are `switch-to-prev-buffer', `delete-windows-on',
"Return t if WINDOW can be safely deleted from its frame.
Return `frame' if deleting WINDOW should delete its frame
instead."
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(unless ignore-window-parameters
;; Handle atomicity.
(when (window-parameter window 'window-atom)
......@@ -2336,7 +2342,7 @@ Otherwise, if WINDOW is part of an atomic window, call
argument. If WINDOW is the only window on its frame or the last
non-side window, signal an error."
(interactive)
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))
(let* ((frame (window-frame window))
(function (window-parameter window 'delete-window))
(parent (window-parent window))
......@@ -2371,21 +2377,21 @@ non-side window, signal an error."
;; Emacs 23 preferably gives WINDOW's space to its left
;; sibling.
(sibling (or (window-left window) (window-right window))))
(window-resize-reset frame horizontal)
(window--resize-reset frame horizontal)
(cond
((and (not (window-splits window))
sibling (window-sizable-p sibling size))
;; Resize WINDOW's sibling.
(resize-this-window sibling size horizontal nil t)
(window--resize-this-window sibling size horizontal nil t)
(set-window-new-normal
sibling (+ (window-normal-size sibling horizontal)
(window-normal-size window horizontal))))
((window-resizable-p window (- size) horizontal nil nil nil t)
;; Can do without resizing fixed-size windows.
(resize-other-windows window (- size) horizontal))
(window--resize-siblings window (- size) horizontal))
(t
;; Can't do without resizing fixed-size windows.
(resize-other-windows window (- size) horizontal t)))
(window--resize-siblings window (- size) horizontal t)))
;; Actually delete WINDOW.
(delete-window-internal window)
(when (and frame-selected
......@@ -2417,7 +2423,7 @@ WINDOW is a non-side window, make WINDOW the only non-side window
on the frame. Side windows are not deleted. If WINDOW is a side
window signal an error."
(interactive)
(setq window (normalize-any-window window))
(setq window (window-normalize-any-window window))