diff options
| author | Chong Yidong | 2011-11-06 11:59:53 +0800 |
|---|---|---|
| committer | Chong Yidong | 2011-11-06 11:59:53 +0800 |
| commit | 49745b39a15ecc32f4956c2d91530f196d9cd638 (patch) | |
| tree | dea6f8efd8e64595fb4dd1227d4965994937ca09 /lisp | |
| parent | 1f05cd82d2e3c79ecede95aef578d1f395549b22 (diff) | |
| download | emacs-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/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/window.el | 37 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-11-05 Chong Yidong <cyd@gnu.org> | 8 | 2011-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. | ||
| 200 | WINDOW can be any window and defaults to the selected one. | ||
| 201 | Optional argument HORIZONTAL non-nil means return WINDOW's first | ||
| 202 | child 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. |
| 210 | WINDOW can be any window and defaults to the selected one. | 200 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 211 | Optional argument HORIZONTAL non-nil means return non-nil if and | 201 | |
| 212 | only if WINDOW is horizontally combined." | 202 | HORIZONTAL determines a direction for the window combination. |
| 203 | If HORIZONTAL is omitted or nil, return non-nil if WINDOW is part | ||
| 204 | of a vertical window combination. | ||
| 205 | If HORIZONTAL is non-nil, return non-nil if WINDOW is part of a | ||
| 206 | horizontal 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. |
| 219 | WINDOW can be any window and defaults to the selected one. | 216 | If WINDOW is omitted or nil, it defaults to the selected window. |
| 220 | Optional argument HORIZONTAL non-nil means to return the largest | 217 | If HORIZONTAL is non-nil, return the largest number of |
| 221 | number of horizontally arranged subwindows of WINDOW." | 218 | horizontally 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)) |