aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Rudalics2011-06-06 10:13:36 +0200
committerMartin Rudalics2011-06-06 10:13:36 +0200
commitf230ecc9626ca47183ea06a961594eb0aff000e9 (patch)
treea22dcb5ad28eff462db1aa4ca32e30510eda5188 /src
parent4d09bcf621ec32e17fdb8dd2ea08344486f7aeef (diff)
downloademacs-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')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/window.c61
2 files changed, 29 insertions, 38 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 230e282e210..503a34626f7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12011-06-06 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (decode_window, decode_any_window): Move up in code.
4 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
5 (inhibit_frame_unsplittable): Remove unused variable.
6
12011-06-06 Paul Eggert <eggert@cs.ucla.edu> 72011-06-06 Paul Eggert <eggert@cs.ucla.edu>
2 8
3 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800). 9 * 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);
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
98Lisp_Object selected_window; 97Lisp_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
104Lisp_Object Vwindow_list; 102Lisp_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
111Lisp_Object minibuf_window; 108Lisp_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
116Lisp_Object minibuf_selected_window; 112Lisp_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
120static Lisp_Object Qtemp_buffer_show_hook; 115static Lisp_Object Qtemp_buffer_show_hook;
121 116
122/* Incremented for each window created. */ 117/* Incremented for each window created. */
123
124static int sequence_number; 118static int sequence_number;
125 119
126/* Nonzero after init_window_once has finished. */ 120/* Nonzero after init_window_once has finished. */
127
128static int window_initialized; 121static int window_initialized;
129 122
130/* Hook to run when window config changes. */ 123/* Hook to run when window config changes. */
131
132static Lisp_Object Qwindow_configuration_change_hook; 124static 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. */
135static int window_deletion_count; 127static 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
139static int window_scroll_pixel_based_preserve_x; 130static int window_scroll_pixel_based_preserve_x;
140static int window_scroll_pixel_based_preserve_y; 131static int window_scroll_pixel_based_preserve_y;
141 132
142/* Same for window_scroll_line_based. */ 133/* Same for window_scroll_line_based. */
143
144static int window_scroll_preserve_hpos; 134static int window_scroll_preserve_hpos;
145static int window_scroll_preserve_vpos; 135static int window_scroll_preserve_vpos;
136
137static struct window *
138decode_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);
149static int inhibit_frame_unsplittable; 145}
150#endif 146
147static struct window *
148decode_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
153DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0, 157DEFUN ("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
160DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0, 164DEFUN ("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.
166A 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
427static struct window *
428decode_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
437static struct window *
438decode_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
447DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0, 432DEFUN ("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.
449WINDOW defaults to the selected window. */) 434WINDOW defaults to the selected window. */)