Commit 3d8daefe authored by Martin Rudalics's avatar Martin Rudalics

Remove "iso-" infix from window combination functions.

* window.el (window-iso-combination-p, window-iso-combined-p)
(window-iso-combinations): Remove "iso-" infix.  Suggested by
Chong Yidong.
(window-min-size-1, window-size-fixed-1, window-min-delta-1)
(window-max-delta-1, window-resize, window--resize-siblings)
(window--resize-this-window, adjust-window-trailing-edge)
(split-window, balance-windows-1)
(shrink-window-if-larger-than-buffer):
* calendar/calendar.el (calendar-generate-window):
* help.el (resize-temp-buffer-window): Adjust callers
accordingly.
* windows.texi (Windows and Frames): Remove "iso-" infix from
documentation of window-iso-combined-p.
parent c1e2f5fa
2011-10-30 Martin Rudalics <rudalics@gmx.at>
* windows.texi (Windows and Frames): Remove "iso-" infix from
documentation of window-iso-combined-p.
2011-10-26 Chong Yidong <cyd@gnu.org> 2011-10-26 Chong Yidong <cyd@gnu.org>
* modes.texi (Running Hooks): Document with-wrapper-hook. * modes.texi (Running Hooks): Document with-wrapper-hook.
......
...@@ -309,7 +309,7 @@ W4)} is @code{W6}. ...@@ -309,7 +309,7 @@ W4)} is @code{W6}.
The following function is useful to determine whether a window is part The following function is useful to determine whether a window is part
of a vertical or horizontal combination. of a vertical or horizontal combination.
@defun window-iso-combined-p &optional window horizontal @defun window-combined-p &optional window horizontal
This function returns non-@code{nil} if and only if @var{window} is This function returns non-@code{nil} if and only if @var{window} is
vertically combined. The argument @var{window} can specify any window vertically combined. The argument @var{window} can specify any window
and defaults to the selected one. The actual return value is the first and defaults to the selected one. The actual return value is the first
......
2011-10-30 Martin Rudalics <rudalics@gmx.at>
* window.el (window-iso-combination-p, window-iso-combined-p)
(window-iso-combinations): Remove "iso-" infix. Suggested by
Chong Yidong.
(window-min-size-1, window-size-fixed-1, window-min-delta-1)
(window-max-delta-1, window-resize, window--resize-siblings)
(window--resize-this-window, adjust-window-trailing-edge)
(split-window, balance-windows-1)
(shrink-window-if-larger-than-buffer):
* calendar/calendar.el (calendar-generate-window):
* help.el (resize-temp-buffer-window): Adjust callers
accordingly.
2011-10-30 Stefan Monnier <monnier@iro.umontreal.ca> 2011-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
* eshell/esh-cmd.el (eshell-rewrite-for-command): Don't modify the list * eshell/esh-cmd.el (eshell-rewrite-for-command): Don't modify the list
......
...@@ -1373,7 +1373,7 @@ Optional integers MON and YR are used instead of today's date." ...@@ -1373,7 +1373,7 @@ Optional integers MON and YR are used instead of today's date."
;; Don't do any window-related stuff if we weren't called from a ;; Don't do any window-related stuff if we weren't called from a
;; window displaying the calendar. ;; window displaying the calendar.
(when in-calendar-window (when in-calendar-window
(if (window-iso-combined-p) (if (window-combined-p)
;; Adjust the window to exactly fit the displayed calendar. ;; Adjust the window to exactly fit the displayed calendar.
(fit-window-to-buffer nil nil calendar-minimum-window-height) (fit-window-to-buffer nil nil calendar-minimum-window-height)
;; For a full height window or a window that is horizontally ;; For a full height window or a window that is horizontally
......
...@@ -1003,7 +1003,7 @@ than `window-min-height'. Do nothing if the selected window is ...@@ -1003,7 +1003,7 @@ than `window-min-height'. Do nothing if the selected window is
not vertically combined or some of its contents are scrolled out not vertically combined or some of its contents are scrolled out
of view." of view."
(when (and (pos-visible-in-window-p (point-min)) (when (and (pos-visible-in-window-p (point-min))
(window-iso-combined-p)) (window-combined-p))
(fit-window-to-buffer (fit-window-to-buffer
nil nil
(if (functionp temp-buffer-max-height) (if (functionp temp-buffer-max-height)
......
...@@ -196,7 +196,7 @@ narrower, explictly specify the SIZE argument of that function." ...@@ -196,7 +196,7 @@ narrower, explictly specify the SIZE argument of that function."
:version "24.1" :version "24.1"
:group 'windows) :group 'windows)
(defun window-iso-combination-p (&optional window horizontal) (defun window-combination-p (&optional window horizontal)
"If WINDOW is a vertical combination return WINDOW's first child. "If WINDOW is a vertical combination return WINDOW's first child.
WINDOW can be any window and defaults to the selected one. WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return WINDOW's first Optional argument HORIZONTAL non-nil means return WINDOW's first
...@@ -206,16 +206,16 @@ child if WINDOW is a horizontal combination." ...@@ -206,16 +206,16 @@ child if WINDOW is a horizontal combination."
(window-left-child window) (window-left-child window)
(window-top-child window))) (window-top-child window)))
(defsubst window-iso-combined-p (&optional window horizontal) (defsubst window-combined-p (&optional window horizontal)
"Return non-nil if and only if WINDOW is vertically combined. "Return non-nil if and only if WINDOW is vertically combined.
WINDOW can be any window and defaults to the selected one. WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means return non-nil if and Optional argument HORIZONTAL non-nil means return non-nil if and
only if WINDOW is horizontally combined." only if WINDOW is horizontally combined."
(setq window (window-normalize-any-window window)) (setq window (window-normalize-any-window window))
(let ((parent (window-parent window))) (let ((parent (window-parent window)))
(and parent (window-iso-combination-p parent horizontal)))) (and parent (window-combination-p parent horizontal))))
(defun window-iso-combinations (&optional window horizontal) (defun window-combinations (&optional window horizontal)
"Return largest number of vertically arranged subwindows of WINDOW. "Return largest number of vertically arranged subwindows of WINDOW.
WINDOW can be any window and defaults to the selected one. WINDOW can be any window and defaults to the selected one.
Optional argument HORIZONTAL non-nil means to return the largest Optional argument HORIZONTAL non-nil means to return the largest
...@@ -225,14 +225,14 @@ number of horizontally arranged subwindows of WINDOW." ...@@ -225,14 +225,14 @@ number of horizontally arranged subwindows of WINDOW."
((window-live-p window) ((window-live-p window)
;; If WINDOW is live, return 1. ;; If WINDOW is live, return 1.
1) 1)
((window-iso-combination-p window horizontal) ((window-combination-p window horizontal)
;; If WINDOW is iso-combined, return the sum of the values for all ;; If WINDOW is iso-combined, return the sum of the values for all
;; subwindows of WINDOW. ;; subwindows of WINDOW.
(let ((child (window-child window)) (let ((child (window-child window))
(count 0)) (count 0))
(while child (while child
(setq count (setq count
(+ (window-iso-combinations child horizontal) (+ (window-combinations child horizontal)
count)) count))
(setq child (window-right child))) (setq child (window-right child)))
count)) count))
...@@ -243,7 +243,7 @@ number of horizontally arranged subwindows of WINDOW." ...@@ -243,7 +243,7 @@ number of horizontally arranged subwindows of WINDOW."
(count 1)) (count 1))
(while child (while child
(setq count (setq count
(max (window-iso-combinations child horizontal) (max (window-combinations child horizontal)
count)) count))
(setq child (window-right child))) (setq child (window-right child)))
count)))) count))))
...@@ -555,7 +555,7 @@ restrictions for that window only." ...@@ -555,7 +555,7 @@ restrictions for that window only."
(if sub (if sub
(let ((value 0)) (let ((value 0))
;; WINDOW is an internal window. ;; WINDOW is an internal window.
(if (window-iso-combined-p sub horizontal) (if (window-combined-p sub horizontal)
;; The minimum size of an iso-combination is the sum of ;; The minimum size of an iso-combination is the sum of
;; the minimum sizes of its subwindows. ;; the minimum sizes of its subwindows.
(while sub (while sub
...@@ -669,7 +669,7 @@ doc-string of `window-sizable'." ...@@ -669,7 +669,7 @@ doc-string of `window-sizable'."
(catch 'fixed (catch 'fixed
(if sub (if sub
;; WINDOW is an internal window. ;; WINDOW is an internal window.
(if (window-iso-combined-p sub horizontal) (if (window-combined-p sub horizontal)
;; An iso-combination is fixed size if all its subwindows ;; An iso-combination is fixed size if all its subwindows
;; are fixed-size. ;; are fixed-size.
(progn (progn
...@@ -717,7 +717,7 @@ WINDOW can be resized in the desired direction. The functions ...@@ -717,7 +717,7 @@ WINDOW can be resized in the desired direction. The functions
(let* ((parent (window-parent window)) (let* ((parent (window-parent window))
(sub (window-child parent))) (sub (window-child parent)))
(catch 'done (catch 'done
(if (window-iso-combined-p sub horizontal) (if (window-combined-p sub horizontal)
;; In an iso-combination throw DELTA if we find at least one ;; In an iso-combination throw DELTA if we find at least one
;; subwindow and that subwindow is either not of fixed-size ;; subwindow and that subwindow is either not of fixed-size
;; or we can ignore fixed-sizeness. ;; or we can ignore fixed-sizeness.
...@@ -797,7 +797,7 @@ least one other windows can be enlarged appropriately." ...@@ -797,7 +797,7 @@ least one other windows can be enlarged appropriately."
(let* ((parent (window-parent window)) (let* ((parent (window-parent window))
(sub (window-child parent))) (sub (window-child parent)))
(catch 'fixed (catch 'fixed
(if (window-iso-combined-p sub horizontal) (if (window-combined-p sub horizontal)
;; For an iso-combination calculate how much we can get from ;; For an iso-combination calculate how much we can get from
;; other subwindows. ;; other subwindows.
(let ((skip (eq trail 'after))) (let ((skip (eq trail 'after)))
...@@ -1498,7 +1498,7 @@ instead." ...@@ -1498,7 +1498,7 @@ instead."
(window--resize-reset frame horizontal) (window--resize-reset frame horizontal)
(window--resize-this-window window delta horizontal ignore t) (window--resize-this-window window delta horizontal ignore t)
(if (and (not (window-splits window)) (if (and (not (window-splits window))
(window-iso-combined-p window horizontal) (window-combined-p window horizontal)
(setq sibling (or (window-right window) (window-left window))) (setq sibling (or (window-right window) (window-left window)))
(window-sizable-p sibling (- delta) horizontal ignore)) (window-sizable-p sibling (- delta) horizontal ignore))
;; If window-splits returns nil for WINDOW, WINDOW is part of ;; If window-splits returns nil for WINDOW, WINDOW is part of
...@@ -1819,7 +1819,7 @@ preferably only resize windows adjacent to EDGE." ...@@ -1819,7 +1819,7 @@ preferably only resize windows adjacent to EDGE."
(when (window-parent window) (when (window-parent window)
(let* ((parent (window-parent window)) (let* ((parent (window-parent window))
(sub (window-child parent))) (sub (window-child parent)))
(if (window-iso-combined-p sub horizontal) (if (window-combined-p sub horizontal)
;; In an iso-combination try to extract DELTA from WINDOW's ;; In an iso-combination try to extract DELTA from WINDOW's
;; siblings. ;; siblings.
(let ((first sub) (let ((first sub)
...@@ -1935,7 +1935,7 @@ actually take effect." ...@@ -1935,7 +1935,7 @@ actually take effect."
(let ((sub (window-child window))) (let ((sub (window-child window)))
(cond (cond
((not sub)) ((not sub))
((window-iso-combined-p sub horizontal) ((window-combined-p sub horizontal)
;; In an iso-combination resize subwindows according to their ;; In an iso-combination resize subwindows according to their
;; normal sizes. ;; normal sizes.
(window--resize-subwindows (window--resize-subwindows
...@@ -2010,7 +2010,7 @@ move it as far as possible in the desired direction." ...@@ -2010,7 +2010,7 @@ move it as far as possible in the desired direction."
(right window) (right window)
left this-delta min-delta max-delta failed) left this-delta min-delta max-delta failed)
;; Find the edge we want to move. ;; Find the edge we want to move.
(while (and (or (not (window-iso-combined-p right horizontal)) (while (and (or (not (window-combined-p right horizontal))
(not (window-right right))) (not (window-right right)))
(setq right (window-parent right)))) (setq right (window-parent right))))
(cond (cond
...@@ -2029,7 +2029,7 @@ move it as far as possible in the desired direction." ...@@ -2029,7 +2029,7 @@ move it as far as possible in the desired direction."
(or (window-left left) (or (window-left left)
(progn (progn
(while (and (setq left (window-parent left)) (while (and (setq left (window-parent left))
(not (window-iso-combined-p left horizontal)))) (not (window-combined-p left horizontal))))
(window-left left))))) (window-left left)))))
(unless left (unless left
(if horizontal (if horizontal
...@@ -2043,7 +2043,7 @@ move it as far as possible in the desired direction." ...@@ -2043,7 +2043,7 @@ move it as far as possible in the desired direction."
(or (window-right right) (or (window-right right)
(progn (progn
(while (and (setq right (window-parent right)) (while (and (setq right (window-parent right))
(not (window-iso-combined-p right horizontal)))) (not (window-combined-p right horizontal))))
(window-right right))))) (window-right right)))))
(unless right (unless right
(if horizontal (if horizontal
...@@ -3142,7 +3142,7 @@ frame. The selected window is not changed by this function." ...@@ -3142,7 +3142,7 @@ frame. The selected window is not changed by this function."
(resize (resize
(and window-splits (not window-nest) (and window-splits (not window-nest)
;; Resize makes sense in iso-combinations only. ;; Resize makes sense in iso-combinations only.
(window-iso-combined-p window horizontal))) (window-combined-p window horizontal)))
;; `old-size' is the current size of WINDOW. ;; `old-size' is the current size of WINDOW.
(old-size (window-total-size window horizontal)) (old-size (window-total-size window horizontal))
;; `new-size' is the specified or calculated size of the ;; `new-size' is the specified or calculated size of the
...@@ -3157,7 +3157,7 @@ frame. The selected window is not changed by this function." ...@@ -3157,7 +3157,7 @@ frame. The selected window is not changed by this function."
(min (- parent-size (min (- parent-size
(window-min-size parent horizontal)) (window-min-size parent horizontal))
(/ parent-size (/ parent-size
(1+ (window-iso-combinations (1+ (window-combinations
parent horizontal)))) parent horizontal))))
;; Else try to give the new window half the size ;; Else try to give the new window half the size
;; of WINDOW (plus an eventual odd line). ;; of WINDOW (plus an eventual odd line).
...@@ -3220,13 +3220,13 @@ frame. The selected window is not changed by this function." ...@@ -3220,13 +3220,13 @@ frame. The selected window is not changed by this function."
;; Make new-parent non-nil if we need a new parent window; ;; Make new-parent non-nil if we need a new parent window;
;; either because we want to nest or because WINDOW is not ;; either because we want to nest or because WINDOW is not
;; iso-combined. ;; iso-combined.
(or window-nest (not (window-iso-combined-p window horizontal)))) (or window-nest (not (window-combined-p window horizontal))))
(setq new-normal (setq new-normal
;; Make new-normal the normal size of the new window. ;; Make new-normal the normal size of the new window.
(cond (cond
(size (/ (float new-size) (if new-parent old-size parent-size))) (size (/ (float new-size) (if new-parent old-size parent-size)))
(new-parent 0.5) (new-parent 0.5)
(resize (/ 1.0 (1+ (window-iso-combinations parent horizontal)))) (resize (/ 1.0 (1+ (window-combinations parent horizontal))))
(t (/ (window-normal-size window horizontal) 2.0)))) (t (/ (window-normal-size window horizontal) 2.0))))
(if resize (if resize
...@@ -3359,7 +3359,8 @@ right, if any." ...@@ -3359,7 +3359,8 @@ right, if any."
;; the smallest window). ;; the smallest window).
(defun balance-windows-2 (window horizontal) (defun balance-windows-2 (window horizontal)
"Subroutine of `balance-windows-1'. "Subroutine of `balance-windows-1'.
WINDOW must be an iso-combination." WINDOW must be a vertical combination (horizontal if HORIZONTAL
is non-nil."
(let* ((first (window-child window)) (let* ((first (window-child window))
(sub first) (sub first)
(number-of-children 0) (number-of-children 0)
...@@ -3432,7 +3433,7 @@ WINDOW must be an iso-combination." ...@@ -3432,7 +3433,7 @@ WINDOW must be an iso-combination."
"Subroutine of `balance-windows'." "Subroutine of `balance-windows'."
(if (window-child window) (if (window-child window)
(let ((sub (window-child window))) (let ((sub (window-child window)))
(if (window-iso-combined-p sub horizontal) (if (window-combined-p sub horizontal)
(balance-windows-2 window horizontal) (balance-windows-2 window horizontal)
(let ((size (window-new-total window))) (let ((size (window-new-total window)))
(while sub (while sub
...@@ -5281,14 +5282,8 @@ WINDOW was scrolled." ...@@ -5281,14 +5282,8 @@ WINDOW was scrolled."
WINDOW defaults to the selected window." WINDOW defaults to the selected window."
(with-selected-window (or window (selected-window)) (with-selected-window (or window (selected-window))
(let ((edges (window-edges))) (let ((edges (window-edges)))
;; The following doesn't satisfy the doc-string's claim when
;; window and previous-/next-window are not part of the same
;; combination but still share a common edge. Using
;; `window-iso-combined-p' instead should handle that.
(or (= (nth 2 edges) (nth 2 (window-edges (previous-window)))) (or (= (nth 2 edges) (nth 2 (window-edges (previous-window))))
(= (nth 0 edges) (nth 0 (window-edges (next-window)))))))) (= (nth 0 edges) (nth 0 (window-edges (next-window))))))))
;; (make-obsolete
;; 'window-safely-shrinkable-p "use `window-iso-combined-p' instead." "24.1")
(defun shrink-window-if-larger-than-buffer (&optional window) (defun shrink-window-if-larger-than-buffer (&optional window)
"Shrink height of WINDOW if its buffer doesn't need so many lines. "Shrink height of WINDOW if its buffer doesn't need so many lines.
...@@ -5308,7 +5303,7 @@ Return non-nil if the window was shrunk, nil otherwise." ...@@ -5308,7 +5303,7 @@ Return non-nil if the window was shrunk, nil otherwise."
;; Make sure that WINDOW is vertically combined and `point-min' is ;; Make sure that WINDOW is vertically combined and `point-min' is
;; visible (for whatever reason that's needed). The remaining issues ;; visible (for whatever reason that's needed). The remaining issues
;; should be taken care of by `fit-window-to-buffer'. ;; should be taken care of by `fit-window-to-buffer'.
(when (and (window-iso-combined-p window) (when (and (window-combined-p window)
(pos-visible-in-window-p (point-min) window)) (pos-visible-in-window-p (point-min) window))
(fit-window-to-buffer window (window-total-size window)))) (fit-window-to-buffer window (window-total-size window))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment