From: Martin Rudalics Date: Mon, 6 Jun 2011 08:13:36 +0000 (+0200) Subject: Prepare for exposing window-tree functions in Elisp. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~16 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f230ecc9626ca47183ea06a961594eb0aff000e9;p=emacs.git Prepare for exposing window-tree functions in Elisp. * window.c (decode_window, decode_any_window): Move up in code. (Fwindowp, Fwindow_live_p): Rewrite doc-strings. (inhibit_frame_unsplittable): Remove unused variable. --- diff --git a/src/ChangeLog b/src/ChangeLog index 230e282e210..503a34626f7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-06-06 Martin Rudalics + + * window.c (decode_window, decode_any_window): Move up in code. + (Fwindowp, Fwindow_live_p): Rewrite doc-strings. + (inhibit_frame_unsplittable): Remove unused variable. + 2011-06-06 Paul Eggert * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800). diff --git a/src/window.c b/src/window.c index bc9f31e03e8..eed7ec6e61a 100644 --- a/src/window.c +++ b/src/window.c @@ -94,71 +94,76 @@ static Lisp_Object select_window (Lisp_Object, Lisp_Object, int); This value is always the same as FRAME_SELECTED_WINDOW (selected_frame). */ - Lisp_Object selected_window; /* A list of all windows for use by next_window and Fwindow_list. Functions creating or deleting windows should invalidate this cache by setting it to nil. */ - Lisp_Object Vwindow_list; /* The mini-buffer window of the selected frame. Note that you cannot test for mini-bufferness of an arbitrary window by comparing against this; but you can test for mini-bufferness of the selected window. */ - Lisp_Object minibuf_window; /* Non-nil means it is the window whose mode line should be shown as the selected window when the minibuffer is selected. */ - Lisp_Object minibuf_selected_window; /* Hook run at end of temp_output_buffer_show. */ - static Lisp_Object Qtemp_buffer_show_hook; /* Incremented for each window created. */ - static int sequence_number; /* Nonzero after init_window_once has finished. */ - static int window_initialized; /* Hook to run when window config changes. */ - static Lisp_Object Qwindow_configuration_change_hook; -/* Incremented by 1 whenever a window is deleted. */ +/* Incremented by 1 whenever a window is deleted. */ static int window_deletion_count; /* Used by the function window_scroll_pixel_based */ - static int window_scroll_pixel_based_preserve_x; static int window_scroll_pixel_based_preserve_y; /* Same for window_scroll_line_based. */ - static int window_scroll_preserve_hpos; static int window_scroll_preserve_vpos; + +static struct window * +decode_window (register Lisp_Object window) +{ + if (NILP (window)) + return XWINDOW (selected_window); -#if 0 /* This isn't used anywhere. */ -/* Nonzero means we can split a frame even if it is "unsplittable". */ -static int inhibit_frame_unsplittable; -#endif + CHECK_LIVE_WINDOW (window); + return XWINDOW (window); +} + +static struct window * +decode_any_window (register Lisp_Object window) +{ + if (NILP (window)) + return XWINDOW (selected_window); + + CHECK_WINDOW (window); + return XWINDOW (window); +} - DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, - doc: /* Return t if OBJECT is a window. */) + doc: /* Return t if OBJECT is a window and nil otherwise. */) (Lisp_Object object) { return WINDOWP (object) ? Qt : Qnil; } DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, - doc: /* Return t if OBJECT is a window which is currently visible. */) + doc: /* Return t if OBJECT is a live window and nil otherwise. +A live window is a window that displays a buffer. */) (Lisp_Object object) { return WINDOW_LIVE_P (object) ? Qt : Qnil; @@ -424,26 +429,6 @@ Return nil if window display is not up-to-date. In that case, use -static struct window * -decode_window (register Lisp_Object window) -{ - if (NILP (window)) - return XWINDOW (selected_window); - - CHECK_LIVE_WINDOW (window); - return XWINDOW (window); -} - -static struct window * -decode_any_window (register Lisp_Object window) -{ - if (NILP (window)) - return XWINDOW (selected_window); - - CHECK_WINDOW (window); - return XWINDOW (window); -} - DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, doc: /* Return the buffer that WINDOW is displaying. WINDOW defaults to the selected window. */)