aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-06 11:09:42 +0200
committerMartin Rudalics2011-06-06 11:09:42 +0200
commitbf60a96bc62eb465a482f5f95859a1147d0003d8 (patch)
tree44869a6c508a0801399043db0d0e51bb10991f4d /src
parentf230ecc9626ca47183ea06a961594eb0aff000e9 (diff)
downloademacs-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/ChangeLog3
-rw-r--r--src/window.c67
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
72011-06-06 Paul Eggert <eggert@cs.ucla.edu> 102011-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
172DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
173 doc: /* Return the buffer that WINDOW is displaying.
174WINDOW can be any window and defaults to the selected one.
175If WINDOW is an internal window return nil. */)
176 (Lisp_Object window)
177{
178 return decode_any_window (window)->buffer;
179}
180
181DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0,
182 doc: /* Return WINDOW's parent window.
183WINDOW can be any window and defaults to the selected one.
184Return nil if WINDOW has no parent. */)
185 (Lisp_Object window)
186{
187 return decode_any_window (window)->parent;
188}
189
190DEFUN ("window-vchild", Fwindow_vchild, Swindow_vchild, 0, 1, 0,
191 doc: /* Return WINDOW's first vertical child window.
192WINDOW can be any window and defaults to the selected one.
193Return nil if WINDOW has no vertical child. */)
194 (Lisp_Object window)
195{
196 return decode_any_window (window)->vchild;
197}
198
199DEFUN ("window-hchild", Fwindow_hchild, Swindow_hchild, 0, 1, 0,
200 doc: /* Return WINDOW's first horizontal child window.
201WINDOW can be any window and defaults to the selected one.
202Return nil if WINDOW has no horizontal child. */)
203 (Lisp_Object window)
204{
205 return decode_any_window (window)->hchild;
206}
207
208DEFUN ("window-next", Fwindow_next, Swindow_next, 0, 1, 0,
209 doc: /* Return WINDOW's right sibling window.
210WINDOW can be any window and defaults to the selected one.
211Return nil if WINDOW has no right sibling. */)
212 (Lisp_Object window)
213{
214 return decode_any_window (window)->next;
215}
216
217DEFUN ("window-prev", Fwindow_prev, Swindow_prev, 0, 1, 0,
218 doc: /* Return WINDOW's left sibling window.
219WINDOW can be any window and defaults to the selected one.
220Return nil if WINDOW has no left sibling. */)
221 (Lisp_Object window)
222{
223 return decode_any_window (window)->prev;
224}
225
172Lisp_Object 226Lisp_Object
173make_window (void) 227make_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
432DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
433 doc: /* Return the buffer that WINDOW is displaying.
434WINDOW defaults to the selected window. */)
435 (Lisp_Object window)
436{
437 return decode_window (window)->buffer;
438}
439
440DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, 486DEFUN ("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.
442WINDOW defaults to the selected window. 488WINDOW 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);