Commit bf60a96b authored by Martin Rudalics's avatar Martin Rudalics

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.
parent f230ecc9
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
* window.c (decode_window, decode_any_window): Move up in code. * window.c (decode_window, decode_any_window): Move up in code.
(Fwindowp, Fwindow_live_p): Rewrite doc-strings. (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
(inhibit_frame_unsplittable): Remove unused variable. (inhibit_frame_unsplittable): Remove unused variable.
(Fwindow_buffer): Move up and rewrite doc-string.
(Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
(Fwindow_prev): New functions.
2011-06-06 Paul Eggert <eggert@cs.ucla.edu> 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
......
...@@ -169,6 +169,60 @@ A live window is a window that displays a buffer. */) ...@@ -169,6 +169,60 @@ A live window is a window that displays a buffer. */)
return WINDOW_LIVE_P (object) ? Qt : Qnil; return WINDOW_LIVE_P (object) ? Qt : Qnil;
} }
DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
doc: /* Return the buffer that WINDOW is displaying.
WINDOW can be any window and defaults to the selected one.
If WINDOW is an internal window return nil. */)
(Lisp_Object window)
{
return decode_any_window (window)->buffer;
}
DEFUN ("window-parent", Fwindow_parent, Swindow_parent, 0, 1, 0,
doc: /* Return WINDOW's parent window.
WINDOW can be any window and defaults to the selected one.
Return nil if WINDOW has no parent. */)
(Lisp_Object window)
{
return decode_any_window (window)->parent;
}
DEFUN ("window-vchild", Fwindow_vchild, Swindow_vchild, 0, 1, 0,
doc: /* Return WINDOW's first vertical child window.
WINDOW can be any window and defaults to the selected one.
Return nil if WINDOW has no vertical child. */)
(Lisp_Object window)
{
return decode_any_window (window)->vchild;
}
DEFUN ("window-hchild", Fwindow_hchild, Swindow_hchild, 0, 1, 0,
doc: /* Return WINDOW's first horizontal child window.
WINDOW can be any window and defaults to the selected one.
Return nil if WINDOW has no horizontal child. */)
(Lisp_Object window)
{
return decode_any_window (window)->hchild;
}
DEFUN ("window-next", Fwindow_next, Swindow_next, 0, 1, 0,
doc: /* Return WINDOW's right sibling window.
WINDOW can be any window and defaults to the selected one.
Return nil if WINDOW has no right sibling. */)
(Lisp_Object window)
{
return decode_any_window (window)->next;
}
DEFUN ("window-prev", Fwindow_prev, Swindow_prev, 0, 1, 0,
doc: /* Return WINDOW's left sibling window.
WINDOW can be any window and defaults to the selected one.
Return nil if WINDOW has no left sibling. */)
(Lisp_Object window)
{
return decode_any_window (window)->prev;
}
Lisp_Object Lisp_Object
make_window (void) make_window (void)
{ {
...@@ -429,14 +483,6 @@ Return nil if window display is not up-to-date. In that case, use ...@@ -429,14 +483,6 @@ Return nil if window display is not up-to-date. In that case, use
DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0,
doc: /* Return the buffer that WINDOW is displaying.
WINDOW defaults to the selected window. */)
(Lisp_Object window)
{
return decode_window (window)->buffer;
}
DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0, DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0,
doc: /* Return the number of lines in WINDOW. doc: /* Return the number of lines in WINDOW.
WINDOW defaults to the selected window. WINDOW defaults to the selected window.
...@@ -7113,6 +7159,11 @@ frame to be redrawn only if it is a tty frame. */); ...@@ -7113,6 +7159,11 @@ frame to be redrawn only if it is a tty frame. */);
defsubr (&Spos_visible_in_window_p); defsubr (&Spos_visible_in_window_p);
defsubr (&Swindow_line_height); defsubr (&Swindow_line_height);
defsubr (&Swindow_buffer); defsubr (&Swindow_buffer);
defsubr (&Swindow_parent);
defsubr (&Swindow_vchild);
defsubr (&Swindow_hchild);
defsubr (&Swindow_next);
defsubr (&Swindow_prev);
defsubr (&Swindow_height); defsubr (&Swindow_height);
defsubr (&Swindow_width); defsubr (&Swindow_width);
defsubr (&Swindow_full_width_p); defsubr (&Swindow_full_width_p);
......
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