Mercurial > hg > xemacs-beta
comparison src/window.c @ 444:576fb035e263 r21-2-37
Import from CVS: tag r21-2-37
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:36:19 +0200 |
parents | abe6d1db359e |
children | 3078fd1074e8 |
comparison
equal
deleted
inserted
replaced
443:a8296e22da4e | 444:576fb035e263 |
---|---|
62 int pixel_height, | 62 int pixel_height, |
63 int include_gutters_p); | 63 int include_gutters_p); |
64 static int window_char_height_to_pixel_height (struct window *w, | 64 static int window_char_height_to_pixel_height (struct window *w, |
65 int char_height, | 65 int char_height, |
66 int include_gutters_p); | 66 int include_gutters_p); |
67 static void change_window_height (struct window *w, int delta, int widthflag, | 67 static void change_window_height (Lisp_Object window, int delta, |
68 int inpixels); | 68 Lisp_Object horizontalp, int inpixels); |
69 | 69 |
70 /* Thickness of shadow border around 3d modelines. */ | 70 /* Thickness of shadow border around 3d modelines. */ |
71 Lisp_Object Vmodeline_shadow_thickness; | 71 Lisp_Object Vmodeline_shadow_thickness; |
72 | 72 |
73 /* Whether vertical dividers are draggable and displayed */ | 73 /* Whether vertical dividers are draggable and displayed */ |
1110 return WINDOW_HEIGHT (w); | 1110 return WINDOW_HEIGHT (w); |
1111 } | 1111 } |
1112 | 1112 |
1113 | 1113 |
1114 DEFUN ("windowp", Fwindowp, 1, 1, 0, /* | 1114 DEFUN ("windowp", Fwindowp, 1, 1, 0, /* |
1115 Return t if OBJ is a window. | 1115 Return t if OBJECT is a window. |
1116 */ | 1116 */ |
1117 (obj)) | 1117 (object)) |
1118 { | 1118 { |
1119 return WINDOWP (obj) ? Qt : Qnil; | 1119 return WINDOWP (object) ? Qt : Qnil; |
1120 } | 1120 } |
1121 | 1121 |
1122 DEFUN ("window-live-p", Fwindow_live_p, 1, 1, 0, /* | 1122 DEFUN ("window-live-p", Fwindow_live_p, 1, 1, 0, /* |
1123 Return t if OBJ is a window which is currently visible. | 1123 Return t if OBJECT is a window which is currently visible. |
1124 */ | 1124 */ |
1125 (obj)) | 1125 (object)) |
1126 { | 1126 { |
1127 return WINDOWP (obj) && WINDOW_LIVE_P (XWINDOW (obj)) ? Qt : Qnil; | 1127 return WINDOWP (object) && WINDOW_LIVE_P (XWINDOW (object)) |
1128 ? Qt : Qnil; | |
1128 } | 1129 } |
1129 | 1130 |
1130 DEFUN ("selected-window", Fselected_window, 0, 1, 0, /* | 1131 DEFUN ("selected-window", Fselected_window, 0, 1, 0, /* |
1131 Return the window that the cursor now appears in and commands apply to. | 1132 Return the window that the cursor now appears in and commands apply to. |
1132 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return | 1133 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return |
1595 | 1596 |
1596 #endif /* 0 */ | 1597 #endif /* 0 */ |
1597 | 1598 |
1598 DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* | 1599 DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* |
1599 Return a list of the pixel edge coordinates of WINDOW. | 1600 Return a list of the pixel edge coordinates of WINDOW. |
1600 \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | 1601 The returned list is of the form (LEFT TOP RIGHT BOTTOM), |
1601 The frame toolbars, menubars and gutters are considered to be outside of this area. | 1602 all relative to 0, 0 at the top left corner of WINDOW's frame. |
1603 The frame toolbars, menubars and gutters are considered to be outside | |
1604 of this area, while the scrollbars are considered to be inside. | |
1602 */ | 1605 */ |
1603 (window)) | 1606 (window)) |
1604 { | 1607 { |
1605 struct window *w = decode_window (window); | 1608 struct window *w = decode_window (window); |
1606 struct frame *f = XFRAME (w->frame); | 1609 struct frame *f = XFRAME (w->frame); |
1617 } | 1620 } |
1618 | 1621 |
1619 DEFUN ("window-text-area-pixel-edges", | 1622 DEFUN ("window-text-area-pixel-edges", |
1620 Fwindow_text_area_pixel_edges, 0, 1, 0, /* | 1623 Fwindow_text_area_pixel_edges, 0, 1, 0, /* |
1621 Return a list of the pixel edge coordinates of the text area of WINDOW. | 1624 Return a list of the pixel edge coordinates of the text area of WINDOW. |
1622 Returns the list \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at the | 1625 The returned list is of the form (LEFT TOP RIGHT BOTTOM), |
1623 top left corner of the window. | 1626 all relative to 0, 0 at the top left corner of the total area allocated |
1627 to the window, which includes the scrollbars. | |
1624 */ | 1628 */ |
1625 (window)) | 1629 (window)) |
1626 { | 1630 { |
1627 struct window *w = decode_window (window); | 1631 struct window *w = decode_window (window); |
1628 | 1632 |
1644 | 1648 |
1645 Note that, when WINDOW is the selected window and its buffer | 1649 Note that, when WINDOW is the selected window and its buffer |
1646 is also currently selected, the value returned is the same as (point). | 1650 is also currently selected, the value returned is the same as (point). |
1647 It would be more strictly correct to return the `top-level' value | 1651 It would be more strictly correct to return the `top-level' value |
1648 of point, outside of any save-excursion forms. | 1652 of point, outside of any save-excursion forms. |
1649 But that is hard to define. | 1653 But that value is hard to find. |
1650 */ | 1654 */ |
1651 (window)) | 1655 (window)) |
1652 { | 1656 { |
1653 struct window *w = decode_window (window); | 1657 struct window *w = decode_window (window); |
1654 | 1658 |
1670 } | 1674 } |
1671 | 1675 |
1672 DEFUN ("window-end", Fwindow_end, 0, 2, 0, /* | 1676 DEFUN ("window-end", Fwindow_end, 0, 2, 0, /* |
1673 Return position at which display currently ends in WINDOW. | 1677 Return position at which display currently ends in WINDOW. |
1674 This is updated by redisplay, when it runs to completion. | 1678 This is updated by redisplay, when it runs to completion. |
1675 Simply changing the buffer text or setting `window-start' | 1679 Simply changing the buffer text or setting `window-start' does not |
1676 does not update this value. | 1680 update this value. WINDOW defaults to the selected window. |
1677 If GUARANTEE is non-nil, then the return value is guaranteed to be | 1681 |
1678 the value of window-end at the end of the next full redisplay assuming | 1682 If optional arg GUARANTEE is non-nil, the return value is guaranteed |
1679 nothing else changes in the meantime. This function is potentially much | 1683 to be the same value as this function would return at the end of the |
1680 slower with this flag set. | 1684 next full redisplay assuming nothing else changes in the meantime. |
1685 This function is potentially much slower with this flag set. | |
1681 */ | 1686 */ |
1682 (window, guarantee)) | 1687 (window, guarantee)) |
1683 { | 1688 { |
1684 struct window *w = decode_window (window); | 1689 struct window *w = decode_window (window); |
1685 | 1690 |
1928 finalize_window ((void *) w, 0); | 1933 finalize_window ((void *) w, 0); |
1929 } | 1934 } |
1930 | 1935 |
1931 DEFUN ("delete-window", Fdelete_window, 0, 2, "", /* | 1936 DEFUN ("delete-window", Fdelete_window, 0, 2, "", /* |
1932 Remove WINDOW from the display. Default is selected window. | 1937 Remove WINDOW from the display. Default is selected window. |
1933 If window is the only one on the frame, the frame is destroyed. | 1938 If window is the only one on its frame, the frame is deleted as well. |
1934 Normally, you cannot delete the last non-minibuffer-only frame (you must | 1939 Normally, you cannot delete the last non-minibuffer-only frame (you must |
1935 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional | 1940 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional |
1936 second argument FORCE is non-nil, you can delete the last frame. (This | 1941 second argument FORCE is non-nil, you can delete the last frame. (This |
1937 will automatically call `save-buffers-kill-emacs'.) | 1942 will automatically call `save-buffers-kill-emacs'.) |
1938 */ | 1943 */ |
2122 counts, all windows on all frames that share that minibuffer count | 2127 counts, all windows on all frames that share that minibuffer count |
2123 too. Therefore, `next-window' can be used to iterate through the | 2128 too. Therefore, `next-window' can be used to iterate through the |
2124 set of windows even when the minibuffer is on another frame. If the | 2129 set of windows even when the minibuffer is on another frame. If the |
2125 minibuffer does not count, only windows from WINDOW's frame count. | 2130 minibuffer does not count, only windows from WINDOW's frame count. |
2126 | 2131 |
2127 Optional third arg ALL-FRAMES t means include windows on all frames. | 2132 By default, only the windows in the selected frame are considered. |
2128 ALL-FRAMES nil or omitted means cycle within the frames as specified | 2133 The optional argument WHICH-FRAMES changes this behavior: |
2129 above. ALL-FRAMES = `visible' means include windows on all visible frames. | 2134 WHICH-FRAMES = `visible' means search windows on all visible frames. |
2130 ALL-FRAMES = 0 means include windows on all visible and iconified frames. | 2135 WHICH-FRAMES = 0 means search windows on all visible and iconified frames. |
2131 If ALL-FRAMES is a frame, restrict search to windows on that frame. | 2136 WHICH-FRAMES = t means search windows on all frames including invisible frames. |
2132 Anything else means restrict to WINDOW's frame. | 2137 WHICH-FRAMES = a frame means search only windows on that frame. |
2133 | 2138 Anything else means restrict to the selected frame. |
2134 Optional fourth arg CONSOLE controls which consoles or devices the | 2139 |
2135 returned window may be on. If CONSOLE is a console, return windows only | 2140 The optional fourth argument WHICH-DEVICES further clarifies on which |
2136 on that console. If CONSOLE is a device, return windows only on that | 2141 devices to search for frames as specified by WHICH-FRAMES. This value |
2137 device. If CONSOLE is a console type, return windows only on consoles | 2142 is only meaningful if WHICH-FRAMES is non-nil. |
2138 of that type. If CONSOLE is 'window-system, return any windows on any | 2143 If nil or omitted, search all devices on the selected console. |
2139 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2144 If a device, only search that device. |
2140 on WINDOW's console. Otherwise, all windows are considered. | 2145 If a console, search all devices on that console. |
2141 | 2146 If a device type, search all devices of that type. |
2142 If you use consistent values for MINIBUF, ALL-FRAMES, and CONSOLE, you | 2147 If `window-system', search all window-system devices. |
2143 can use `next-window' to iterate through the entire cycle of acceptable | 2148 Any other non-nil value means search all devices. |
2144 windows, eventually ending up back at the window you started with. | 2149 |
2150 If you use consistent values for MINIBUF, WHICH-FRAMES, and WHICH-DEVICES, | |
2151 you can use `next-window' to iterate through the entire cycle of | |
2152 acceptable windows, eventually ending up back at the window you started with. | |
2145 `previous-window' traverses the same cycle, in the reverse order. | 2153 `previous-window' traverses the same cycle, in the reverse order. |
2146 */ | 2154 */ |
2147 (window, minibuf, all_frames, console)) | 2155 (window, minibuf, which_frames, which_devices)) |
2148 { | 2156 { |
2149 Lisp_Object tem; | 2157 Lisp_Object tem; |
2150 Lisp_Object start_window; | 2158 Lisp_Object start_window; |
2151 | 2159 |
2152 if (NILP (window)) | 2160 if (NILP (window)) |
2165 /* Now `minibuf' is one of: | 2173 /* Now `minibuf' is one of: |
2166 t => count all minibuffer windows | 2174 t => count all minibuffer windows |
2167 lambda => count none of them | 2175 lambda => count none of them |
2168 or a specific minibuffer window (the active one) to count. */ | 2176 or a specific minibuffer window (the active one) to count. */ |
2169 | 2177 |
2170 /* all_frames == nil doesn't specify which frames to include. */ | 2178 /* which_frames == nil doesn't specify which frames to include. */ |
2171 if (NILP (all_frames)) | 2179 if (NILP (which_frames)) |
2172 all_frames = (! EQ (minibuf, Qlambda) | 2180 which_frames = (! EQ (minibuf, Qlambda) |
2173 ? (FRAME_MINIBUF_WINDOW | 2181 ? (FRAME_MINIBUF_WINDOW |
2174 (XFRAME | 2182 (XFRAME |
2175 (WINDOW_FRAME | 2183 (WINDOW_FRAME |
2176 (XWINDOW (window))))) | 2184 (XWINDOW (window))))) |
2177 : Qnil); | 2185 : Qnil); |
2178 else if (EQ (all_frames, Qvisible)) | 2186 else if (EQ (which_frames, Qvisible)) |
2179 ; | 2187 ; |
2180 else if (ZEROP (all_frames)) | 2188 else if (ZEROP (which_frames)) |
2181 ; | 2189 ; |
2182 else if (FRAMEP (all_frames) && ! EQ (all_frames, Fwindow_frame (window))) | 2190 else if (FRAMEP (which_frames) && ! EQ (which_frames, Fwindow_frame (window))) |
2183 /* If all_frames is a frame and window arg isn't on that frame, just | 2191 /* If which_frames is a frame and window arg isn't on that frame, just |
2184 return the first window on the frame. */ | 2192 return the first window on the frame. */ |
2185 return frame_first_window (XFRAME (all_frames)); | 2193 return frame_first_window (XFRAME (which_frames)); |
2186 else if (! EQ (all_frames, Qt)) | 2194 else if (! EQ (which_frames, Qt)) |
2187 all_frames = Qnil; | 2195 which_frames = Qnil; |
2188 /* Now `all_frames' is one of: | 2196 /* Now `which_frames' is one of: |
2189 t => search all frames | 2197 t => search all frames |
2190 nil => search just the current frame | 2198 nil => search just the current frame |
2191 visible => search just visible frames | 2199 visible => search just visible frames |
2192 0 => search visible and iconified frames | 2200 0 => search visible and iconified frames |
2193 a window => search the frame that window belongs to. */ | 2201 a window => search the frame that window belongs to. */ |
2205 { | 2213 { |
2206 /* We've reached the end of this frame. | 2214 /* We've reached the end of this frame. |
2207 Which other frames are acceptable? */ | 2215 Which other frames are acceptable? */ |
2208 tem = WINDOW_FRAME (XWINDOW (window)); | 2216 tem = WINDOW_FRAME (XWINDOW (window)); |
2209 | 2217 |
2210 if (! NILP (all_frames)) | 2218 if (! NILP (which_frames)) |
2211 { | 2219 { |
2212 Lisp_Object tem1 = tem; | 2220 Lisp_Object tem1 = tem; |
2213 tem = next_frame (tem, all_frames, console); | 2221 tem = next_frame (tem, which_frames, which_devices); |
2214 | 2222 |
2215 /* In the case where the minibuffer is active, | 2223 /* In the case where the minibuffer is active, |
2216 and we include its frame as well as the selected one, | 2224 and we include its frame as well as the selected one, |
2217 next_frame may get stuck in that frame. | 2225 next_frame may get stuck in that frame. |
2218 If that happens, go back to the selected frame | 2226 If that happens, go back to the selected frame |
2265 counts, all windows on all frames that share that minibuffer count | 2273 counts, all windows on all frames that share that minibuffer count |
2266 too. Therefore, `previous-window' can be used to iterate through | 2274 too. Therefore, `previous-window' can be used to iterate through |
2267 the set of windows even when the minibuffer is on another frame. If | 2275 the set of windows even when the minibuffer is on another frame. If |
2268 the minibuffer does not count, only windows from WINDOW's frame count. | 2276 the minibuffer does not count, only windows from WINDOW's frame count. |
2269 | 2277 |
2270 Optional third arg ALL-FRAMES t means include windows on all frames. | 2278 By default, only the windows in the selected frame are considered. |
2271 ALL-FRAMES nil or omitted means cycle within the frames as specified | 2279 The optional argument WHICH-FRAMES changes this behavior: |
2272 above. ALL-FRAMES = `visible' means include windows on all visible frames. | 2280 WHICH-FRAMES = `visible' means search windows on all visible frames. |
2273 ALL-FRAMES = 0 means include windows on all visible and iconified frames. | 2281 WHICH-FRAMES = 0 means search windows on all visible and iconified frames. |
2274 If ALL-FRAMES is a frame, restrict search to windows on that frame. | 2282 WHICH-FRAMES = t means search windows on all frames including invisible frames. |
2275 Anything else means restrict to WINDOW's frame. | 2283 WHICH-FRAMES = a frame means search only windows on that frame. |
2276 | 2284 Anything else means restrict to the selected frame. |
2277 Optional fourth arg CONSOLE controls which consoles or devices the | 2285 |
2278 returned window may be on. If CONSOLE is a console, return windows only | 2286 The optional fourth argument WHICH-DEVICES further clarifies on which |
2279 on that console. If CONSOLE is a device, return windows only on that | 2287 devices to search for frames as specified by WHICH-FRAMES. This value |
2280 device. If CONSOLE is a console type, return windows only on consoles | 2288 is only meaningful if WHICH-FRAMES is non-nil. |
2281 of that type. If CONSOLE is 'window-system, return any windows on any | 2289 If nil or omitted, search all devices on the selected console. |
2282 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2290 If a device, only search that device. |
2283 on WINDOW's console. Otherwise, all windows are considered. | 2291 If a console, search all devices on that console. |
2284 | 2292 If a device type, search all devices of that type. |
2285 If you use consistent values for MINIBUF, ALL-FRAMES, and CONSOLE, you | 2293 If `window-system', search all window-system devices. |
2286 can use `previous-window' to iterate through the entire cycle of acceptable | 2294 Any other non-nil value means search all devices. |
2287 windows, eventually ending up back at the window you started with. | 2295 |
2296 If you use consistent values for MINIBUF, WHICH-FRAMES, and WHICH-DEVICES, | |
2297 you can use `previous-window' to iterate through the entire cycle of | |
2298 acceptable windows, eventually ending up back at the window you started with. | |
2288 `next-window' traverses the same cycle, in the reverse order. | 2299 `next-window' traverses the same cycle, in the reverse order. |
2289 */ | 2300 */ |
2290 (window, minibuf, all_frames, console)) | 2301 (window, minibuf, which_frames, devices)) |
2291 { | 2302 { |
2292 Lisp_Object tem; | 2303 Lisp_Object tem; |
2293 Lisp_Object start_window; | 2304 Lisp_Object start_window; |
2294 | 2305 |
2295 if (NILP (window)) | 2306 if (NILP (window)) |
2308 /* Now `minibuf' is one of: | 2319 /* Now `minibuf' is one of: |
2309 t => count all minibuffer windows | 2320 t => count all minibuffer windows |
2310 lambda => count none of them | 2321 lambda => count none of them |
2311 or a specific minibuffer window (the active one) to count. */ | 2322 or a specific minibuffer window (the active one) to count. */ |
2312 | 2323 |
2313 /* all_frames == nil doesn't specify which frames to include. | 2324 /* which_frames == nil doesn't specify which frames to include. |
2314 Decide which frames it includes. */ | 2325 Decide which frames it includes. */ |
2315 if (NILP (all_frames)) | 2326 if (NILP (which_frames)) |
2316 all_frames = (! EQ (minibuf, Qlambda) | 2327 which_frames = (! EQ (minibuf, Qlambda) |
2317 ? (FRAME_MINIBUF_WINDOW | 2328 ? (FRAME_MINIBUF_WINDOW |
2318 (XFRAME | 2329 (XFRAME |
2319 (WINDOW_FRAME | 2330 (WINDOW_FRAME |
2320 (XWINDOW (window))))) | 2331 (XWINDOW (window))))) |
2321 : Qnil); | 2332 : Qnil); |
2322 else if (EQ (all_frames, Qvisible)) | 2333 else if (EQ (which_frames, Qvisible)) |
2323 ; | 2334 ; |
2324 else if (ZEROP (all_frames)) | 2335 else if (ZEROP (which_frames)) |
2325 ; | 2336 ; |
2326 else if (FRAMEP (all_frames) && ! EQ (all_frames, Fwindow_frame (window))) | 2337 else if (FRAMEP (which_frames) && ! EQ (which_frames, Fwindow_frame (window))) |
2327 /* If all_frames is a frame and window arg isn't on that frame, just | 2338 /* If which_frames is a frame and window arg isn't on that frame, just |
2328 return the first window on the frame. */ | 2339 return the first window on the frame. */ |
2329 return frame_first_window (XFRAME (all_frames)); | 2340 return frame_first_window (XFRAME (which_frames)); |
2330 else if (! EQ (all_frames, Qt)) | 2341 else if (! EQ (which_frames, Qt)) |
2331 all_frames = Qnil; | 2342 which_frames = Qnil; |
2332 /* Now `all_frames' is one of: | 2343 /* Now `which_frames' is one of: |
2333 t => search all frames | 2344 t => search all frames |
2334 nil => search just the current frame | 2345 nil => search just the current frame |
2335 visible => search just visible frames | 2346 visible => search just visible frames |
2336 0 => search visible and iconified frames | 2347 0 => search visible and iconified frames |
2337 a window => search the frame that window belongs to. */ | 2348 a window => search the frame that window belongs to. */ |
2349 { | 2360 { |
2350 /* We have found the top window on the frame. | 2361 /* We have found the top window on the frame. |
2351 Which frames are acceptable? */ | 2362 Which frames are acceptable? */ |
2352 tem = WINDOW_FRAME (XWINDOW (window)); | 2363 tem = WINDOW_FRAME (XWINDOW (window)); |
2353 | 2364 |
2354 if (! NILP (all_frames)) | 2365 if (! NILP (which_frames)) |
2355 /* It's actually important that we use previous_frame here, | 2366 /* It's actually important that we use previous_frame here, |
2356 rather than next_frame. All the windows acceptable | 2367 rather than next_frame. All the windows acceptable |
2357 according to the given parameters should form a ring; | 2368 according to the given parameters should form a ring; |
2358 Fnext_window and Fprevious_window should go back and | 2369 Fnext_window and Fprevious_window should go back and |
2359 forth around the ring. If we use next_frame here, | 2370 forth around the ring. If we use next_frame here, |
2361 paths through the set of acceptable windows. | 2372 paths through the set of acceptable windows. |
2362 window_loop assumes that these `ring' requirement are | 2373 window_loop assumes that these `ring' requirement are |
2363 met. */ | 2374 met. */ |
2364 { | 2375 { |
2365 Lisp_Object tem1 = tem; | 2376 Lisp_Object tem1 = tem; |
2366 tem = previous_frame (tem, all_frames, console); | 2377 tem = previous_frame (tem, which_frames, devices); |
2367 /* In the case where the minibuffer is active, | 2378 /* In the case where the minibuffer is active, |
2368 and we include its frame as well as the selected one, | 2379 and we include its frame as well as the selected one, |
2369 next_frame may get stuck in that frame. | 2380 next_frame may get stuck in that frame. |
2370 If that happens, go back to the selected frame | 2381 If that happens, go back to the selected frame |
2371 so we can complete the cycle. */ | 2382 so we can complete the cycle. */ |
2460 else | 2471 else |
2461 return window; | 2472 return window; |
2462 } | 2473 } |
2463 | 2474 |
2464 DEFUN ("other-window", Fother_window, 1, 3, "p", /* | 2475 DEFUN ("other-window", Fother_window, 1, 3, "p", /* |
2465 Select the N'th different window on this frame. | 2476 Select the COUNT'th different window on this frame. |
2466 All windows on current frame are arranged in a cyclic order. | 2477 All windows on current frame are arranged in a cyclic order. |
2467 This command selects the window N steps away in that order. | 2478 This command selects the window COUNT steps away in that order. |
2468 A negative N moves in the opposite order. | 2479 A negative COUNT moves in the opposite order. |
2469 | 2480 |
2470 If optional argument FRAME is `visible', search all visible frames. | 2481 By default, only the windows in the selected frame are considered. |
2471 If FRAME is 0, search all visible and iconified frames. | 2482 The optional argument WHICH-FRAMES changes this behavior: |
2472 If FRAME is t, search all frames. | 2483 WHICH-FRAMES = `visible' means search windows on all visible frames. |
2473 If FRAME is nil, search only the selected frame. | 2484 WHICH-FRAMES = 0 means search windows on all visible and iconified frames. |
2474 If FRAME is a frame, search only that frame. | 2485 WHICH-FRAMES = t means search windows on all frames including invisible frames. |
2475 | 2486 WHICH-FRAMES = a frame means search only windows on that frame. |
2476 Optional third argument CONSOLE controls which consoles or devices the | 2487 Anything else means restrict to the selected frame. |
2477 returned window may be on. If CONSOLE is a console, return windows only | 2488 |
2478 on that console. If CONSOLE is a device, return windows only on that | 2489 The optional argument WHICH-DEVICES further clarifies on which devices |
2479 device. If CONSOLE is a console type, return windows only on consoles | 2490 to search for frames as specified by WHICH-FRAMES. This value is only |
2480 of that type. If CONSOLE is 'window-system, return any windows on any | 2491 meaningful if WHICH-FRAMES is non-nil. |
2481 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2492 If nil or omitted, search all devices on the selected console. |
2482 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2493 If a device, only search that device. |
2483 Otherwise, all windows are considered. | 2494 If a console, search all devices on that console. |
2484 */ | 2495 If a device type, search all devices of that type. |
2485 (n, frame, console)) | 2496 If `window-system', search all window-system devices. |
2497 Any other non-nil value means search all devices. | |
2498 */ | |
2499 (count, which_frames, which_devices)) | |
2486 { | 2500 { |
2487 int i; | 2501 int i; |
2488 Lisp_Object w; | 2502 Lisp_Object w; |
2489 | 2503 |
2490 CHECK_INT (n); | 2504 CHECK_INT (count); |
2491 w = Fselected_window (Qnil); | 2505 w = Fselected_window (Qnil); |
2492 i = XINT (n); | 2506 i = XINT (count); |
2493 | 2507 |
2494 while (i > 0) | 2508 while (i > 0) |
2495 { | 2509 { |
2496 w = Fnext_window (w, Qnil, frame, console); | 2510 w = Fnext_window (w, Qnil, which_frames, which_devices); |
2497 i--; | 2511 i--; |
2498 } | 2512 } |
2499 while (i < 0) | 2513 while (i < 0) |
2500 { | 2514 { |
2501 w = Fprevious_window (w, Qnil, frame, console); | 2515 w = Fprevious_window (w, Qnil, which_frames, which_devices); |
2502 i++; | 2516 i++; |
2503 } | 2517 } |
2504 Fselect_window (w, Qnil); | 2518 Fselect_window (w, Qnil); |
2505 return Qnil; | 2519 return Qnil; |
2506 } | 2520 } |
2529 | 2543 |
2530 static Lisp_Object | 2544 static Lisp_Object |
2531 window_loop (enum window_loop type, | 2545 window_loop (enum window_loop type, |
2532 Lisp_Object obj, | 2546 Lisp_Object obj, |
2533 int mini, | 2547 int mini, |
2534 Lisp_Object frames, | 2548 Lisp_Object which_frames, |
2535 int dedicated_too, | 2549 int dedicated_too, |
2536 Lisp_Object console) | 2550 Lisp_Object which_devices) |
2537 { | 2551 { |
2538 /* This function can GC if type == DELETE_BUFFER_WINDOWS or UNSHOW_BUFFER */ | 2552 /* This function can GC if type == DELETE_BUFFER_WINDOWS or UNSHOW_BUFFER */ |
2539 Lisp_Object w; | 2553 Lisp_Object w; |
2540 Lisp_Object best_window = Qnil; | 2554 Lisp_Object best_window = Qnil; |
2541 Lisp_Object next_window; | 2555 Lisp_Object next_window; |
2550 Lisp_Object devcons, concons; | 2564 Lisp_Object devcons, concons; |
2551 | 2565 |
2552 /* If we're only looping through windows on a particular frame, | 2566 /* If we're only looping through windows on a particular frame, |
2553 FRAME points to that frame. If we're looping through windows | 2567 FRAME points to that frame. If we're looping through windows |
2554 on all frames, FRAME is 0. */ | 2568 on all frames, FRAME is 0. */ |
2555 if (FRAMEP (frames)) | 2569 if (FRAMEP (which_frames)) |
2556 frame = XFRAME (frames); | 2570 frame = XFRAME (which_frames); |
2557 else if (NILP (frames)) | 2571 else if (NILP (which_frames)) |
2558 frame = selected_frame (); | 2572 frame = selected_frame (); |
2559 else | 2573 else |
2560 frame = 0; | 2574 frame = 0; |
2561 | 2575 |
2562 /* FRAME_ARG is Qlambda to stick to one frame, | 2576 /* FRAME_ARG is Qlambda to stick to one frame, |
2563 Qvisible to consider all visible frames, | 2577 Qvisible to consider all visible frames, |
2564 or Qt otherwise. */ | 2578 or Qt otherwise. */ |
2565 if (frame) | 2579 if (frame) |
2566 frame_arg = Qlambda; | 2580 frame_arg = Qlambda; |
2567 else if (ZEROP (frames)) | 2581 else if (ZEROP (which_frames)) |
2568 frame_arg = frames; | 2582 frame_arg = which_frames; |
2569 else if (EQ (frames, Qvisible)) | 2583 else if (EQ (which_frames, Qvisible)) |
2570 frame_arg = frames; | 2584 frame_arg = which_frames; |
2571 | 2585 |
2572 DEVICE_LOOP_NO_BREAK (devcons, concons) | 2586 DEVICE_LOOP_NO_BREAK (devcons, concons) |
2573 { | 2587 { |
2574 Lisp_Object device = XCAR (devcons); | 2588 Lisp_Object device = XCAR (devcons); |
2575 Lisp_Object the_frame; | 2589 Lisp_Object the_frame; |
2580 the_frame = DEVICE_SELECTED_FRAME (XDEVICE (device)); | 2594 the_frame = DEVICE_SELECTED_FRAME (XDEVICE (device)); |
2581 | 2595 |
2582 if (NILP (the_frame)) | 2596 if (NILP (the_frame)) |
2583 continue; | 2597 continue; |
2584 | 2598 |
2585 if (!device_matches_console_spec (device, | 2599 if (!device_matches_device_spec (device, |
2586 NILP (console) ? | 2600 NILP (which_devices) ? |
2587 FRAME_CONSOLE (XFRAME (the_frame)) : | 2601 FRAME_CONSOLE (XFRAME (the_frame)) : |
2588 console)) | 2602 which_devices)) |
2589 continue; | 2603 continue; |
2590 | 2604 |
2591 /* Pick a window to start with. */ | 2605 /* Pick a window to start with. */ |
2592 if (WINDOWP (obj)) | 2606 if (WINDOWP (obj)) |
2593 w = obj; | 2607 w = obj; |
2853 #endif | 2867 #endif |
2854 | 2868 |
2855 | 2869 |
2856 DEFUN ("get-lru-window", Fget_lru_window, 0, 2, 0, /* | 2870 DEFUN ("get-lru-window", Fget_lru_window, 0, 2, 0, /* |
2857 Return the window least recently selected or used for display. | 2871 Return the window least recently selected or used for display. |
2858 If optional argument FRAME is `visible', search all visible frames. | 2872 |
2859 If FRAME is 0, search all visible and iconified frames. | 2873 By default, only the windows in the selected frame are considered. |
2860 If FRAME is t, search all frames. | 2874 The optional argument WHICH-FRAMES changes this behavior: |
2861 If FRAME is nil, search only the selected frame. | 2875 If optional argument WHICH-FRAMES is `visible', search all visible frames. |
2862 If FRAME is a frame, search only that frame. | 2876 If WHICH-FRAMES is 0, search all visible and iconified frames. |
2863 | 2877 If WHICH-FRAMES is t, search all frames. |
2864 Optional second argument CONSOLE controls which consoles or devices the | 2878 If WHICH-FRAMES is nil, search only the selected frame. |
2865 returned window may be on. If CONSOLE is a console, return windows only | 2879 If WHICH-FRAMES is a frame, search only that frame. |
2866 on that console. If CONSOLE is a device, return windows only on that | 2880 |
2867 device. If CONSOLE is a console type, return windows only on consoles | 2881 The optional argument WHICH-DEVICES further clarifies on which devices |
2868 of that type. If CONSOLE is 'window-system, return any windows on any | 2882 to search for frames as specified by WHICH-FRAMES. This value is only |
2869 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2883 meaningful if WHICH-FRAMES is non-nil. |
2870 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2884 If nil or omitted, search all devices on the selected console. |
2871 Otherwise, all windows are considered. | 2885 If a device, only search that device. |
2872 */ | 2886 If a console, search all devices on that console. |
2873 (frame, console)) | 2887 If a device type, search all devices of that type. |
2888 If `window-system', search all devices on window-system consoles. | |
2889 Any other non-nil value means search all devices. | |
2890 */ | |
2891 (which_frames, which_devices)) | |
2874 { | 2892 { |
2875 Lisp_Object w; | 2893 Lisp_Object w; |
2876 /* First try for a non-dedicated window that is full-width */ | 2894 /* First try for a non-dedicated window that is full-width */ |
2877 w = window_loop (GET_LRU_WINDOW, Qt, 0, frame, 0, console); | 2895 w = window_loop (GET_LRU_WINDOW, Qt, 0, which_frames, 0, which_devices); |
2878 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) | 2896 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) |
2879 return w; | 2897 return w; |
2880 | 2898 |
2881 /* Then try for any non-dedicated window */ | 2899 /* Then try for any non-dedicated window */ |
2882 w = window_loop (GET_LRU_WINDOW, Qnil, 0, frame, 0, console); | 2900 w = window_loop (GET_LRU_WINDOW, Qnil, 0, which_frames, 0, which_devices); |
2883 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) | 2901 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) |
2884 return w; | 2902 return w; |
2885 | 2903 |
2886 #if 0 | 2904 #if 0 |
2887 /* FSFmacs never returns a dedicated window here. If we do, | 2905 /* FSFmacs never returns a dedicated window here. If we do, |
2888 it makes `display-buffer' not work right. #### All of this | 2906 it makes `display-buffer' not work right. #### All of this |
2889 shit is so disgusting and awful that it needs to be rethought | 2907 shit is so disgusting and awful that it needs to be rethought |
2890 from scratch. */ | 2908 from scratch. */ |
2891 /* then try for a dedicated window that is full-width */ | 2909 /* then try for a dedicated window that is full-width */ |
2892 w = window_loop (GET_LRU_WINDOW, Qt, 0, frame, 1, console); | 2910 w = window_loop (GET_LRU_WINDOW, Qt, 0, which_frames, 1, which_devices); |
2893 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) | 2911 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) |
2894 return w; | 2912 return w; |
2895 | 2913 |
2896 /* If none of them, then all windows, dedicated or not. */ | 2914 /* If none of them, then all windows, dedicated or not. */ |
2897 w = window_loop (GET_LRU_WINDOW, Qnil, 0, frame, 1, console); | 2915 w = window_loop (GET_LRU_WINDOW, Qnil, 0, which_frames, 1, which_devices); |
2898 | 2916 |
2899 /* At this point we damn well better have found something. */ | 2917 /* At this point we damn well better have found something. */ |
2900 if (NILP (w)) abort (); | 2918 if (NILP (w)) abort (); |
2901 #endif | 2919 #endif |
2902 | 2920 |
2903 return w; | 2921 return w; |
2904 } | 2922 } |
2905 | 2923 |
2906 DEFUN ("get-largest-window", Fget_largest_window, 0, 2, 0, /* | 2924 DEFUN ("get-largest-window", Fget_largest_window, 0, 2, 0, /* |
2907 Return the window largest in area. | 2925 Return the window largest in area. |
2908 If optional argument FRAME is `visible', search all visible frames. | 2926 |
2909 If FRAME is 0, search all visible and iconified frames. | 2927 By default, only the windows in the selected frame are considered. |
2910 If FRAME is t, search all frames. | 2928 The optional argument WHICH-FRAMES changes this behavior: |
2911 If FRAME is nil, search only the selected frame. | 2929 If optional argument WHICH-FRAMES is `visible', search all visible frames. |
2912 If FRAME is a frame, search only that frame. | 2930 If WHICH-FRAMES is 0, search all visible and iconified frames. |
2913 | 2931 If WHICH-FRAMES is t, search all frames. |
2914 Optional second argument CONSOLE controls which consoles or devices the | 2932 If WHICH-FRAMES is nil, search only the selected frame. |
2915 returned window may be on. If CONSOLE is a console, return windows only | 2933 If WHICH-FRAMES is a frame, search only that frame. |
2916 on that console. If CONSOLE is a device, return windows only on that | 2934 |
2917 device. If CONSOLE is a console type, return windows only on consoles | 2935 The optional argument WHICH-DEVICES further clarifies on which devices |
2918 of that type. If CONSOLE is 'window-system, return any windows on any | 2936 to search for frames as specified by WHICH-FRAMES. This value is only |
2919 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2937 meaningful if WHICH-FRAMES is non-nil. |
2920 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2938 If nil or omitted, search all devices on the selected console. |
2921 Otherwise, all windows are considered. | 2939 If a device, only search that device. |
2922 */ | 2940 If a console, search all devices on that console. |
2923 (frame, console)) | 2941 If a device type, search all devices of that type. |
2942 If `window-system', search all devices on window-system consoles. | |
2943 Any other non-nil value means search all devices. | |
2944 */ | |
2945 (which_frames, which_devices)) | |
2924 { | 2946 { |
2925 /* Don't search dedicated windows because FSFmacs doesn't. | 2947 /* Don't search dedicated windows because FSFmacs doesn't. |
2926 This stuff is all black magic so don't try to apply common | 2948 This stuff is all black magic so don't try to apply common |
2927 sense to it. */ | 2949 sense to it. */ |
2928 return window_loop (GET_LARGEST_WINDOW, Qnil, 0, frame, 0, console); | 2950 return window_loop (GET_LARGEST_WINDOW, Qnil, 0, |
2951 which_frames, 0, which_devices); | |
2929 } | 2952 } |
2930 | 2953 |
2931 DEFUN ("get-buffer-window", Fget_buffer_window, 1, 3, 0, /* | 2954 DEFUN ("get-buffer-window", Fget_buffer_window, 1, 3, 0, /* |
2932 Return a window currently displaying BUFFER, or nil if none. | 2955 Return a window currently displaying BUFFER, or nil if none. |
2933 If optional argument FRAME is `visible', search all visible frames. | 2956 |
2934 If optional argument FRAME is 0, search all visible and iconified frames. | 2957 By default, only the windows in the selected frame are considered. |
2935 If FRAME is t, search all frames. | 2958 The optional argument WHICH-FRAMES changes this behavior: |
2936 If FRAME is nil, search only the selected frame. | 2959 If optional argument WHICH-FRAMES is `visible', search all visible frames. |
2937 If FRAME is a frame, search only that frame. | 2960 If WHICH-FRAMES is 0, search all visible and iconified frames. |
2938 | 2961 If WHICH-FRAMES is t, search all frames. |
2939 Optional third argument CONSOLE controls which consoles or devices the | 2962 If WHICH-FRAMES is nil, search only the selected frame. |
2940 returned window may be on. If CONSOLE is a console, return windows only | 2963 If WHICH-FRAMES is a frame, search only that frame. |
2941 on that console. If CONSOLE is a device, return windows only on that | 2964 |
2942 device. If CONSOLE is a console type, return windows only on consoles | 2965 The optional argument WHICH-DEVICES further clarifies on which devices |
2943 of that type. If CONSOLE is 'window-system, return any windows on any | 2966 to search for frames as specified by WHICH-FRAMES. This value is only |
2944 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2967 meaningful if WHICH-FRAMES is non-nil. |
2945 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2968 If nil or omitted, search all devices on the selected console. |
2946 Otherwise, all windows are considered. | 2969 If a device, only search that device. |
2947 */ | 2970 If a console, search all devices on that console. |
2948 (buffer, frame, console)) | 2971 If a device type, search all devices of that type. |
2972 If `window-system', search all devices on window-system consoles. | |
2973 Any other non-nil value means search all devices. | |
2974 */ | |
2975 (buffer, which_frames, which_devices)) | |
2949 { | 2976 { |
2950 buffer = Fget_buffer (buffer); | 2977 buffer = Fget_buffer (buffer); |
2951 if (BUFFERP (buffer)) | 2978 if (BUFFERP (buffer)) |
2952 /* Search dedicated windows too. (Doesn't matter here anyway.) */ | 2979 /* Search dedicated windows too. (Doesn't matter here anyway.) */ |
2953 return window_loop (GET_BUFFER_WINDOW, buffer, 1, frame, 1, console); | 2980 return window_loop (GET_BUFFER_WINDOW, buffer, 1, |
2981 which_frames, 1, which_devices); | |
2954 else | 2982 else |
2955 return Qnil; | 2983 return Qnil; |
2956 } | 2984 } |
2957 | 2985 |
2958 /* These functions used to be `buffer-left-margin-pixel-width', etc. | 2986 /* These functions used to be `buffer-left-margin-pixel-width', etc. |
3031 } | 3059 } |
3032 | 3060 |
3033 DEFUN ("delete-windows-on", Fdelete_windows_on, 1, 3, | 3061 DEFUN ("delete-windows-on", Fdelete_windows_on, 1, 3, |
3034 "bDelete windows on (buffer): ", /* | 3062 "bDelete windows on (buffer): ", /* |
3035 Delete all windows showing BUFFER. | 3063 Delete all windows showing BUFFER. |
3036 Optional second argument FRAME controls which frames are affected. | 3064 |
3065 Optional second argument WHICH-FRAMES controls which frames are affected. | |
3037 If nil or omitted, delete all windows showing BUFFER in any frame. | 3066 If nil or omitted, delete all windows showing BUFFER in any frame. |
3038 If t, delete only windows showing BUFFER in the selected frame. | 3067 If t, delete only windows showing BUFFER in the selected frame. |
3039 If `visible', delete all windows showing BUFFER in any visible frame. | 3068 If `visible', delete all windows showing BUFFER in any visible frame. |
3040 If a frame, delete only windows showing BUFFER in that frame. | 3069 If a frame, delete only windows showing BUFFER in that frame. |
3041 | 3070 Warning: WHICH-FRAMES has the same meaning as with `next-window', |
3042 Optional third argument CONSOLE controls which consoles or devices the | 3071 except that the meanings of nil and t are reversed. |
3043 returned window may be on. If CONSOLE is a console, return windows only | 3072 |
3044 on that console. If CONSOLE is a device, return windows only on that | 3073 The optional third argument WHICH-DEVICES further clarifies on which |
3045 device. If CONSOLE is a console type, return windows only on consoles | 3074 devices to search for frames as specified by WHICH-FRAMES. This value |
3046 of that type. If CONSOLE is 'window-system, return any windows on any | 3075 is only meaningful if WHICH-FRAMES is not t. |
3047 window-system consoles. If CONSOLE is nil or omitted, return windows only | 3076 If nil or omitted, search only the selected console. |
3048 on FRAME'S console, or on the selected console if FRAME is not a frame. | 3077 If a device, only search that device. |
3049 Otherwise, all windows are considered. | 3078 If a console, search all devices on that console. |
3050 */ | 3079 If a device type, search all devices of that type. |
3051 (buffer, frame, console)) | 3080 If `window-system', search all devices on a window system. |
3081 Any other non-nil value means search all devices. | |
3082 */ | |
3083 (buffer, which_frames, which_devices)) | |
3052 { | 3084 { |
3053 /* This function can GC */ | 3085 /* This function can GC */ |
3054 /* FRAME uses t and nil to mean the opposite of what window_loop | 3086 buffer = Fget_buffer (buffer); |
3055 expects. */ | 3087 CHECK_BUFFER (buffer); |
3056 if (!FRAMEP (frame)) | 3088 |
3057 frame = NILP (frame) ? Qt : Qnil; | 3089 /* WHICH-FRAMES values t and nil mean the opposite of what |
3058 | 3090 window_loop expects. */ |
3059 if (!NILP (buffer)) | 3091 if (EQ (which_frames, Qnil)) |
3060 { | 3092 which_frames = Qt; |
3061 buffer = Fget_buffer (buffer); | 3093 else if (EQ (which_frames, Qt)) |
3062 CHECK_BUFFER (buffer); | 3094 which_frames = Qnil; |
3063 /* Ignore dedicated windows. */ | 3095 |
3064 window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, frame, 0, console); | 3096 /* Ignore dedicated windows. */ |
3065 } | 3097 window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, |
3098 which_frames, 0, which_devices); | |
3066 return Qnil; | 3099 return Qnil; |
3067 } | 3100 } |
3068 | 3101 |
3069 DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, 1, 1, | 3102 DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, 1, 3, |
3070 "bReplace buffer in windows: ", /* | 3103 "bReplace buffer in windows: ", /* |
3071 Replace BUFFER with some other buffer in all windows showing it. | 3104 Replace BUFFER with some other buffer in all windows showing it. |
3072 */ | 3105 |
3073 (buffer)) | 3106 Optional second argument WHICH-FRAMES controls which frames are affected. |
3107 If nil or omitted, all frames are affected. | |
3108 If t, only the selected frame is affected. | |
3109 If `visible', all visible frames are affected. | |
3110 If a frame, only that frame is affected. | |
3111 Warning: WHICH-FRAMES has the same meaning as with `next-window', | |
3112 except that the meanings of nil and t are reversed. | |
3113 | |
3114 The optional third argument WHICH-DEVICES further clarifies on which | |
3115 devices to search for frames as specified by WHICH-FRAMES. This value | |
3116 is only meaningful if WHICH-FRAMES is not t. | |
3117 If nil or omitted, search only the selected console. | |
3118 If a device, only search that device. | |
3119 If a console, search all devices on that console. | |
3120 If a device type, search all devices of that type. | |
3121 If `window-system', search all devices on a window system. | |
3122 Any other non-nil value means search all devices. | |
3123 */ | |
3124 (buffer, which_frames, which_devices)) | |
3074 { | 3125 { |
3075 /* This function can GC */ | 3126 /* This function can GC */ |
3076 if (!NILP (buffer)) | 3127 buffer = Fget_buffer (buffer); |
3077 { | 3128 CHECK_BUFFER (buffer); |
3078 buffer = Fget_buffer (buffer); | 3129 |
3079 CHECK_BUFFER (buffer); | 3130 /* WHICH-FRAMES values t and nil mean the opposite of what |
3080 /* Ignore dedicated windows. */ | 3131 window_loop expects. */ |
3081 window_loop (UNSHOW_BUFFER, buffer, 0, Qt, 0, Qnil); | 3132 if (EQ (which_frames, Qnil)) |
3082 } | 3133 which_frames = Qt; |
3134 else if (EQ (which_frames, Qt)) | |
3135 which_frames = Qnil; | |
3136 | |
3137 /* Ignore dedicated windows. */ | |
3138 window_loop (UNSHOW_BUFFER, buffer, 0, which_frames, 0, which_devices); | |
3083 return Qnil; | 3139 return Qnil; |
3084 } | 3140 } |
3085 | 3141 |
3086 /* The smallest acceptable dimensions for a window. Anything smaller | 3142 /* The smallest acceptable dimensions for a window. Anything smaller |
3087 might crash Emacs. */ | 3143 might crash Emacs. */ |
3528 p->buffer = Qnil; | 3584 p->buffer = Qnil; |
3529 } | 3585 } |
3530 | 3586 |
3531 DEFUN ("split-window", Fsplit_window, 0, 3, "", /* | 3587 DEFUN ("split-window", Fsplit_window, 0, 3, "", /* |
3532 Split WINDOW, putting SIZE lines in the first of the pair. | 3588 Split WINDOW, putting SIZE lines in the first of the pair. |
3533 WINDOW defaults to selected one and SIZE to half its size. | 3589 WINDOW defaults to the selected one and SIZE to half its size. |
3534 If optional third arg HORFLAG is non-nil, split side by side | 3590 If optional third arg HORFLAG is non-nil, split side by side |
3535 and put SIZE columns in the first of the pair. | 3591 and put SIZE columns in the first of the pair. |
3536 */ | 3592 */ |
3537 (window, chsize, horflag)) | 3593 (window, size, horflag)) |
3538 { | 3594 { |
3539 Lisp_Object new; | 3595 Lisp_Object new; |
3540 struct window *o, *p; | 3596 struct window *o, *p; |
3541 struct frame *f; | 3597 struct frame *f; |
3542 int size; | 3598 int csize; |
3543 int psize; | 3599 int psize; |
3544 | 3600 |
3545 if (NILP (window)) | 3601 if (NILP (window)) |
3546 window = Fselected_window (Qnil); | 3602 window = Fselected_window (Qnil); |
3547 else | 3603 else |
3548 CHECK_LIVE_WINDOW (window); | 3604 CHECK_LIVE_WINDOW (window); |
3549 | 3605 |
3550 o = XWINDOW (window); | 3606 o = XWINDOW (window); |
3551 f = XFRAME (WINDOW_FRAME (o)); | 3607 f = XFRAME (WINDOW_FRAME (o)); |
3552 | 3608 |
3553 if (NILP (chsize)) | 3609 if (NILP (size)) |
3554 { | 3610 { |
3555 if (!NILP (horflag)) | 3611 if (!NILP (horflag)) |
3556 /* In the new scheme, we are symmetric with respect to separators | 3612 /* In the new scheme, we are symmetric with respect to separators |
3557 so there is no need to do weird things here. */ | 3613 so there is no need to do weird things here. */ |
3558 { | 3614 { |
3559 psize = WINDOW_WIDTH (o) >> 1; | 3615 psize = WINDOW_WIDTH (o) >> 1; |
3560 size = window_pixel_width_to_char_width (o, psize, 0); | 3616 csize = window_pixel_width_to_char_width (o, psize, 0); |
3561 } | 3617 } |
3562 else | 3618 else |
3563 { | 3619 { |
3564 psize = WINDOW_HEIGHT (o) >> 1; | 3620 psize = WINDOW_HEIGHT (o) >> 1; |
3565 size = window_pixel_height_to_char_height (o, psize, 1); | 3621 csize = window_pixel_height_to_char_height (o, psize, 1); |
3566 } | 3622 } |
3567 } | 3623 } |
3568 else | 3624 else |
3569 { | 3625 { |
3570 CHECK_INT (chsize); | 3626 CHECK_INT (size); |
3571 size = XINT (chsize); | 3627 csize = XINT (size); |
3572 if (!NILP (horflag)) | 3628 if (!NILP (horflag)) |
3573 psize = window_char_width_to_pixel_width (o, size, 0); | 3629 psize = window_char_width_to_pixel_width (o, csize, 0); |
3574 else | 3630 else |
3575 psize = window_char_height_to_pixel_height (o, size, 1); | 3631 psize = window_char_height_to_pixel_height (o, csize, 1); |
3576 } | 3632 } |
3577 | 3633 |
3578 if (MINI_WINDOW_P (o)) | 3634 if (MINI_WINDOW_P (o)) |
3579 error ("Attempt to split minibuffer window"); | 3635 error ("Attempt to split minibuffer window"); |
3580 else if (FRAME_NO_SPLIT_P (XFRAME (WINDOW_FRAME (o)))) | 3636 else if (FRAME_NO_SPLIT_P (XFRAME (WINDOW_FRAME (o)))) |
3582 | 3638 |
3583 check_min_window_sizes (); | 3639 check_min_window_sizes (); |
3584 | 3640 |
3585 if (NILP (horflag)) | 3641 if (NILP (horflag)) |
3586 { | 3642 { |
3587 if (size < window_min_height) | 3643 if (csize < window_min_height) |
3588 error ("Window height %d too small (after splitting)", size); | 3644 error ("Window height %d too small (after splitting)", csize); |
3589 if (size + window_min_height > window_char_height (o, 1)) | 3645 if (csize + window_min_height > window_char_height (o, 1)) |
3590 error ("Window height %d too small (after splitting)", | 3646 error ("Window height %d too small (after splitting)", |
3591 window_char_height (o, 1) - size); | 3647 window_char_height (o, 1) - csize); |
3592 if (NILP (o->parent) | 3648 if (NILP (o->parent) |
3593 || NILP (XWINDOW (o->parent)->vchild)) | 3649 || NILP (XWINDOW (o->parent)->vchild)) |
3594 { | 3650 { |
3595 make_dummy_parent (window); | 3651 make_dummy_parent (window); |
3596 reset_face_cachels (XWINDOW (window)); | 3652 reset_face_cachels (XWINDOW (window)); |
3599 XFRAME (o->frame)->mirror_dirty = 1; | 3655 XFRAME (o->frame)->mirror_dirty = 1; |
3600 } | 3656 } |
3601 } | 3657 } |
3602 else | 3658 else |
3603 { | 3659 { |
3604 if (size < window_min_width) | 3660 if (csize < window_min_width) |
3605 error ("Window width %d too small (after splitting)", size); | 3661 error ("Window width %d too small (after splitting)", csize); |
3606 if (size + window_min_width > window_char_width (o, 0)) | 3662 if (csize + window_min_width > window_char_width (o, 0)) |
3607 error ("Window width %d too small (after splitting)", | 3663 error ("Window width %d too small (after splitting)", |
3608 window_char_width (o, 0) - size); | 3664 window_char_width (o, 0) - csize); |
3609 if (NILP (o->parent) | 3665 if (NILP (o->parent) |
3610 || NILP (XWINDOW (o->parent)->hchild)) | 3666 || NILP (XWINDOW (o->parent)->hchild)) |
3611 { | 3667 { |
3612 make_dummy_parent (window); | 3668 make_dummy_parent (window); |
3613 reset_face_cachels (XWINDOW (window)); | 3669 reset_face_cachels (XWINDOW (window)); |
3665 return new; | 3721 return new; |
3666 } | 3722 } |
3667 | 3723 |
3668 | 3724 |
3669 DEFUN ("enlarge-window", Fenlarge_window, 1, 3, "_p", /* | 3725 DEFUN ("enlarge-window", Fenlarge_window, 1, 3, "_p", /* |
3670 Make the selected window N lines bigger. | 3726 Make the selected window COUNT lines taller. |
3671 From program, optional second arg SIDE non-nil means grow sideways N columns, | 3727 From program, optional second arg HORIZONTALP non-nil means grow |
3672 and optional third arg WINDOW specifies the window to change instead of the | 3728 sideways COUNT columns, and optional third arg WINDOW specifies the |
3673 selected window. | 3729 window to change instead of the selected window. |
3674 */ | 3730 */ |
3675 (n, side, window)) | 3731 (count, horizontalp, window)) |
3676 { | 3732 { |
3677 struct window *w = decode_window (window); | 3733 CHECK_INT (count); |
3678 CHECK_INT (n); | 3734 change_window_height (window, XINT (count), horizontalp, /* inpixels */ 0); |
3679 change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 0); | |
3680 return Qnil; | 3735 return Qnil; |
3681 } | 3736 } |
3682 | 3737 |
3683 DEFUN ("enlarge-window-pixels", Fenlarge_window_pixels, 1, 3, "_p", /* | 3738 DEFUN ("enlarge-window-pixels", Fenlarge_window_pixels, 1, 3, "_p", /* |
3684 Make the selected window N pixels bigger. | 3739 Make the selected window COUNT pixels taller. |
3685 From program, optional second arg SIDE non-nil means grow sideways N pixels, | 3740 From program, optional second arg HORIZONTALP non-nil means grow |
3686 and optional third arg WINDOW specifies the window to change instead of the | 3741 sideways COUNT pixels, and optional third arg WINDOW specifies the |
3687 selected window. | 3742 window to change instead of the selected window. |
3688 */ | 3743 */ |
3689 (n, side, window)) | 3744 (count, horizontalp, window)) |
3690 { | 3745 { |
3691 struct window *w = decode_window (window); | 3746 CHECK_INT (count); |
3692 CHECK_INT (n); | 3747 change_window_height (window, XINT (count), horizontalp, /* inpixels */ 1); |
3693 change_window_height (w, XINT (n), !NILP (side), /* inpixels */ 1); | |
3694 return Qnil; | 3748 return Qnil; |
3695 } | 3749 } |
3696 | 3750 |
3697 DEFUN ("shrink-window", Fshrink_window, 1, 3, "_p", /* | 3751 DEFUN ("shrink-window", Fshrink_window, 1, 3, "_p", /* |
3698 Make the selected window N lines smaller. | 3752 Make the selected window COUNT lines shorter. |
3699 From program, optional second arg SIDE non-nil means shrink sideways N columns, | 3753 From program, optional second arg HORIZONTALP non-nil means shrink |
3700 and optional third arg WINDOW specifies the window to change instead of the | 3754 sideways COUNT columns, and optional third arg WINDOW specifies the |
3701 selected window. | 3755 window to change instead of the selected window. |
3702 */ | 3756 */ |
3703 (n, side, window)) | 3757 (count, horizontalp, window)) |
3704 { | 3758 { |
3705 CHECK_INT (n); | 3759 CHECK_INT (count); |
3706 change_window_height (decode_window (window), -XINT (n), !NILP (side), | 3760 change_window_height (window, -XINT (count), horizontalp, /* inpixels */ 0); |
3707 /* inpixels */ 0); | |
3708 return Qnil; | 3761 return Qnil; |
3709 } | 3762 } |
3710 | 3763 |
3711 DEFUN ("shrink-window-pixels", Fshrink_window_pixels, 1, 3, "_p", /* | 3764 DEFUN ("shrink-window-pixels", Fshrink_window_pixels, 1, 3, "_p", /* |
3712 Make the selected window N pixels smaller. | 3765 Make the selected window COUNT pixels smaller. |
3713 From program, optional second arg SIDE non-nil means shrink sideways N pixels, | 3766 From program, optional second arg HORIZONTALP non-nil means shrink |
3714 and optional third arg WINDOW specifies the window to change instead of the | 3767 sideways COUNT pixels, and optional third arg WINDOW specifies the |
3715 selected window. | 3768 window to change instead of the selected window. |
3716 */ | 3769 */ |
3717 (n, side, window)) | 3770 (count, horizontalp, window)) |
3718 { | 3771 { |
3719 CHECK_INT (n); | 3772 CHECK_INT (count); |
3720 change_window_height (decode_window (window), -XINT (n), !NILP (side), | 3773 change_window_height (window, -XINT (count), horizontalp, /* inpixels */ 1); |
3721 /* inpixels */ 1); | |
3722 return Qnil; | 3774 return Qnil; |
3723 } | 3775 } |
3724 | 3776 |
3725 static int | 3777 static int |
3726 window_pixel_height_to_char_height (struct window *w, int pixel_height, | 3778 window_pixel_height_to_char_height (struct window *w, int pixel_height, |
3961 /* Unlike set_window_pixheight, this function | 4013 /* Unlike set_window_pixheight, this function |
3962 also changes the heights of the siblings so as to | 4014 also changes the heights of the siblings so as to |
3963 keep everything consistent. */ | 4015 keep everything consistent. */ |
3964 | 4016 |
3965 static void | 4017 static void |
3966 change_window_height (struct window *win, int delta, int widthflag, | 4018 change_window_height (Lisp_Object window, int delta, Lisp_Object horizontalp, |
3967 int inpixels) | 4019 int inpixels) |
3968 { | 4020 { |
4021 struct window *win = decode_window (window); | |
4022 int widthflag = !NILP (horizontalp); | |
3969 Lisp_Object parent; | 4023 Lisp_Object parent; |
3970 Lisp_Object window; | |
3971 struct window *w; | 4024 struct window *w; |
3972 struct frame *f; | 4025 struct frame *f; |
3973 int *sizep; | 4026 int *sizep; |
3974 int (*sizefun) (Lisp_Object) = (widthflag | 4027 int (*sizefun) (Lisp_Object) = (widthflag |
3975 ? window_pixel_width | 4028 ? window_pixel_width |
4117 #undef CURCHARSIZE | 4170 #undef CURCHARSIZE |
4118 #undef MINCHARSIZE | 4171 #undef MINCHARSIZE |
4119 | 4172 |
4120 | 4173 |
4121 | 4174 |
4122 /* Scroll contents of window WINDOW up N lines. If N < (top line height / | 4175 /* Scroll contents of window WINDOW up COUNT lines. |
4123 average line height) then we just adjust the top clip. */ | 4176 If COUNT < (top line height / average line height) then we just adjust |
4177 the top clip. */ | |
4124 void | 4178 void |
4125 window_scroll (Lisp_Object window, Lisp_Object n, int direction, | 4179 window_scroll (Lisp_Object window, Lisp_Object count, int direction, |
4126 Error_behavior errb) | 4180 Error_behavior errb) |
4127 { | 4181 { |
4128 struct window *w = XWINDOW (window); | 4182 struct window *w = XWINDOW (window); |
4129 struct buffer *b = XBUFFER (w->buffer); | 4183 struct buffer *b = XBUFFER (w->buffer); |
4130 int selected = EQ (window, Fselected_window (Qnil)); | 4184 int selected = EQ (window, Fselected_window (Qnil)); |
4164 w->start_at_line_beg = beginning_of_line_p (b, XINT (point)); | 4218 w->start_at_line_beg = beginning_of_line_p (b, XINT (point)); |
4165 WINDOW_TEXT_TOP_CLIP (w) = 0; | 4219 WINDOW_TEXT_TOP_CLIP (w) = 0; |
4166 MARK_WINDOWS_CHANGED (w); | 4220 MARK_WINDOWS_CHANGED (w); |
4167 } | 4221 } |
4168 | 4222 |
4169 if (!NILP (n)) | 4223 if (!NILP (count)) |
4170 { | 4224 { |
4171 if (EQ (n, Qminus)) | 4225 if (EQ (count, Qminus)) |
4172 direction *= -1; | 4226 direction *= -1; |
4173 else | 4227 else |
4174 { | 4228 { |
4175 n = Fprefix_numeric_value (n); | 4229 count = Fprefix_numeric_value (count); |
4176 value = XINT (n) * direction; | 4230 value = XINT (count) * direction; |
4177 | 4231 |
4178 if (!value) | 4232 if (!value) |
4179 return; /* someone just made a pointless call */ | 4233 return; /* someone just made a pointless call */ |
4180 } | 4234 } |
4181 } | 4235 } |
4182 | 4236 |
4183 /* If the user didn't specify how far to scroll then we have to figure it | 4237 /* If the user didn't specify how far to scroll then we have to figure it |
4184 out by ourselves. */ | 4238 out by ourselves. */ |
4185 if (NILP (n) || EQ (n, Qminus)) | 4239 if (NILP (count) || EQ (count, Qminus)) |
4186 { | 4240 { |
4187 /* Going forwards is easy. If that is what we are doing then just | 4241 /* Going forwards is easy. If that is what we are doing then just |
4188 set value and the section which handles the user specifying a | 4242 set value and the section which handles the user specifying a |
4189 positive value will work. */ | 4243 positive value will work. */ |
4190 if (direction == 1) | 4244 if (direction == 1) |
4402 } | 4456 } |
4403 } | 4457 } |
4404 } | 4458 } |
4405 | 4459 |
4406 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /* | 4460 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /* |
4407 Scroll text of current window upward N lines; or near full screen if no arg. | 4461 Scroll text of current window up COUNT lines; or near full screen if no arg. |
4408 A near full screen is `next-screen-context-lines' less than a full screen. | 4462 A near full screen is `next-screen-context-lines' less than a full screen. |
4409 Negative N means scroll downward. | 4463 Negative COUNT means scroll downward. |
4410 When calling from a program, supply an integer as argument or nil. | 4464 When calling from a program, supply an integer as argument or nil. |
4411 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. | 4465 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. |
4412 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is | 4466 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is |
4413 signaled. | 4467 signaled. |
4414 */ | 4468 */ |
4415 (n)) | 4469 (count)) |
4416 { | 4470 { |
4417 window_scroll (Fselected_window (Qnil), n, 1, ERROR_ME); | 4471 window_scroll (Fselected_window (Qnil), count, 1, ERROR_ME); |
4418 return Qnil; | 4472 return Qnil; |
4419 } | 4473 } |
4420 | 4474 |
4421 DEFUN ("scroll-down", Fscroll_down, 0, 1, "_P", /* | 4475 DEFUN ("scroll-down", Fscroll_down, 0, 1, "_P", /* |
4422 Scroll text of current window downward N lines; or near full screen if no arg. | 4476 Scroll text of current window down COUNT lines; or near full screen if no arg. |
4423 A near full screen is `next-screen-context-lines' less than a full screen. | 4477 A near full screen is `next-screen-context-lines' less than a full screen. |
4424 Negative N means scroll upward. | 4478 Negative COUNT means scroll upward. |
4425 When calling from a program, supply a number as argument or nil. | 4479 When calling from a program, supply a number as argument or nil. |
4426 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. | 4480 On attempt to scroll past end of buffer, `end-of-buffer' is signaled. |
4427 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is | 4481 On attempt to scroll past beginning of buffer, `beginning-of-buffer' is |
4428 signaled. | 4482 signaled. |
4429 */ | 4483 */ |
4430 (n)) | 4484 (count)) |
4431 { | 4485 { |
4432 window_scroll (Fselected_window (Qnil), n, -1, ERROR_ME); | 4486 window_scroll (Fselected_window (Qnil), count, -1, ERROR_ME); |
4433 return Qnil; | 4487 return Qnil; |
4434 } | 4488 } |
4435 | 4489 |
4436 DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, 0, 0, 0, /* | 4490 DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, 0, 0, 0, /* |
4437 Return the other window for "other window scroll" commands. | 4491 Return the other window for "other window scroll" commands. |
4477 | 4531 |
4478 return window; | 4532 return window; |
4479 } | 4533 } |
4480 | 4534 |
4481 DEFUN ("scroll-other-window", Fscroll_other_window, 0, 1, "_P", /* | 4535 DEFUN ("scroll-other-window", Fscroll_other_window, 0, 1, "_P", /* |
4482 Scroll next window upward N lines; or near full frame if no arg. | 4536 Scroll next window upward COUNT lines; or near full frame if no arg. |
4483 The next window is the one below the current one; or the one at the top | 4537 The next window is the one below the current one; or the one at the top |
4484 if the current one is at the bottom. Negative N means scroll downward. | 4538 if the current one is at the bottom. Negative COUNT means scroll downward. |
4485 When calling from a program, supply a number as argument or nil. | 4539 When calling from a program, supply a number as argument or nil. |
4486 | 4540 |
4487 If in the minibuffer, `minibuffer-scroll-window' if non-nil | 4541 If in the minibuffer, `minibuffer-scroll-window' if non-nil |
4488 specifies the window to scroll. | 4542 specifies the window to scroll. |
4489 If `other-window-scroll-buffer' is non-nil, scroll the window | 4543 If `other-window-scroll-buffer' is non-nil, scroll the window |
4490 showing that buffer, popping the buffer up if necessary. | 4544 showing that buffer, popping the buffer up if necessary. |
4491 */ | 4545 */ |
4492 (n)) | 4546 (count)) |
4493 { | 4547 { |
4494 window_scroll (Fother_window_for_scrolling (), n, 1, ERROR_ME); | 4548 window_scroll (Fother_window_for_scrolling (), count, 1, ERROR_ME); |
4495 return Qnil; | 4549 return Qnil; |
4496 } | 4550 } |
4497 | 4551 |
4498 DEFUN ("scroll-left", Fscroll_left, 0, 1, "_P", /* | 4552 DEFUN ("scroll-left", Fscroll_left, 0, 1, "_P", /* |
4499 Scroll selected window display N columns left. | 4553 Scroll selected window display COUNT columns left. |
4500 Default for N is window width minus 2. | 4554 Default for COUNT is window width minus 2. |
4501 */ | 4555 */ |
4502 (n)) | 4556 (count)) |
4503 { | 4557 { |
4504 Lisp_Object window = Fselected_window (Qnil); | 4558 Lisp_Object window = Fselected_window (Qnil); |
4505 struct window *w = XWINDOW (window); | 4559 struct window *w = XWINDOW (window); |
4506 int count = (NILP (n) ? | 4560 int n = (NILP (count) ? |
4507 window_char_width (w, 0) - 2 : | 4561 window_char_width (w, 0) - 2 : |
4508 XINT (Fprefix_numeric_value (n))); | 4562 XINT (Fprefix_numeric_value (count))); |
4509 | 4563 |
4510 return Fset_window_hscroll (window, make_int (w->hscroll + count)); | 4564 return Fset_window_hscroll (window, make_int (w->hscroll + n)); |
4511 } | 4565 } |
4512 | 4566 |
4513 DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /* | 4567 DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /* |
4514 Scroll selected window display N columns right. | 4568 Scroll selected window display COUNT columns right. |
4515 Default for N is window width minus 2. | 4569 Default for COUNT is window width minus 2. |
4516 */ | 4570 */ |
4517 (n)) | 4571 (count)) |
4518 { | 4572 { |
4519 Lisp_Object window = Fselected_window (Qnil); | 4573 Lisp_Object window = Fselected_window (Qnil); |
4520 struct window *w = XWINDOW (window); | 4574 struct window *w = XWINDOW (window); |
4521 int count = (NILP (n) ? | 4575 int n = (NILP (count) ? |
4522 window_char_width (w, 0) - 2 : | 4576 window_char_width (w, 0) - 2 : |
4523 XINT (Fprefix_numeric_value (n))); | 4577 XINT (Fprefix_numeric_value (count))); |
4524 | 4578 |
4525 return Fset_window_hscroll (window, make_int (w->hscroll - count)); | 4579 return Fset_window_hscroll (window, make_int (w->hscroll - n)); |
4526 } | 4580 } |
4527 | 4581 |
4528 DEFUN ("center-to-window-line", Fcenter_to_window_line, 0, 2, "_P", /* | 4582 DEFUN ("center-to-window-line", Fcenter_to_window_line, 0, 2, "_P", /* |
4529 Center point in WINDOW. With N, put point on line N. | 4583 Center point in WINDOW. With N, put point on line N. |
4530 The desired position of point is always relative to the window. | 4584 The desired position of point is always relative to the window. |
5048 } | 5102 } |
5049 | 5103 |
5050 DEFUN ("window-configuration-p", Fwindow_configuration_p, 1, 1, 0, /* | 5104 DEFUN ("window-configuration-p", Fwindow_configuration_p, 1, 1, 0, /* |
5051 Return t if OBJECT is a window-configuration object. | 5105 Return t if OBJECT is a window-configuration object. |
5052 */ | 5106 */ |
5053 (obj)) | 5107 (object)) |
5054 { | 5108 { |
5055 return WINDOW_CONFIGURATIONP (obj) ? Qt : Qnil; | 5109 return WINDOW_CONFIGURATIONP (object) ? Qt : Qnil; |
5056 } | 5110 } |
5057 | 5111 |
5058 static int | 5112 static int |
5059 mark_windows_in_use_closure (struct window *w, void *closure) | 5113 mark_windows_in_use_closure (struct window *w, void *closure) |
5060 { | 5114 { |
5727 | 5781 |
5728 DEFUN ("current-window-configuration", Fcurrent_window_configuration, 0, 1, 0, /* | 5782 DEFUN ("current-window-configuration", Fcurrent_window_configuration, 0, 1, 0, /* |
5729 Return an object representing the current window configuration of FRAME. | 5783 Return an object representing the current window configuration of FRAME. |
5730 If FRAME is nil or omitted, use the selected frame. | 5784 If FRAME is nil or omitted, use the selected frame. |
5731 This describes the number of windows, their sizes and current buffers, | 5785 This describes the number of windows, their sizes and current buffers, |
5732 and for each displayed buffer, where display starts, and the positions of | 5786 and for each window on FRAME the displayed buffer, where display |
5733 point and mark. An exception is made for point in the current buffer: | 5787 starts, and the positions of point and mark. |
5788 An exception is made for point in the current buffer: | |
5734 its value is -not- saved. | 5789 its value is -not- saved. |
5735 */ | 5790 */ |
5736 (frame)) | 5791 (frame)) |
5737 { | 5792 { |
5738 Lisp_Object result; | 5793 Lisp_Object result; |
6134 Fadd_spec_to_specifier (Vmodeline_shadow_thickness, make_int (2), | 6189 Fadd_spec_to_specifier (Vmodeline_shadow_thickness, make_int (2), |
6135 Qnil, Qnil, Qnil); | 6190 Qnil, Qnil, Qnil); |
6136 set_specifier_caching (Vmodeline_shadow_thickness, | 6191 set_specifier_caching (Vmodeline_shadow_thickness, |
6137 offsetof (struct window, modeline_shadow_thickness), | 6192 offsetof (struct window, modeline_shadow_thickness), |
6138 modeline_shadow_thickness_changed, | 6193 modeline_shadow_thickness_changed, |
6139 0, 0); | 6194 0, 0, 0); |
6140 | 6195 |
6141 DEFVAR_SPECIFIER ("has-modeline-p", &Vhas_modeline_p /* | 6196 DEFVAR_SPECIFIER ("has-modeline-p", &Vhas_modeline_p /* |
6142 *Whether the modeline should be displayed. | 6197 *Whether the modeline should be displayed. |
6143 This is a specifier; use `set-specifier' to change it. | 6198 This is a specifier; use `set-specifier' to change it. |
6144 */ ); | 6199 */ ); |
6150 /* #### It's strange that we need a special | 6205 /* #### It's strange that we need a special |
6151 flag to indicate that the shadow-thickness | 6206 flag to indicate that the shadow-thickness |
6152 has changed, but not one to indicate that | 6207 has changed, but not one to indicate that |
6153 the modeline has been turned off or on. */ | 6208 the modeline has been turned off or on. */ |
6154 some_window_value_changed, | 6209 some_window_value_changed, |
6155 0, 0); | 6210 0, 0, 0); |
6156 | 6211 |
6157 DEFVAR_SPECIFIER ("vertical-divider-always-visible-p", | 6212 DEFVAR_SPECIFIER ("vertical-divider-always-visible-p", |
6158 &Vvertical_divider_always_visible_p /* | 6213 &Vvertical_divider_always_visible_p /* |
6159 *Should XEmacs always display vertical dividers between windows. | 6214 *Should XEmacs always display vertical dividers between windows. |
6160 | 6215 |
6169 list1 (Fcons (Qnil, Qt))); | 6224 list1 (Fcons (Qnil, Qt))); |
6170 set_specifier_caching (Vvertical_divider_always_visible_p, | 6225 set_specifier_caching (Vvertical_divider_always_visible_p, |
6171 offsetof (struct window, | 6226 offsetof (struct window, |
6172 vertical_divider_always_visible_p), | 6227 vertical_divider_always_visible_p), |
6173 vertical_divider_changed_in_window, | 6228 vertical_divider_changed_in_window, |
6174 0, 0); | 6229 0, 0, 0); |
6175 | 6230 |
6176 DEFVAR_SPECIFIER ("vertical-divider-shadow-thickness", &Vvertical_divider_shadow_thickness /* | 6231 DEFVAR_SPECIFIER ("vertical-divider-shadow-thickness", &Vvertical_divider_shadow_thickness /* |
6177 *How thick to draw 3D shadows around vertical dividers. | 6232 *How thick to draw 3D shadows around vertical dividers. |
6178 This is a specifier; use `set-specifier' to change it. | 6233 This is a specifier; use `set-specifier' to change it. |
6179 */ ); | 6234 */ ); |
6184 Qnil, Qnil, Qnil); | 6239 Qnil, Qnil, Qnil); |
6185 set_specifier_caching (Vvertical_divider_shadow_thickness, | 6240 set_specifier_caching (Vvertical_divider_shadow_thickness, |
6186 offsetof (struct window, | 6241 offsetof (struct window, |
6187 vertical_divider_shadow_thickness), | 6242 vertical_divider_shadow_thickness), |
6188 vertical_divider_changed_in_window, | 6243 vertical_divider_changed_in_window, |
6189 0, 0); | 6244 0, 0, 0); |
6190 DEFVAR_SPECIFIER ("vertical-divider-line-width", &Vvertical_divider_line_width /* | 6245 DEFVAR_SPECIFIER ("vertical-divider-line-width", &Vvertical_divider_line_width /* |
6191 *The width of the vertical dividers, not including shadows. | 6246 *The width of the vertical dividers, not including shadows. |
6192 | 6247 |
6193 For TTY windows, divider line is always one character wide. When | 6248 For TTY windows, divider line is always one character wide. When |
6194 instance of this specifier is zero in a TTY window, no divider is | 6249 instance of this specifier is zero in a TTY window, no divider is |
6215 } | 6270 } |
6216 set_specifier_caching (Vvertical_divider_line_width, | 6271 set_specifier_caching (Vvertical_divider_line_width, |
6217 offsetof (struct window, | 6272 offsetof (struct window, |
6218 vertical_divider_line_width), | 6273 vertical_divider_line_width), |
6219 vertical_divider_changed_in_window, | 6274 vertical_divider_changed_in_window, |
6220 0, 0); | 6275 0, 0, 0); |
6221 | 6276 |
6222 DEFVAR_SPECIFIER ("vertical-divider-spacing", &Vvertical_divider_spacing /* | 6277 DEFVAR_SPECIFIER ("vertical-divider-spacing", &Vvertical_divider_spacing /* |
6223 *How much space to leave around the vertical dividers. | 6278 *How much space to leave around the vertical dividers. |
6224 | 6279 |
6225 In TTY windows, spacing is always zero, and the value of this | 6280 In TTY windows, spacing is always zero, and the value of this |
6244 set_specifier_fallback (Vvertical_divider_spacing, fb); | 6299 set_specifier_fallback (Vvertical_divider_spacing, fb); |
6245 } | 6300 } |
6246 set_specifier_caching (Vvertical_divider_spacing, | 6301 set_specifier_caching (Vvertical_divider_spacing, |
6247 offsetof (struct window, vertical_divider_spacing), | 6302 offsetof (struct window, vertical_divider_spacing), |
6248 vertical_divider_changed_in_window, | 6303 vertical_divider_changed_in_window, |
6249 0, 0); | 6304 0, 0, 0); |
6250 } | 6305 } |