diff options
| author | Martin Rudalics | 2011-06-06 11:09:42 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-06-06 11:09:42 +0200 |
| commit | bf60a96bc62eb465a482f5f95859a1147d0003d8 (patch) | |
| tree | 44869a6c508a0801399043db0d0e51bb10991f4d /src | |
| parent | f230ecc9626ca47183ea06a961594eb0aff000e9 (diff) | |
| download | emacs-bf60a96bc62eb465a482f5f95859a1147d0003d8.tar.gz emacs-bf60a96bc62eb465a482f5f95859a1147d0003d8.zip | |
Expose window-tree functions in Elisp.
(Fwindow_buffer): Move up and rewrite doc-string.
(Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
(Fwindow_prev): New functions.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/window.c | 67 |
2 files changed, 62 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 503a34626f7..e3ae905bac6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | * window.c (decode_window, decode_any_window): Move up in code. | 3 | * window.c (decode_window, decode_any_window): Move up in code. |
| 4 | (Fwindowp, Fwindow_live_p): Rewrite doc-strings. | 4 | (Fwindowp, Fwindow_live_p): Rewrite doc-strings. |
| 5 | (inhibit_frame_unsplittable): Remove unused variable. | 5 | (inhibit_frame_unsplittable): Remove unused variable. |
| 6 | (Fwindow_buffer): Move up and rewrite doc-string. | ||
| 7 | (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next) | ||
| 8 | (Fwindow_prev): New functions. | ||
| 6 | 9 | ||
| 7 | 2011-06-06 Paul Eggert <eggert@cs.ucla.edu> | 10 | 2011-06-06 Paul Eggert <eggert@cs.ucla.edu> |
| 8 | 11 | ||
diff --git a/src/window.c b/src/window.c index eed7ec6e61a..894775d6aa3 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -169,6 +169,60 @@ A live window is a window that displays a buffer. */) | |||
| 169 | return WINDOW_LIVE_P (object) ? Qt : Qnil; | 169 | return WINDOW_LIVE_P (object) ? Qt : Qnil; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, | ||
| 173 | doc: /* Return the buffer that WINDOW is displaying. | ||
| 174 | WINDOW can be any window and defaults to the selected one. | ||
| 175 | If WINDOW is an internal window return nil. */) | ||
| 176 | (Lisp_Object window) | ||
| 177 | { | ||
| 178 | return decode_any_window (window)->buffer; | ||
| 179 | } | ||
| 180 | |||
| 181 | DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0, | ||
| 182 | doc: /* Return WINDOW's parent window. | ||
| 183 | WINDOW can be any window and defaults to the selected one. | ||
| 184 | Return nil if WINDOW has no parent. */) | ||
| 185 | (Lisp_Object window) | ||
| 186 | { | ||
| 187 | return decode_any_window (window)->parent; | ||
| 188 | } | ||
| 189 | |||
| 190 | DEFUN ("window-vchild", Fwindow_vchild, Swindow_vchild, 0, 1, 0, | ||
| 191 | doc: /* Return WINDOW's first vertical child window. | ||
| 192 | WINDOW can be any window and defaults to the selected one. | ||
| 193 | Return nil if WINDOW has no vertical child. */) | ||
| 194 | (Lisp_Object window) | ||
| 195 | { | ||
| 196 | return decode_any_window (window)->vchild; | ||
| 197 | } | ||
| 198 | |||
| 199 | DEFUN ("window-hchild", Fwindow_hchild, Swindow_hchild, 0, 1, 0, | ||
| 200 | doc: /* Return WINDOW's first horizontal child window. | ||
| 201 | WINDOW can be any window and defaults to the selected one. | ||
| 202 | Return nil if WINDOW has no horizontal child. */) | ||
| 203 | (Lisp_Object window) | ||
| 204 | { | ||
| 205 | return decode_any_window (window)->hchild; | ||
| 206 | } | ||
| 207 | |||
| 208 | DEFUN ("window-next", Fwindow_next, Swindow_next, 0, 1, 0, | ||
| 209 | doc: /* Return WINDOW's right sibling window. | ||
| 210 | WINDOW can be any window and defaults to the selected one. | ||
| 211 | Return nil if WINDOW has no right sibling. */) | ||
| 212 | (Lisp_Object window) | ||
| 213 | { | ||
| 214 | return decode_any_window (window)->next; | ||
| 215 | } | ||
| 216 | |||
| 217 | DEFUN ("window-prev", Fwindow_prev, Swindow_prev, 0, 1, 0, | ||
| 218 | doc: /* Return WINDOW's left sibling window. | ||
| 219 | WINDOW can be any window and defaults to the selected one. | ||
| 220 | Return nil if WINDOW has no left sibling. */) | ||
| 221 | (Lisp_Object window) | ||
| 222 | { | ||
| 223 | return decode_any_window (window)->prev; | ||
| 224 | } | ||
| 225 | |||
| 172 | Lisp_Object | 226 | Lisp_Object |
| 173 | make_window (void) | 227 | make_window (void) |
| 174 | { | 228 | { |
| @@ -429,14 +483,6 @@ Return nil if window display is not up-to-date. In that case, use | |||
| 429 | 483 | ||
| 430 | 484 | ||
| 431 | 485 | ||
| 432 | DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, | ||
| 433 | doc: /* Return the buffer that WINDOW is displaying. | ||
| 434 | WINDOW defaults to the selected window. */) | ||
| 435 | (Lisp_Object window) | ||
| 436 | { | ||
| 437 | return decode_window (window)->buffer; | ||
| 438 | } | ||
| 439 | |||
| 440 | DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, | 486 | DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, |
| 441 | doc: /* Return the number of lines in WINDOW. | 487 | doc: /* Return the number of lines in WINDOW. |
| 442 | WINDOW defaults to the selected window. | 488 | WINDOW defaults to the selected window. |
| @@ -7113,6 +7159,11 @@ frame to be redrawn only if it is a tty frame. */); | |||
| 7113 | defsubr (&Spos_visible_in_window_p); | 7159 | defsubr (&Spos_visible_in_window_p); |
| 7114 | defsubr (&Swindow_line_height); | 7160 | defsubr (&Swindow_line_height); |
| 7115 | defsubr (&Swindow_buffer); | 7161 | defsubr (&Swindow_buffer); |
| 7162 | defsubr (&Swindow_parent); | ||
| 7163 | defsubr (&Swindow_vchild); | ||
| 7164 | defsubr (&Swindow_hchild); | ||
| 7165 | defsubr (&Swindow_next); | ||
| 7166 | defsubr (&Swindow_prev); | ||
| 7116 | defsubr (&Swindow_height); | 7167 | defsubr (&Swindow_height); |
| 7117 | defsubr (&Swindow_width); | 7168 | defsubr (&Swindow_width); |
| 7118 | defsubr (&Swindow_full_width_p); | 7169 | defsubr (&Swindow_full_width_p); |