diff options
| author | Martin Rudalics | 2011-06-06 10:13:36 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2011-06-06 10:13:36 +0200 |
| commit | f230ecc9626ca47183ea06a961594eb0aff000e9 (patch) | |
| tree | a22dcb5ad28eff462db1aa4ca32e30510eda5188 /src/window.c | |
| parent | 4d09bcf621ec32e17fdb8dd2ea08344486f7aeef (diff) | |
| download | emacs-f230ecc9626ca47183ea06a961594eb0aff000e9.tar.gz emacs-f230ecc9626ca47183ea06a961594eb0aff000e9.zip | |
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.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 61 |
1 files changed, 23 insertions, 38 deletions
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); | |||
| 94 | 94 | ||
| 95 | This value is always the same as | 95 | This value is always the same as |
| 96 | FRAME_SELECTED_WINDOW (selected_frame). */ | 96 | FRAME_SELECTED_WINDOW (selected_frame). */ |
| 97 | |||
| 98 | Lisp_Object selected_window; | 97 | Lisp_Object selected_window; |
| 99 | 98 | ||
| 100 | /* A list of all windows for use by next_window and Fwindow_list. | 99 | /* A list of all windows for use by next_window and Fwindow_list. |
| 101 | Functions creating or deleting windows should invalidate this cache | 100 | Functions creating or deleting windows should invalidate this cache |
| 102 | by setting it to nil. */ | 101 | by setting it to nil. */ |
| 103 | |||
| 104 | Lisp_Object Vwindow_list; | 102 | Lisp_Object Vwindow_list; |
| 105 | 103 | ||
| 106 | /* The mini-buffer window of the selected frame. | 104 | /* The mini-buffer window of the selected frame. |
| 107 | Note that you cannot test for mini-bufferness of an arbitrary window | 105 | Note that you cannot test for mini-bufferness of an arbitrary window |
| 108 | by comparing against this; but you can test for mini-bufferness of | 106 | by comparing against this; but you can test for mini-bufferness of |
| 109 | the selected window. */ | 107 | the selected window. */ |
| 110 | |||
| 111 | Lisp_Object minibuf_window; | 108 | Lisp_Object minibuf_window; |
| 112 | 109 | ||
| 113 | /* Non-nil means it is the window whose mode line should be | 110 | /* Non-nil means it is the window whose mode line should be |
| 114 | shown as the selected window when the minibuffer is selected. */ | 111 | shown as the selected window when the minibuffer is selected. */ |
| 115 | |||
| 116 | Lisp_Object minibuf_selected_window; | 112 | Lisp_Object minibuf_selected_window; |
| 117 | 113 | ||
| 118 | /* Hook run at end of temp_output_buffer_show. */ | 114 | /* Hook run at end of temp_output_buffer_show. */ |
| 119 | |||
| 120 | static Lisp_Object Qtemp_buffer_show_hook; | 115 | static Lisp_Object Qtemp_buffer_show_hook; |
| 121 | 116 | ||
| 122 | /* Incremented for each window created. */ | 117 | /* Incremented for each window created. */ |
| 123 | |||
| 124 | static int sequence_number; | 118 | static int sequence_number; |
| 125 | 119 | ||
| 126 | /* Nonzero after init_window_once has finished. */ | 120 | /* Nonzero after init_window_once has finished. */ |
| 127 | |||
| 128 | static int window_initialized; | 121 | static int window_initialized; |
| 129 | 122 | ||
| 130 | /* Hook to run when window config changes. */ | 123 | /* Hook to run when window config changes. */ |
| 131 | |||
| 132 | static Lisp_Object Qwindow_configuration_change_hook; | 124 | static Lisp_Object Qwindow_configuration_change_hook; |
| 133 | /* Incremented by 1 whenever a window is deleted. */ | ||
| 134 | 125 | ||
| 126 | /* Incremented by 1 whenever a window is deleted. */ | ||
| 135 | static int window_deletion_count; | 127 | static int window_deletion_count; |
| 136 | 128 | ||
| 137 | /* Used by the function window_scroll_pixel_based */ | 129 | /* Used by the function window_scroll_pixel_based */ |
| 138 | |||
| 139 | static int window_scroll_pixel_based_preserve_x; | 130 | static int window_scroll_pixel_based_preserve_x; |
| 140 | static int window_scroll_pixel_based_preserve_y; | 131 | static int window_scroll_pixel_based_preserve_y; |
| 141 | 132 | ||
| 142 | /* Same for window_scroll_line_based. */ | 133 | /* Same for window_scroll_line_based. */ |
| 143 | |||
| 144 | static int window_scroll_preserve_hpos; | 134 | static int window_scroll_preserve_hpos; |
| 145 | static int window_scroll_preserve_vpos; | 135 | static int window_scroll_preserve_vpos; |
| 136 | |||
| 137 | static struct window * | ||
| 138 | decode_window (register Lisp_Object window) | ||
| 139 | { | ||
| 140 | if (NILP (window)) | ||
| 141 | return XWINDOW (selected_window); | ||
| 146 | 142 | ||
| 147 | #if 0 /* This isn't used anywhere. */ | 143 | CHECK_LIVE_WINDOW (window); |
| 148 | /* Nonzero means we can split a frame even if it is "unsplittable". */ | 144 | return XWINDOW (window); |
| 149 | static int inhibit_frame_unsplittable; | 145 | } |
| 150 | #endif | 146 | |
| 147 | static struct window * | ||
| 148 | decode_any_window (register Lisp_Object window) | ||
| 149 | { | ||
| 150 | if (NILP (window)) | ||
| 151 | return XWINDOW (selected_window); | ||
| 152 | |||
| 153 | CHECK_WINDOW (window); | ||
| 154 | return XWINDOW (window); | ||
| 155 | } | ||
| 151 | 156 | ||
| 152 | |||
| 153 | DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, | 157 | DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, |
| 154 | doc: /* Return t if OBJECT is a window. */) | 158 | doc: /* Return t if OBJECT is a window and nil otherwise. */) |
| 155 | (Lisp_Object object) | 159 | (Lisp_Object object) |
| 156 | { | 160 | { |
| 157 | return WINDOWP (object) ? Qt : Qnil; | 161 | return WINDOWP (object) ? Qt : Qnil; |
| 158 | } | 162 | } |
| 159 | 163 | ||
| 160 | DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, | 164 | DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, |
| 161 | doc: /* Return t if OBJECT is a window which is currently visible. */) | 165 | doc: /* Return t if OBJECT is a live window and nil otherwise. |
| 166 | A live window is a window that displays a buffer. */) | ||
| 162 | (Lisp_Object object) | 167 | (Lisp_Object object) |
| 163 | { | 168 | { |
| 164 | return WINDOW_LIVE_P (object) ? Qt : Qnil; | 169 | 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 | |||
| 424 | 429 | ||
| 425 | 430 | ||
| 426 | 431 | ||
| 427 | static struct window * | ||
| 428 | decode_window (register Lisp_Object window) | ||
| 429 | { | ||
| 430 | if (NILP (window)) | ||
| 431 | return XWINDOW (selected_window); | ||
| 432 | |||
| 433 | CHECK_LIVE_WINDOW (window); | ||
| 434 | return XWINDOW (window); | ||
| 435 | } | ||
| 436 | |||
| 437 | static struct window * | ||
| 438 | decode_any_window (register Lisp_Object window) | ||
| 439 | { | ||
| 440 | if (NILP (window)) | ||
| 441 | return XWINDOW (selected_window); | ||
| 442 | |||
| 443 | CHECK_WINDOW (window); | ||
| 444 | return XWINDOW (window); | ||
| 445 | } | ||
| 446 | |||
| 447 | DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, | 432 | DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, |
| 448 | doc: /* Return the buffer that WINDOW is displaying. | 433 | doc: /* Return the buffer that WINDOW is displaying. |
| 449 | WINDOW defaults to the selected window. */) | 434 | WINDOW defaults to the selected window. */) |