aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorChong Yidong2011-11-06 11:59:53 +0800
committerChong Yidong2011-11-06 11:59:53 +0800
commit49745b39a15ecc32f4956c2d91530f196d9cd638 (patch)
treedea6f8efd8e64595fb4dd1227d4965994937ca09 /lisp
parent1f05cd82d2e3c79ecede95aef578d1f395549b22 (diff)
downloademacs-49745b39a15ecc32f4956c2d91530f196d9cd638.tar.gz
emacs-49745b39a15ecc32f4956c2d91530f196d9cd638.zip
Delete window-combination-p; tweaks to window-top-child and window-left-child.
* lisp/window.el (window-combination-p): Function deleted; its side-effect is not used in any existing code. (window-combinations, window-combined-p): Call window-*-child directly. * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window) (Fminibuffer_window, Fwindow_buffer, Fwindow_splits) (Fset_window_splits, Fwindow_nest, Fset_window_nest) (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size) (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line) (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars) (Fwindow_vscroll): Doc fix. (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default argument, since it makes no sense to pass a live window and for consistency with window-child.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/window.el37
2 files changed, 25 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9d0ecd46663..6cc9cc86515 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12011-11-06 Chong Yidong <cyd@gnu.org>
2
3 * window.el (window-combination-p): Function deleted; its
4 side-effect is not used in any existing code.
5 (window-combinations, window-combined-p): Call window-*-child
6 directly.
7
12011-11-05 Chong Yidong <cyd@gnu.org> 82011-11-05 Chong Yidong <cyd@gnu.org>
2 9
3 * window.el (window-valid-p): Rename from window-any-p. 10 * window.el (window-valid-p): Rename from window-any-p.
diff --git a/lisp/window.el b/lisp/window.el
index 618cd6487fb..1b51bde36bd 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -195,36 +195,35 @@ narrower, explictly specify the SIZE argument of that function."
195 :version "24.1" 195 :version "24.1"
196 :group 'windows) 196 :group 'windows)
197 197
198(defun window-combination-p (&optional window horizontal)
199 "If WINDOW is a vertical combination return WINDOW's first child.
200WINDOW can be any window and defaults to the selected one.
201Optional argument HORIZONTAL non-nil means return WINDOW's first
202child if WINDOW is a horizontal combination."
203 (setq window (window-normalize-window window))
204 (if horizontal
205 (window-left-child window)
206 (window-top-child window)))
207
208(defsubst window-combined-p (&optional window horizontal) 198(defsubst window-combined-p (&optional window horizontal)
209 "Return non-nil if and only if WINDOW is vertically combined. 199 "Return non-nil if WINDOW has siblings in a given direction.
210WINDOW can be any window and defaults to the selected one. 200If WINDOW is omitted or nil, it defaults to the selected window.
211Optional argument HORIZONTAL non-nil means return non-nil if and 201
212only if WINDOW is horizontally combined." 202HORIZONTAL determines a direction for the window combination.
203If HORIZONTAL is omitted or nil, return non-nil if WINDOW is part
204of a vertical window combination.
205If HORIZONTAL is non-nil, return non-nil if WINDOW is part of a
206horizontal window combination."
213 (setq window (window-normalize-window window)) 207 (setq window (window-normalize-window window))
214 (let ((parent (window-parent window))) 208 (let ((parent (window-parent window)))
215 (and parent (window-combination-p parent horizontal)))) 209 (and parent
210 (if horizontal
211 (window-left-child parent)
212 (window-top-child parent)))))
216 213
217(defun window-combinations (&optional window horizontal) 214(defun window-combinations (&optional window horizontal)
218 "Return largest number of vertically arranged subwindows of WINDOW. 215 "Return largest number of vertically arranged subwindows of WINDOW.
219WINDOW can be any window and defaults to the selected one. 216If WINDOW is omitted or nil, it defaults to the selected window.
220Optional argument HORIZONTAL non-nil means to return the largest 217If HORIZONTAL is non-nil, return the largest number of
221number of horizontally arranged subwindows of WINDOW." 218horizontally arranged subwindows of WINDOW."
222 (setq window (window-normalize-window window)) 219 (setq window (window-normalize-window window))
223 (cond 220 (cond
224 ((window-live-p window) 221 ((window-live-p window)
225 ;; If WINDOW is live, return 1. 222 ;; If WINDOW is live, return 1.
226 1) 223 1)
227 ((window-combination-p window horizontal) 224 ((if horizontal
225 (window-left-child window)
226 (window-top-child window))
228 ;; If WINDOW is iso-combined, return the sum of the values for all 227 ;; If WINDOW is iso-combined, return the sum of the values for all
229 ;; subwindows of WINDOW. 228 ;; subwindows of WINDOW.
230 (let ((child (window-child window)) 229 (let ((child (window-child window))