Mercurial > hg > xemacs-beta
comparison src/window.c @ 20:859a2309aef8 r19-15b93
Import from CVS: tag r19-15b93
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:50:05 +0200 |
parents | 0293115a14e9 |
children | 8fc7fe29b841 |
comparison
equal
deleted
inserted
replaced
19:ac1f612d5250 | 20:859a2309aef8 |
---|---|
1117 #endif | 1117 #endif |
1118 return window_right_toolbar_width (w); | 1118 return window_right_toolbar_width (w); |
1119 } | 1119 } |
1120 | 1120 |
1121 | 1121 |
1122 DEFUN ("windowp", Fwindowp, Swindowp, 1, 1, 0 /* | 1122 DEFUN ("windowp", Fwindowp, 1, 1, 0, /* |
1123 Return t if OBJ is a window. | 1123 Return t if OBJ is a window. |
1124 */ ) | 1124 */ |
1125 (obj) | 1125 (obj)) |
1126 Lisp_Object obj; | |
1127 { | 1126 { |
1128 return (WINDOWP (obj) ? Qt : Qnil); | 1127 return (WINDOWP (obj) ? Qt : Qnil); |
1129 } | 1128 } |
1130 | 1129 |
1131 DEFUN ("window-live-p", Fwindow_live_p, Swindow_live_p, 1, 1, 0 /* | 1130 DEFUN ("window-live-p", Fwindow_live_p, 1, 1, 0, /* |
1132 Return t if OBJ is a window which is currently visible. | 1131 Return t if OBJ is a window which is currently visible. |
1133 */ ) | 1132 */ |
1134 (obj) | 1133 (obj)) |
1135 Lisp_Object obj; | |
1136 { | 1134 { |
1137 return (WINDOWP (obj) && WINDOW_LIVE_P (XWINDOW (obj)) ? Qt : Qnil); | 1135 return (WINDOWP (obj) && WINDOW_LIVE_P (XWINDOW (obj)) ? Qt : Qnil); |
1138 } | 1136 } |
1139 | 1137 |
1140 DEFUN ("selected-window", Fselected_window, Sselected_window, 0, 1, 0 /* | 1138 DEFUN ("selected-window", Fselected_window, 0, 1, 0, /* |
1141 Return the window that the cursor now appears in and commands apply to. | 1139 Return the window that the cursor now appears in and commands apply to. |
1142 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return | 1140 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return |
1143 the selected window used by that frame. If CON-DEV-OR-FRAME is a device, | 1141 the selected window used by that frame. If CON-DEV-OR-FRAME is a device, |
1144 then the selected frame on that device will be used. If CON-DEV-OR-FRAME | 1142 then the selected frame on that device will be used. If CON-DEV-OR-FRAME |
1145 is a console, the selected frame on that console's selected device will | 1143 is a console, the selected frame on that console's selected device will |
1146 be used. Otherwise, the selected frame is used. | 1144 be used. Otherwise, the selected frame is used. |
1147 */ ) | 1145 */ |
1148 (con_dev_or_frame) | 1146 (con_dev_or_frame)) |
1149 Lisp_Object con_dev_or_frame; | |
1150 { | 1147 { |
1151 struct frame *f; | 1148 struct frame *f; |
1152 | 1149 |
1153 if (NILP (con_dev_or_frame) && NILP (Fselected_device (Qnil))) | 1150 if (NILP (con_dev_or_frame) && NILP (Fselected_device (Qnil))) |
1154 return Qnil; /* happens at startup */ | 1151 return Qnil; /* happens at startup */ |
1155 | 1152 |
1156 f = decode_frame_or_selected (con_dev_or_frame); | 1153 f = decode_frame_or_selected (con_dev_or_frame); |
1157 return FRAME_SELECTED_WINDOW (f); | 1154 return FRAME_SELECTED_WINDOW (f); |
1158 } | 1155 } |
1159 | 1156 |
1160 DEFUN ("minibuffer-window", Fminibuffer_window, Sminibuffer_window, 0, 1, 0 /* | 1157 DEFUN ("minibuffer-window", Fminibuffer_window, 0, 1, 0, /* |
1161 Return the window used now for minibuffers. | 1158 Return the window used now for minibuffers. |
1162 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return | 1159 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return |
1163 the minibuffer window used by that frame. If CON-DEV-OR-FRAME is a device, | 1160 the minibuffer window used by that frame. If CON-DEV-OR-FRAME is a device, |
1164 then the selected frame on that device will be used. If CON-DEV-OR-FRAME | 1161 then the selected frame on that device will be used. If CON-DEV-OR-FRAME |
1165 is a console, the selected frame on that console's selected device will | 1162 is a console, the selected frame on that console's selected device will |
1166 be used. Otherwise, the selected frame is used. | 1163 be used. Otherwise, the selected frame is used. |
1167 */ ) | 1164 */ |
1168 (con_dev_or_frame) | 1165 (con_dev_or_frame)) |
1169 Lisp_Object con_dev_or_frame; | |
1170 { | 1166 { |
1171 struct frame *f = decode_frame_or_selected (con_dev_or_frame); | 1167 struct frame *f = decode_frame_or_selected (con_dev_or_frame); |
1172 | 1168 |
1173 return FRAME_MINIBUF_WINDOW (f); | 1169 return FRAME_MINIBUF_WINDOW (f); |
1174 } | 1170 } |
1175 | 1171 |
1176 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, Swindow_minibuffer_p, 1, 1, 0 /* | 1172 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /* |
1177 Return non-nil if WINDOW is a minibuffer window. | 1173 Return non-nil if WINDOW is a minibuffer window. |
1178 */ ) | 1174 */ |
1179 (window) | 1175 (window)) |
1180 Lisp_Object window; | |
1181 { | 1176 { |
1182 struct window *w = decode_window (window); | 1177 struct window *w = decode_window (window); |
1183 return (MINI_WINDOW_P (w) ? Qt : Qnil); | 1178 return (MINI_WINDOW_P (w) ? Qt : Qnil); |
1184 } | 1179 } |
1185 | 1180 |
1186 DEFUN ("window-first-hchild", Fwindow_first_hchild, Swindow_first_hchild, | 1181 DEFUN ("window-first-hchild", Fwindow_first_hchild, 1, 1, 0, /* |
1187 1, 1, 0 /* | |
1188 Return the first horizontal child of WINDOW, or nil. | 1182 Return the first horizontal child of WINDOW, or nil. |
1189 */ ) | 1183 */ |
1190 (window) | 1184 (window)) |
1191 Lisp_Object window; | |
1192 { | 1185 { |
1193 struct window *w = decode_window (window); | 1186 struct window *w = decode_window (window); |
1194 return w->hchild; | 1187 return w->hchild; |
1195 } | 1188 } |
1196 | 1189 |
1197 DEFUN ("window-first-vchild", Fwindow_first_vchild, Swindow_first_vchild, | 1190 DEFUN ("window-first-vchild", Fwindow_first_vchild, 1, 1, 0, /* |
1198 1, 1, 0 /* | |
1199 Return the first vertical child of WINDOW, or nil. | 1191 Return the first vertical child of WINDOW, or nil. |
1200 */ ) | 1192 */ |
1201 (window) | 1193 (window)) |
1202 Lisp_Object window; | |
1203 { | 1194 { |
1204 struct window *w = decode_window (window); | 1195 struct window *w = decode_window (window); |
1205 return w->vchild; | 1196 return w->vchild; |
1206 } | 1197 } |
1207 | 1198 |
1208 DEFUN ("window-next-child", Fwindow_next_child, Swindow_next_child, | 1199 DEFUN ("window-next-child", Fwindow_next_child, 1, 1, 0, /* |
1209 1, 1, 0 /* | |
1210 Return the next window on the same level as WINDOW, or nil. | 1200 Return the next window on the same level as WINDOW, or nil. |
1211 */ ) | 1201 */ |
1212 (window) | 1202 (window)) |
1213 Lisp_Object window; | |
1214 { | 1203 { |
1215 struct window *w = decode_window (window); | 1204 struct window *w = decode_window (window); |
1216 return w->next; | 1205 return w->next; |
1217 } | 1206 } |
1218 | 1207 |
1219 DEFUN ("window-previous-child", Fwindow_previous_child, Swindow_previous_child, | 1208 DEFUN ("window-previous-child", Fwindow_previous_child, 1, 1, 0, /* |
1220 1, 1, 0 /* | |
1221 Return the previous window on the same level as WINDOW, or nil. | 1209 Return the previous window on the same level as WINDOW, or nil. |
1222 */ ) | 1210 */ |
1223 (window) | 1211 (window)) |
1224 Lisp_Object window; | |
1225 { | 1212 { |
1226 struct window *w = decode_window (window); | 1213 struct window *w = decode_window (window); |
1227 return w->prev; | 1214 return w->prev; |
1228 } | 1215 } |
1229 | 1216 |
1230 DEFUN ("window-parent", Fwindow_parent, Swindow_parent, | 1217 DEFUN ("window-parent", Fwindow_parent, 1, 1, 0, /* |
1231 1, 1, 0 /* | |
1232 Return the parent of WINDOW, or nil. | 1218 Return the parent of WINDOW, or nil. |
1233 */ ) | 1219 */ |
1234 (window) | 1220 (window)) |
1235 Lisp_Object window; | |
1236 { | 1221 { |
1237 struct window *w = decode_window (window); | 1222 struct window *w = decode_window (window); |
1238 return w->parent; | 1223 return w->parent; |
1239 } | 1224 } |
1240 | 1225 |
1241 DEFUN ("window-lowest-p", Fwindow_lowest_p, Swindow_lowest_p, 1, 1, 0 /* | 1226 DEFUN ("window-lowest-p", Fwindow_lowest_p, 1, 1, 0, /* |
1242 Return non-nil if WINDOW is along the bottom of its frame. | 1227 Return non-nil if WINDOW is along the bottom of its frame. |
1243 */ ) | 1228 */ |
1244 (window) | 1229 (window)) |
1245 Lisp_Object window; | |
1246 { | 1230 { |
1247 struct window *w = decode_window (window); | 1231 struct window *w = decode_window (window); |
1248 return window_is_lowest (w) ? Qt : Qnil; | 1232 return window_is_lowest (w) ? Qt : Qnil; |
1249 } | 1233 } |
1250 | 1234 |
1251 DEFUN ("window-highest-p", Fwindow_highest_p, Swindow_highest_p, 1, 1, 0 /* | 1235 DEFUN ("window-highest-p", Fwindow_highest_p, 1, 1, 0, /* |
1252 Return non-nil if WINDOW is along the top of its frame. | 1236 Return non-nil if WINDOW is along the top of its frame. |
1253 */ ) | 1237 */ |
1254 (window) | 1238 (window)) |
1255 Lisp_Object window; | |
1256 { | 1239 { |
1257 struct window *w = decode_window (window); | 1240 struct window *w = decode_window (window); |
1258 return window_is_highest (w) ? Qt : Qnil; | 1241 return window_is_highest (w) ? Qt : Qnil; |
1259 } | 1242 } |
1260 | 1243 |
1261 DEFUN ("window-leftmost-p", Fwindow_leftmost_p, Swindow_leftmost_p, 1, 1, 0 /* | 1244 DEFUN ("window-leftmost-p", Fwindow_leftmost_p, 1, 1, 0, /* |
1262 Return non-nil if WINDOW is along the left edge of its frame. | 1245 Return non-nil if WINDOW is along the left edge of its frame. |
1263 */ ) | 1246 */ |
1264 (window) | 1247 (window)) |
1265 Lisp_Object window; | |
1266 { | 1248 { |
1267 struct window *w = decode_window (window); | 1249 struct window *w = decode_window (window); |
1268 return window_is_leftmost (w) ? Qt : Qnil; | 1250 return window_is_leftmost (w) ? Qt : Qnil; |
1269 } | 1251 } |
1270 | 1252 |
1271 DEFUN ("window-rightmost-p", Fwindow_rightmost_p, Swindow_rightmost_p, | 1253 DEFUN ("window-rightmost-p", Fwindow_rightmost_p, 1, 1, 0, /* |
1272 1, 1, 0 /* | |
1273 Return non-nil if WINDOW is along the right edge of its frame. | 1254 Return non-nil if WINDOW is along the right edge of its frame. |
1274 */ ) | 1255 */ |
1275 (window) | 1256 (window)) |
1276 Lisp_Object window; | |
1277 { | 1257 { |
1278 struct window *w = decode_window (window); | 1258 struct window *w = decode_window (window); |
1279 return window_is_rightmost (w) ? Qt : Qnil; | 1259 return window_is_rightmost (w) ? Qt : Qnil; |
1280 } | 1260 } |
1281 | 1261 |
1282 DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, | 1262 DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, 0, 2, 0, /* |
1283 Spos_visible_in_window_p, 0, 2, 0 /* | |
1284 Return t if position POS is currently on the frame in WINDOW. | 1263 Return t if position POS is currently on the frame in WINDOW. |
1285 Returns nil if that position is scrolled vertically out of view. | 1264 Returns nil if that position is scrolled vertically out of view. |
1286 POS defaults to point in WINDOW's buffer; WINDOW, to the selected window. | 1265 POS defaults to point in WINDOW's buffer; WINDOW, to the selected window. |
1287 */ ) | 1266 */ |
1288 (pos, window) | 1267 (pos, window)) |
1289 Lisp_Object pos, window; | |
1290 { | 1268 { |
1291 struct window *w; | 1269 struct window *w; |
1292 Bufpos top; | 1270 Bufpos top; |
1293 Bufpos posint; | 1271 Bufpos posint; |
1294 struct buffer *buf; | 1272 struct buffer *buf; |
1328 | 1306 |
1329 CHECK_LIVE_WINDOW (window); | 1307 CHECK_LIVE_WINDOW (window); |
1330 return XWINDOW (window); | 1308 return XWINDOW (window); |
1331 } | 1309 } |
1332 | 1310 |
1333 DEFUN ("window-buffer", Fwindow_buffer, Swindow_buffer, 0, 1, 0 /* | 1311 DEFUN ("window-buffer", Fwindow_buffer, 0, 1, 0, /* |
1334 Return the buffer that WINDOW is displaying. | 1312 Return the buffer that WINDOW is displaying. |
1335 */ ) | 1313 */ |
1336 (window) | 1314 (window)) |
1337 Lisp_Object window; | |
1338 { | 1315 { |
1339 return decode_window (window)->buffer; | 1316 return decode_window (window)->buffer; |
1340 } | 1317 } |
1341 | 1318 |
1342 DEFUN ("window-frame", Fwindow_frame, Swindow_frame, 0, 1, 0 /* | 1319 DEFUN ("window-frame", Fwindow_frame, 0, 1, 0, /* |
1343 Return the frame that window WINDOW is on. | 1320 Return the frame that window WINDOW is on. |
1344 */ ) | 1321 */ |
1345 (window) | 1322 (window)) |
1346 Lisp_Object window; | |
1347 { | 1323 { |
1348 return decode_window (window)->frame; | 1324 return decode_window (window)->frame; |
1349 } | 1325 } |
1350 | 1326 |
1351 DEFUN ("window-height", Fwindow_height, Swindow_height, 0, 1, 0 /* | 1327 DEFUN ("window-height", Fwindow_height, 0, 1, 0, /* |
1352 Return the number of default lines in WINDOW. | 1328 Return the number of default lines in WINDOW. |
1353 This actually works by dividing the window's pixel height (including | 1329 This actually works by dividing the window's pixel height (including |
1354 the modeline and horizontal scrollbar, if any) by the height of the | 1330 the modeline and horizontal scrollbar, if any) by the height of the |
1355 default font; therefore, the number of displayed lines will probably | 1331 default font; therefore, the number of displayed lines will probably |
1356 be different. | 1332 be different. |
1357 Use `window-height' to get consistent results in geometry calculations. | 1333 Use `window-height' to get consistent results in geometry calculations. |
1358 Use `window-displayed-height' to get the actual number of lines | 1334 Use `window-displayed-height' to get the actual number of lines |
1359 currently displayed in a window. | 1335 currently displayed in a window. |
1360 */ ) | 1336 */ |
1361 (window) | 1337 (window)) |
1362 Lisp_Object window; | |
1363 { | 1338 { |
1364 return make_int (window_char_height (decode_window (window), 1)); | 1339 return make_int (window_char_height (decode_window (window), 1)); |
1365 } | 1340 } |
1366 | 1341 |
1367 DEFUN ("window-displayed-height", Fwindow_displayed_height, | 1342 DEFUN ("window-displayed-height", Fwindow_displayed_height, 0, 1, 0, /* |
1368 Swindow_displayed_height, 0, 1, 0 /* | |
1369 Return the number of lines currently displayed in WINDOW. | 1343 Return the number of lines currently displayed in WINDOW. |
1370 This counts the actual number of lines displayed in WINDOW | 1344 This counts the actual number of lines displayed in WINDOW |
1371 (as opposed to `window-height'). The modeline and horizontal | 1345 (as opposed to `window-height'). The modeline and horizontal |
1372 scrollbar do not count as lines. If there is some blank space | 1346 scrollbar do not count as lines. If there is some blank space |
1373 between the end of the buffer and the end of the window, this | 1347 between the end of the buffer and the end of the window, this |
1374 function pretends that there are lines of text in the default | 1348 function pretends that there are lines of text in the default |
1375 font there. | 1349 font there. |
1376 */ ) | 1350 */ |
1377 (window) | 1351 (window)) |
1378 Lisp_Object window; | |
1379 { | 1352 { |
1380 return make_int (window_displayed_height (decode_window (window))); | 1353 return make_int (window_displayed_height (decode_window (window))); |
1381 } | 1354 } |
1382 | 1355 |
1383 DEFUN ("window-pixel-height", Fwindow_pixel_height, Swindow_pixel_height, | 1356 DEFUN ("window-pixel-height", Fwindow_pixel_height, 0, 1, 0, /* |
1384 0, 1, 0 /* | |
1385 Return the height of WINDOW in pixels. Defaults to current window. | 1357 Return the height of WINDOW in pixels. Defaults to current window. |
1386 This includes the window's modeline and horizontal scrollbar (if any). | 1358 This includes the window's modeline and horizontal scrollbar (if any). |
1387 */ ) | 1359 */ |
1388 (window) | 1360 (window)) |
1389 Lisp_Object window; | |
1390 { | 1361 { |
1391 return (make_int (decode_window (window)->pixel_height)); | 1362 return (make_int (decode_window (window)->pixel_height)); |
1392 } | 1363 } |
1393 | 1364 |
1394 DEFUN ("window-width", Fwindow_width, Swindow_width, 0, 1, 0 /* | 1365 DEFUN ("window-width", Fwindow_width, 0, 1, 0, /* |
1395 Return the number of display columns in WINDOW. | 1366 Return the number of display columns in WINDOW. |
1396 This is the width that is usable columns available for text in WINDOW. | 1367 This is the width that is usable columns available for text in WINDOW. |
1397 */ ) | 1368 */ |
1398 (window) | 1369 (window)) |
1399 Lisp_Object window; | |
1400 { | 1370 { |
1401 struct window *w = decode_window (window); | 1371 struct window *w = decode_window (window); |
1402 return (make_int (window_char_width (w, 0))); | 1372 return (make_int (window_char_width (w, 0))); |
1403 } | 1373 } |
1404 | 1374 |
1405 DEFUN ("window-pixel-width", Fwindow_pixel_width, Swindow_pixel_width, | 1375 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /* |
1406 0, 1, 0 /* | |
1407 Return the width of WINDOW in pixels. Defaults to current window. | 1376 Return the width of WINDOW in pixels. Defaults to current window. |
1408 */ ) | 1377 */ |
1409 (window) | 1378 (window)) |
1410 Lisp_Object window; | |
1411 { | 1379 { |
1412 return (make_int (decode_window (window)->pixel_width)); | 1380 return (make_int (decode_window (window)->pixel_width)); |
1413 } | 1381 } |
1414 | 1382 |
1415 DEFUN ("window-hscroll", Fwindow_hscroll, Swindow_hscroll, 0, 1, 0 /* | 1383 DEFUN ("window-hscroll", Fwindow_hscroll, 0, 1, 0, /* |
1416 Return the number of columns by which WINDOW is scrolled from left margin. | 1384 Return the number of columns by which WINDOW is scrolled from left margin. |
1417 */ ) | 1385 */ |
1418 (window) | 1386 (window)) |
1419 Lisp_Object window; | |
1420 { | 1387 { |
1421 return (make_int (decode_window (window)->hscroll)); | 1388 return (make_int (decode_window (window)->hscroll)); |
1422 } | 1389 } |
1423 | 1390 |
1424 DEFUN ("set-window-hscroll", Fset_window_hscroll, Sset_window_hscroll, 2, 2, 0 /* | 1391 DEFUN ("set-window-hscroll", Fset_window_hscroll, 2, 2, 0, /* |
1425 Set number of columns WINDOW is scrolled from left margin to NCOL. | 1392 Set number of columns WINDOW is scrolled from left margin to NCOL. |
1426 NCOL should be zero or positive. | 1393 NCOL should be zero or positive. |
1427 */ ) | 1394 */ |
1428 (window, ncol) | 1395 (window, ncol)) |
1429 Lisp_Object window, ncol; | |
1430 { | 1396 { |
1431 struct window *w; | 1397 struct window *w; |
1432 int ncols; | 1398 int ncols; |
1433 | 1399 |
1434 CHECK_INT (ncol); | 1400 CHECK_INT (ncol); |
1473 return value; | 1439 return value; |
1474 } | 1440 } |
1475 | 1441 |
1476 #endif /* 0 */ | 1442 #endif /* 0 */ |
1477 | 1443 |
1478 DEFUN ("window-pixel-edges", Fwindow_pixel_edges, Swindow_pixel_edges, | 1444 DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* |
1479 0, 1, 0 /* | |
1480 Return a list of the pixel edge coordinates of WINDOW. | 1445 Return a list of the pixel edge coordinates of WINDOW. |
1481 \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | 1446 \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. |
1482 The frame toolbars and menubars are considered to be outside of this area. | 1447 The frame toolbars and menubars are considered to be outside of this area. |
1483 */ ) | 1448 */ |
1484 (window) | 1449 (window)) |
1485 Lisp_Object window; | |
1486 { | 1450 { |
1487 struct window *w = decode_window (window); | 1451 struct window *w = decode_window (window); |
1488 struct frame *f = XFRAME (w->frame); | 1452 struct frame *f = XFRAME (w->frame); |
1489 int left, top; | 1453 int left, top; |
1490 | 1454 |
1495 make_int (top), | 1459 make_int (top), |
1496 make_int (left + w->pixel_width), | 1460 make_int (left + w->pixel_width), |
1497 make_int (top + w->pixel_height)); | 1461 make_int (top + w->pixel_height)); |
1498 } | 1462 } |
1499 | 1463 |
1500 DEFUN ("window-point", Fwindow_point, Swindow_point, 0, 1, 0 /* | 1464 DEFUN ("window-point", Fwindow_point, 0, 1, 0, /* |
1501 Return current value of point in WINDOW. | 1465 Return current value of point in WINDOW. |
1502 For a nonselected window, this is the value point would have | 1466 For a nonselected window, this is the value point would have |
1503 if that window were selected. | 1467 if that window were selected. |
1504 | 1468 |
1505 Note that, when WINDOW is the selected window and its buffer | 1469 Note that, when WINDOW is the selected window and its buffer |
1506 is also currently selected, the value returned is the same as (point). | 1470 is also currently selected, the value returned is the same as (point). |
1507 It would be more strictly correct to return the `top-level' value | 1471 It would be more strictly correct to return the `top-level' value |
1508 of point, outside of any save-excursion forms. | 1472 of point, outside of any save-excursion forms. |
1509 But that is hard to define. | 1473 But that is hard to define. |
1510 */ ) | 1474 */ |
1511 (window) | 1475 (window)) |
1512 Lisp_Object window; | |
1513 { | 1476 { |
1514 struct window *w = decode_window (window); | 1477 struct window *w = decode_window (window); |
1515 | 1478 |
1516 /* The special check for current buffer is necessary for this | 1479 /* The special check for current buffer is necessary for this |
1517 function to work as defined when called within an excursion. */ | 1480 function to work as defined when called within an excursion. */ |
1519 && current_buffer == XBUFFER (w->buffer)) | 1482 && current_buffer == XBUFFER (w->buffer)) |
1520 return Fpoint (Qnil); | 1483 return Fpoint (Qnil); |
1521 return Fmarker_position (w->pointm[CURRENT_DISP]); | 1484 return Fmarker_position (w->pointm[CURRENT_DISP]); |
1522 } | 1485 } |
1523 | 1486 |
1524 DEFUN ("window-start", Fwindow_start, Swindow_start, 0, 1, 0 /* | 1487 DEFUN ("window-start", Fwindow_start, 0, 1, 0, /* |
1525 Return position at which display currently starts in WINDOW. | 1488 Return position at which display currently starts in WINDOW. |
1526 This is updated by redisplay or by calling `set-window-start'. | 1489 This is updated by redisplay or by calling `set-window-start'. |
1527 */ ) | 1490 */ |
1528 (window) | 1491 (window)) |
1529 Lisp_Object window; | |
1530 { | 1492 { |
1531 return Fmarker_position (decode_window (window)->start[CURRENT_DISP]); | 1493 return Fmarker_position (decode_window (window)->start[CURRENT_DISP]); |
1532 } | 1494 } |
1533 | 1495 |
1534 DEFUN ("window-end", Fwindow_end, Swindow_end, 0, 2, 0 /* | 1496 DEFUN ("window-end", Fwindow_end, 0, 2, 0, /* |
1535 Return position at which display currently ends in WINDOW. | 1497 Return position at which display currently ends in WINDOW. |
1536 This is updated by redisplay, when it runs to completion. | 1498 This is updated by redisplay, when it runs to completion. |
1537 Simply changing the buffer text or setting `window-start' | 1499 Simply changing the buffer text or setting `window-start' |
1538 does not update this value. | 1500 does not update this value. |
1539 If GUARANTEE is non-nil, then the return value is guaranteed to be | 1501 If GUARANTEE is non-nil, then the return value is guaranteed to be |
1540 the value of window-end at the end of the next full redisplay assuming | 1502 the value of window-end at the end of the next full redisplay assuming |
1541 nothing else changes in the meantime. This function is potentially much | 1503 nothing else changes in the meantime. This function is potentially much |
1542 slower with this flag set. | 1504 slower with this flag set. |
1543 */ ) | 1505 */ |
1544 (window, guarantee) | 1506 (window, guarantee)) |
1545 Lisp_Object window, guarantee; | |
1546 { | 1507 { |
1547 Lisp_Object value; | 1508 Lisp_Object value; |
1548 struct window *w = decode_window (window); | 1509 struct window *w = decode_window (window); |
1549 Lisp_Object buf; | 1510 Lisp_Object buf; |
1550 | 1511 |
1562 Bufpos startp = marker_position (w->start[CURRENT_DISP]); | 1523 Bufpos startp = marker_position (w->start[CURRENT_DISP]); |
1563 return (make_int (end_of_last_line (w, startp))); | 1524 return (make_int (end_of_last_line (w, startp))); |
1564 } | 1525 } |
1565 } | 1526 } |
1566 | 1527 |
1567 DEFUN ("set-window-point", Fset_window_point, Sset_window_point, 2, 2, 0 /* | 1528 DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /* |
1568 Make point value in WINDOW be at position POS in WINDOW's buffer. | 1529 Make point value in WINDOW be at position POS in WINDOW's buffer. |
1569 */ ) | 1530 */ |
1570 (window, pos) | 1531 (window, pos)) |
1571 Lisp_Object window, pos; | |
1572 { | 1532 { |
1573 struct window *w = decode_window (window); | 1533 struct window *w = decode_window (window); |
1574 | 1534 |
1575 CHECK_INT_COERCE_MARKER (pos); | 1535 CHECK_INT_COERCE_MARKER (pos); |
1576 if (w == XWINDOW (Fselected_window (Qnil))) | 1536 if (w == XWINDOW (Fselected_window (Qnil))) |
1580 | 1540 |
1581 MARK_POINT_CHANGED; | 1541 MARK_POINT_CHANGED; |
1582 return pos; | 1542 return pos; |
1583 } | 1543 } |
1584 | 1544 |
1585 DEFUN ("set-window-start", Fset_window_start, Sset_window_start, 2, 3, 0 /* | 1545 DEFUN ("set-window-start", Fset_window_start, 2, 3, 0, /* |
1586 Make display in WINDOW start at position POS in WINDOW's buffer. | 1546 Make display in WINDOW start at position POS in WINDOW's buffer. |
1587 Optional third arg NOFORCE non-nil inhibits next redisplay | 1547 Optional third arg NOFORCE non-nil inhibits next redisplay |
1588 from overriding motion of point in order to display at this exact start. | 1548 from overriding motion of point in order to display at this exact start. |
1589 */ ) | 1549 */ |
1590 (window, pos, noforce) | 1550 (window, pos, noforce)) |
1591 Lisp_Object window, pos, noforce; | |
1592 { | 1551 { |
1593 struct window *w = decode_window (window); | 1552 struct window *w = decode_window (window); |
1594 | 1553 |
1595 CHECK_INT_COERCE_MARKER (pos); | 1554 CHECK_INT_COERCE_MARKER (pos); |
1596 set_marker_restricted (w->start[CURRENT_DISP], pos, w->buffer); | 1555 set_marker_restricted (w->start[CURRENT_DISP], pos, w->buffer); |
1605 MARK_WINDOWS_CHANGED (w); | 1564 MARK_WINDOWS_CHANGED (w); |
1606 | 1565 |
1607 return pos; | 1566 return pos; |
1608 } | 1567 } |
1609 | 1568 |
1610 DEFUN ("window-dedicated-p", Fwindow_dedicated_p, Swindow_dedicated_p, | 1569 DEFUN ("window-dedicated-p", Fwindow_dedicated_p, 1, 1, 0, /* |
1611 1, 1, 0 /* | |
1612 Return WINDOW's dedicated object, usually t or nil. | 1570 Return WINDOW's dedicated object, usually t or nil. |
1613 See also `set-window-dedicated-p'. | 1571 See also `set-window-dedicated-p'. |
1614 */ ) | 1572 */ |
1615 (window) | 1573 (window)) |
1616 Lisp_Object window; | |
1617 { | 1574 { |
1618 return decode_window (window)->dedicated; | 1575 return decode_window (window)->dedicated; |
1619 } | 1576 } |
1620 | 1577 |
1621 DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, | 1578 DEFUN ("set-window-dedicated-p", Fset_window_dedicated_p, 2, 2, 0, /* |
1622 Sset_window_dedicated_p, 2, 2, 0 /* | |
1623 Control whether WINDOW is dedicated to the buffer it displays. | 1579 Control whether WINDOW is dedicated to the buffer it displays. |
1624 If it is dedicated, Emacs will not automatically change | 1580 If it is dedicated, Emacs will not automatically change |
1625 which buffer appears in it. | 1581 which buffer appears in it. |
1626 The second argument is the new value for the dedication flag; | 1582 The second argument is the new value for the dedication flag; |
1627 non-nil means yes. | 1583 non-nil means yes. |
1628 */ ) | 1584 */ |
1629 (window, arg) | 1585 (window, arg)) |
1630 Lisp_Object window, arg; | |
1631 { | 1586 { |
1632 register struct window *w = decode_window (window); | 1587 register struct window *w = decode_window (window); |
1633 | 1588 |
1634 if (NILP (arg)) | 1589 if (NILP (arg)) |
1635 w->dedicated = Qnil; | 1590 w->dedicated = Qnil; |
1757 they don't sit around consuming excess space. They will be | 1712 they don't sit around consuming excess space. They will be |
1758 reinitialized by the window-configuration code as necessary. */ | 1713 reinitialized by the window-configuration code as necessary. */ |
1759 finalize_window ((void *) w, 0); | 1714 finalize_window ((void *) w, 0); |
1760 } | 1715 } |
1761 | 1716 |
1762 DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 2, "" /* | 1717 DEFUN ("delete-window", Fdelete_window, 0, 2, "", /* |
1763 Remove WINDOW from the display. Default is selected window. | 1718 Remove WINDOW from the display. Default is selected window. |
1764 If window is the only one on the frame, the frame is destroyed. | 1719 If window is the only one on the frame, the frame is destroyed. |
1765 Normally, you cannot delete the last non-minibuffer-only frame (you must | 1720 Normally, you cannot delete the last non-minibuffer-only frame (you must |
1766 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional | 1721 use `save-buffers-kill-emacs' or `kill-emacs'). However, if optional |
1767 second argument FORCE is non-nil, you can delete the last frame. (This | 1722 second argument FORCE is non-nil, you can delete the last frame. (This |
1768 will automatically call `save-buffers-kill-emacs'.) | 1723 will automatically call `save-buffers-kill-emacs'.) |
1769 */ ) | 1724 */ |
1770 (window, force) | 1725 (window, force)) |
1771 Lisp_Object window, force; | |
1772 { | 1726 { |
1773 /* This function can GC if this is the only window in the frame */ | 1727 /* This function can GC if this is the only window in the frame */ |
1774 struct window *w; | 1728 struct window *w; |
1775 Lisp_Object parent; | 1729 Lisp_Object parent; |
1776 struct window *par; | 1730 struct window *par; |
1932 f->mirror_dirty = 1; | 1886 f->mirror_dirty = 1; |
1933 return Qnil; | 1887 return Qnil; |
1934 } | 1888 } |
1935 | 1889 |
1936 | 1890 |
1937 DEFUN ("next-window", Fnext_window, Snext_window, 0, 4, 0 /* | 1891 DEFUN ("next-window", Fnext_window, 0, 4, 0, /* |
1938 Return next window after WINDOW in canonical ordering of windows. | 1892 Return next window after WINDOW in canonical ordering of windows. |
1939 If omitted, WINDOW defaults to the selected window. | 1893 If omitted, WINDOW defaults to the selected window. |
1940 | 1894 |
1941 Optional second arg MINIBUF t means count the minibuffer window even | 1895 Optional second arg MINIBUF t means count the minibuffer window even |
1942 if not active. MINIBUF nil or omitted means count the minibuffer iff | 1896 if not active. MINIBUF nil or omitted means count the minibuffer iff |
1966 | 1920 |
1967 If you use consistent values for MINIBUF, ALL-FRAMES, and CONSOLE, you | 1921 If you use consistent values for MINIBUF, ALL-FRAMES, and CONSOLE, you |
1968 can use `next-window' to iterate through the entire cycle of acceptable | 1922 can use `next-window' to iterate through the entire cycle of acceptable |
1969 windows, eventually ending up back at the window you started with. | 1923 windows, eventually ending up back at the window you started with. |
1970 `previous-window' traverses the same cycle, in the reverse order. | 1924 `previous-window' traverses the same cycle, in the reverse order. |
1971 */ ) | 1925 */ |
1972 (window, minibuf, all_frames, console) | 1926 (window, minibuf, all_frames, console)) |
1973 Lisp_Object window, minibuf, all_frames, console; | |
1974 { | 1927 { |
1975 Lisp_Object tem; | 1928 Lisp_Object tem; |
1976 Lisp_Object start_window; | 1929 Lisp_Object start_window; |
1977 | 1930 |
1978 if (NILP (window)) | 1931 if (NILP (window)) |
2076 && ! EQ (window, start_window)); | 2029 && ! EQ (window, start_window)); |
2077 | 2030 |
2078 return window; | 2031 return window; |
2079 } | 2032 } |
2080 | 2033 |
2081 DEFUN ("previous-window", Fprevious_window, Sprevious_window, 0, 4, 0 /* | 2034 DEFUN ("previous-window", Fprevious_window, 0, 4, 0, /* |
2082 Return the window preceeding WINDOW in canonical ordering of windows. | 2035 Return the window preceeding WINDOW in canonical ordering of windows. |
2083 If omitted, WINDOW defaults to the selected window. | 2036 If omitted, WINDOW defaults to the selected window. |
2084 | 2037 |
2085 Optional second arg MINIBUF t means count the minibuffer window even | 2038 Optional second arg MINIBUF t means count the minibuffer window even |
2086 if not active. MINIBUF nil or omitted means count the minibuffer iff | 2039 if not active. MINIBUF nil or omitted means count the minibuffer iff |
2110 | 2063 |
2111 If you use consistent values for MINIBUF, ALL-FRAMES, and CONSOLE, you | 2064 If you use consistent values for MINIBUF, ALL-FRAMES, and CONSOLE, you |
2112 can use `previous-window' to iterate through the entire cycle of acceptable | 2065 can use `previous-window' to iterate through the entire cycle of acceptable |
2113 windows, eventually ending up back at the window you started with. | 2066 windows, eventually ending up back at the window you started with. |
2114 `next-window' traverses the same cycle, in the reverse order. | 2067 `next-window' traverses the same cycle, in the reverse order. |
2115 */ ) | 2068 */ |
2116 (window, minibuf, all_frames, console) | 2069 (window, minibuf, all_frames, console)) |
2117 Lisp_Object window, minibuf, all_frames, console; | |
2118 { | 2070 { |
2119 Lisp_Object tem; | 2071 Lisp_Object tem; |
2120 Lisp_Object start_window; | 2072 Lisp_Object start_window; |
2121 | 2073 |
2122 if (NILP (window)) | 2074 if (NILP (window)) |
2238 && ! EQ (window, start_window)); | 2190 && ! EQ (window, start_window)); |
2239 | 2191 |
2240 return window; | 2192 return window; |
2241 } | 2193 } |
2242 | 2194 |
2243 DEFUN ("next-vertical-window", Fnext_vertical_window, Snext_vertical_window, | 2195 DEFUN ("next-vertical-window", Fnext_vertical_window, 0, 1, 0, /* |
2244 0, 1, 0 /* | |
2245 Return the next window which is vertically after WINDOW. | 2196 Return the next window which is vertically after WINDOW. |
2246 */ ) | 2197 */ |
2247 (window) | 2198 (window)) |
2248 Lisp_Object window; | |
2249 { | 2199 { |
2250 Lisp_Object root; | 2200 Lisp_Object root; |
2251 struct window *w = decode_window (window); | 2201 struct window *w = decode_window (window); |
2252 XSETWINDOW (window, w); | 2202 XSETWINDOW (window, w); |
2253 | 2203 |
2289 window = XWINDOW (window)->vchild; | 2239 window = XWINDOW (window)->vchild; |
2290 else | 2240 else |
2291 return window; | 2241 return window; |
2292 } | 2242 } |
2293 | 2243 |
2294 DEFUN ("other-window", Fother_window, Sother_window, 1, 3, "p" /* | 2244 DEFUN ("other-window", Fother_window, 1, 3, "p", /* |
2295 Select the N'th different window on this frame. | 2245 Select the N'th different window on this frame. |
2296 All windows on current frame are arranged in a cyclic order. | 2246 All windows on current frame are arranged in a cyclic order. |
2297 This command selects the window N steps away in that order. | 2247 This command selects the window N steps away in that order. |
2298 A negative N moves in the opposite order. | 2248 A negative N moves in the opposite order. |
2299 | 2249 |
2309 device. If CONSOLE is a console type, return windows only on consoles | 2259 device. If CONSOLE is a console type, return windows only on consoles |
2310 of that type. If CONSOLE is 'window-system, return any windows on any | 2260 of that type. If CONSOLE is 'window-system, return any windows on any |
2311 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2261 window-system consoles. If CONSOLE is nil or omitted, return windows only |
2312 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2262 on FRAME'S console, or on the selected console if FRAME is not a frame. |
2313 Otherwise, all windows are considered. | 2263 Otherwise, all windows are considered. |
2314 */ ) | 2264 */ |
2315 (n, frame, console) | 2265 (n, frame, console)) |
2316 Lisp_Object n, frame, console; | |
2317 { | 2266 { |
2318 int i; | 2267 int i; |
2319 Lisp_Object w; | 2268 Lisp_Object w; |
2320 | 2269 |
2321 CHECK_INT (n); | 2270 CHECK_INT (n); |
2683 } | 2632 } |
2684 | 2633 |
2685 #endif | 2634 #endif |
2686 | 2635 |
2687 | 2636 |
2688 DEFUN ("get-lru-window", Fget_lru_window, Sget_lru_window, 0, 2, 0 /* | 2637 DEFUN ("get-lru-window", Fget_lru_window, 0, 2, 0, /* |
2689 Return the window least recently selected or used for display. | 2638 Return the window least recently selected or used for display. |
2690 If optional argument FRAME is `visible', search all visible frames. | 2639 If optional argument FRAME is `visible', search all visible frames. |
2691 If FRAME is 0, search all visible and iconified frames. | 2640 If FRAME is 0, search all visible and iconified frames. |
2692 If FRAME is t, search all frames. | 2641 If FRAME is t, search all frames. |
2693 If FRAME is nil, search only the selected frame. | 2642 If FRAME is nil, search only the selected frame. |
2699 device. If CONSOLE is a console type, return windows only on consoles | 2648 device. If CONSOLE is a console type, return windows only on consoles |
2700 of that type. If CONSOLE is 'window-system, return any windows on any | 2649 of that type. If CONSOLE is 'window-system, return any windows on any |
2701 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2650 window-system consoles. If CONSOLE is nil or omitted, return windows only |
2702 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2651 on FRAME'S console, or on the selected console if FRAME is not a frame. |
2703 Otherwise, all windows are considered. | 2652 Otherwise, all windows are considered. |
2704 */ ) | 2653 */ |
2705 (frame, console) | 2654 (frame, console)) |
2706 Lisp_Object frame, console; | |
2707 { | 2655 { |
2708 Lisp_Object w; | 2656 Lisp_Object w; |
2709 /* First try for a non-dedicated window that is full-width */ | 2657 /* First try for a non-dedicated window that is full-width */ |
2710 w = window_loop (GET_LRU_WINDOW, Qt, 0, frame, 0, console); | 2658 w = window_loop (GET_LRU_WINDOW, Qt, 0, frame, 0, console); |
2711 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) | 2659 if (!NILP (w) && !EQ (w, Fselected_window (Qnil))) |
2734 #endif | 2682 #endif |
2735 | 2683 |
2736 return (w); | 2684 return (w); |
2737 } | 2685 } |
2738 | 2686 |
2739 DEFUN ("get-largest-window", Fget_largest_window, Sget_largest_window, 0, 2, 0 /* | 2687 DEFUN ("get-largest-window", Fget_largest_window, 0, 2, 0, /* |
2740 Return the window largest in area. | 2688 Return the window largest in area. |
2741 If optional argument FRAME is `visible', search all visible frames. | 2689 If optional argument FRAME is `visible', search all visible frames. |
2742 If FRAME is 0, search all visible and iconified frames. | 2690 If FRAME is 0, search all visible and iconified frames. |
2743 If FRAME is t, search all frames. | 2691 If FRAME is t, search all frames. |
2744 If FRAME is nil, search only the selected frame. | 2692 If FRAME is nil, search only the selected frame. |
2750 device. If CONSOLE is a console type, return windows only on consoles | 2698 device. If CONSOLE is a console type, return windows only on consoles |
2751 of that type. If CONSOLE is 'window-system, return any windows on any | 2699 of that type. If CONSOLE is 'window-system, return any windows on any |
2752 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2700 window-system consoles. If CONSOLE is nil or omitted, return windows only |
2753 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2701 on FRAME'S console, or on the selected console if FRAME is not a frame. |
2754 Otherwise, all windows are considered. | 2702 Otherwise, all windows are considered. |
2755 */ ) | 2703 */ |
2756 (frame, console) | 2704 (frame, console)) |
2757 Lisp_Object frame, console; | |
2758 { | 2705 { |
2759 /* Don't search dedicated windows because FSFmacs doesn't. | 2706 /* Don't search dedicated windows because FSFmacs doesn't. |
2760 This stuff is all black magic so don't try to apply common | 2707 This stuff is all black magic so don't try to apply common |
2761 sense to it. */ | 2708 sense to it. */ |
2762 return window_loop (GET_LARGEST_WINDOW, Qnil, 0, frame, 0, console); | 2709 return window_loop (GET_LARGEST_WINDOW, Qnil, 0, frame, 0, console); |
2763 } | 2710 } |
2764 | 2711 |
2765 DEFUN ("get-buffer-window", Fget_buffer_window, Sget_buffer_window, 1, 3, 0 /* | 2712 DEFUN ("get-buffer-window", Fget_buffer_window, 1, 3, 0, /* |
2766 Return a window currently displaying BUFFER, or nil if none. | 2713 Return a window currently displaying BUFFER, or nil if none. |
2767 If optional argument FRAME is `visible', search all visible frames. | 2714 If optional argument FRAME is `visible', search all visible frames. |
2768 If optional argument FRAME is 0, search all visible and iconified frames. | 2715 If optional argument FRAME is 0, search all visible and iconified frames. |
2769 If FRAME is t, search all frames. | 2716 If FRAME is t, search all frames. |
2770 If FRAME is nil, search only the selected frame. | 2717 If FRAME is nil, search only the selected frame. |
2776 device. If CONSOLE is a console type, return windows only on consoles | 2723 device. If CONSOLE is a console type, return windows only on consoles |
2777 of that type. If CONSOLE is 'window-system, return any windows on any | 2724 of that type. If CONSOLE is 'window-system, return any windows on any |
2778 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2725 window-system consoles. If CONSOLE is nil or omitted, return windows only |
2779 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2726 on FRAME'S console, or on the selected console if FRAME is not a frame. |
2780 Otherwise, all windows are considered. | 2727 Otherwise, all windows are considered. |
2781 */ ) | 2728 */ |
2782 (buffer, frame, console) | 2729 (buffer, frame, console)) |
2783 Lisp_Object buffer, frame, console; | |
2784 { | 2730 { |
2785 buffer = Fget_buffer (buffer); | 2731 buffer = Fget_buffer (buffer); |
2786 if (BUFFERP (buffer)) | 2732 if (BUFFERP (buffer)) |
2787 /* Search dedicated windows too. (Doesn't matter here anyway.) */ | 2733 /* Search dedicated windows too. (Doesn't matter here anyway.) */ |
2788 return window_loop (GET_BUFFER_WINDOW, buffer, 1, frame, 1, console); | 2734 return window_loop (GET_BUFFER_WINDOW, buffer, 1, frame, 1, console); |
2792 | 2738 |
2793 /* These functions used to be `buffer-left-margin-pixel-width', etc. | 2739 /* These functions used to be `buffer-left-margin-pixel-width', etc. |
2794 but there is no sensible way to implement those functions, since | 2740 but there is no sensible way to implement those functions, since |
2795 you can't in general derive a window from a buffer. */ | 2741 you can't in general derive a window from a buffer. */ |
2796 | 2742 |
2797 DEFUN ("window-left-margin-pixel-width", Fwindow_left_margin_pixel_width, | 2743 DEFUN ("window-left-margin-pixel-width", |
2798 Swindow_left_margin_pixel_width, 0, 1, 0 /* | 2744 Fwindow_left_margin_pixel_width, 0, 1, 0, /* |
2799 Return the width in pixels of the left outside margin of window WINDOW. | 2745 Return the width in pixels of the left outside margin of window WINDOW. |
2800 If WINDOW is nil, the selected window is assumed. | 2746 If WINDOW is nil, the selected window is assumed. |
2801 */ ) | 2747 */ |
2802 (window) | 2748 (window)) |
2803 Lisp_Object window; | |
2804 { | 2749 { |
2805 struct window *w = decode_window (window); | 2750 struct window *w = decode_window (window); |
2806 | 2751 |
2807 return (make_int (window_left_margin_width (w))); | 2752 return (make_int (window_left_margin_width (w))); |
2808 } | 2753 } |
2809 | 2754 |
2810 DEFUN ("window-right-margin-pixel-width", Fwindow_right_margin_pixel_width, | 2755 DEFUN ("window-right-margin-pixel-width", |
2811 Swindow_right_margin_pixel_width, 0, 1, 0 /* | 2756 Fwindow_right_margin_pixel_width, 0, 1, 0, /* |
2812 Return the width in pixels of the right outside margin of window WINDOW. | 2757 Return the width in pixels of the right outside margin of window WINDOW. |
2813 If WINDOW is nil, the selected window is assumed. | 2758 If WINDOW is nil, the selected window is assumed. |
2814 */ ) | 2759 */ |
2815 (window) | 2760 (window)) |
2816 Lisp_Object window; | |
2817 { | 2761 { |
2818 struct window *w = decode_window (window); | 2762 struct window *w = decode_window (window); |
2819 | 2763 |
2820 return (make_int (window_right_margin_width (w))); | 2764 return (make_int (window_right_margin_width (w))); |
2821 } | 2765 } |
2822 | 2766 |
2823 DEFUN ("delete-other-windows", Fdelete_other_windows, Sdelete_other_windows, | 2767 DEFUN ("delete-other-windows", Fdelete_other_windows, 0, 1, "", /* |
2824 0, 1, "" /* | |
2825 Make WINDOW (or the selected window) fill its frame. | 2768 Make WINDOW (or the selected window) fill its frame. |
2826 Only the frame WINDOW is on is affected. | 2769 Only the frame WINDOW is on is affected. |
2827 This function tries to reduce display jumps | 2770 This function tries to reduce display jumps |
2828 by keeping the text previously visible in WINDOW | 2771 by keeping the text previously visible in WINDOW |
2829 in the same place on the frame. Doing this depends on | 2772 in the same place on the frame. Doing this depends on |
2830 the value of (window-start WINDOW), so if calling this function | 2773 the value of (window-start WINDOW), so if calling this function |
2831 in a program gives strange scrolling, make sure the window-start | 2774 in a program gives strange scrolling, make sure the window-start |
2832 value is reasonable when this function is called. | 2775 value is reasonable when this function is called. |
2833 */ ) | 2776 */ |
2834 (window) | 2777 (window)) |
2835 Lisp_Object window; | |
2836 { | 2778 { |
2837 struct window *w = decode_window (window); | 2779 struct window *w = decode_window (window); |
2838 struct buffer *b = XBUFFER (w->buffer); | 2780 struct buffer *b = XBUFFER (w->buffer); |
2839 Bufpos start_pos; | 2781 Bufpos start_pos; |
2840 int old_top = WINDOW_TOP (w); | 2782 int old_top = WINDOW_TOP (w); |
2871 } | 2813 } |
2872 | 2814 |
2873 return Qnil; | 2815 return Qnil; |
2874 } | 2816 } |
2875 | 2817 |
2876 DEFUN ("delete-windows-on", Fdelete_windows_on, Sdelete_windows_on, | 2818 DEFUN ("delete-windows-on", Fdelete_windows_on, 1, 3, |
2877 1, 3, "bDelete windows on (buffer): " /* | 2819 "bDelete windows on (buffer): ", /* |
2878 Delete all windows showing BUFFER. | 2820 Delete all windows showing BUFFER. |
2879 Optional second argument FRAME controls which frames are affected. | 2821 Optional second argument FRAME controls which frames are affected. |
2880 If nil or omitted, delete all windows showing BUFFER in any frame. | 2822 If nil or omitted, delete all windows showing BUFFER in any frame. |
2881 If t, delete only windows showing BUFFER in the selected frame. | 2823 If t, delete only windows showing BUFFER in the selected frame. |
2882 If `visible', delete all windows showing BUFFER in any visible frame. | 2824 If `visible', delete all windows showing BUFFER in any visible frame. |
2888 device. If CONSOLE is a console type, return windows only on consoles | 2830 device. If CONSOLE is a console type, return windows only on consoles |
2889 of that type. If CONSOLE is 'window-system, return any windows on any | 2831 of that type. If CONSOLE is 'window-system, return any windows on any |
2890 window-system consoles. If CONSOLE is nil or omitted, return windows only | 2832 window-system consoles. If CONSOLE is nil or omitted, return windows only |
2891 on FRAME'S console, or on the selected console if FRAME is not a frame. | 2833 on FRAME'S console, or on the selected console if FRAME is not a frame. |
2892 Otherwise, all windows are considered. | 2834 Otherwise, all windows are considered. |
2893 */ ) | 2835 */ |
2894 (buffer, frame, console) | 2836 (buffer, frame, console)) |
2895 Lisp_Object buffer, frame, console; | |
2896 { | 2837 { |
2897 /* This function can GC */ | 2838 /* This function can GC */ |
2898 /* FRAME uses t and nil to mean the opposite of what window_loop | 2839 /* FRAME uses t and nil to mean the opposite of what window_loop |
2899 expects. */ | 2840 expects. */ |
2900 if (!FRAMEP (frame)) | 2841 if (!FRAMEP (frame)) |
2908 window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, frame, 0, console); | 2849 window_loop (DELETE_BUFFER_WINDOWS, buffer, 0, frame, 0, console); |
2909 } | 2850 } |
2910 return Qnil; | 2851 return Qnil; |
2911 } | 2852 } |
2912 | 2853 |
2913 DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, | 2854 DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, 1, 1, |
2914 Sreplace_buffer_in_windows, | 2855 "bReplace buffer in windows: ", /* |
2915 1, 1, "bReplace buffer in windows: " /* | |
2916 Replace BUFFER with some other buffer in all windows showing it. | 2856 Replace BUFFER with some other buffer in all windows showing it. |
2917 */ ) | 2857 */ |
2918 (buffer) | 2858 (buffer)) |
2919 Lisp_Object buffer; | |
2920 { | 2859 { |
2921 /* This function can GC */ | 2860 /* This function can GC */ |
2922 if (!NILP (buffer)) | 2861 if (!NILP (buffer)) |
2923 { | 2862 { |
2924 buffer = Fget_buffer (buffer); | 2863 buffer = Fget_buffer (buffer); |
3096 } | 3035 } |
3097 | 3036 |
3098 | 3037 |
3099 static int window_select_count; | 3038 static int window_select_count; |
3100 | 3039 |
3101 DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 2, 0 /* | 3040 DEFUN ("set-window-buffer", Fset_window_buffer, 2, 2, 0, /* |
3102 Make WINDOW display BUFFER as its contents. | 3041 Make WINDOW display BUFFER as its contents. |
3103 BUFFER can be a buffer or buffer name. | 3042 BUFFER can be a buffer or buffer name. |
3104 */ ) | 3043 */ |
3105 (window, buffer) | 3044 (window, buffer)) |
3106 Lisp_Object window, buffer; | |
3107 { | 3045 { |
3108 Lisp_Object tem; | 3046 Lisp_Object tem; |
3109 struct window *w = decode_window (window); | 3047 struct window *w = decode_window (window); |
3110 | 3048 |
3111 buffer = Fget_buffer (buffer); | 3049 buffer = Fget_buffer (buffer); |
3165 #endif | 3103 #endif |
3166 } | 3104 } |
3167 return Qnil; | 3105 return Qnil; |
3168 } | 3106 } |
3169 | 3107 |
3170 DEFUN ("select-window", Fselect_window, Sselect_window, 1, 1, 0 /* | 3108 DEFUN ("select-window", Fselect_window, 1, 1, 0, /* |
3171 Select WINDOW. Most editing will apply to WINDOW's buffer. | 3109 Select WINDOW. Most editing will apply to WINDOW's buffer. |
3172 The main editor command loop selects the buffer of the selected window | 3110 The main editor command loop selects the buffer of the selected window |
3173 before each command. | 3111 before each command. |
3174 */ ) | 3112 */ |
3175 (window) | 3113 (window)) |
3176 Lisp_Object window; | |
3177 { | 3114 { |
3178 struct window *w; | 3115 struct window *w; |
3179 Lisp_Object old_selected_window = Fselected_window (Qnil); | 3116 Lisp_Object old_selected_window = Fselected_window (Qnil); |
3180 | 3117 |
3181 CHECK_LIVE_WINDOW (window); | 3118 CHECK_LIVE_WINDOW (window); |
3336 p->pointm[CMOTION_DISP] = Qnil; | 3273 p->pointm[CMOTION_DISP] = Qnil; |
3337 p->sb_point = Qnil; | 3274 p->sb_point = Qnil; |
3338 p->buffer = Qnil; | 3275 p->buffer = Qnil; |
3339 } | 3276 } |
3340 | 3277 |
3341 DEFUN ("split-window", Fsplit_window, Ssplit_window, 0, 3, "" /* | 3278 DEFUN ("split-window", Fsplit_window, 0, 3, "", /* |
3342 Split WINDOW, putting SIZE lines in the first of the pair. | 3279 Split WINDOW, putting SIZE lines in the first of the pair. |
3343 WINDOW defaults to selected one and SIZE to half its size. | 3280 WINDOW defaults to selected one and SIZE to half its size. |
3344 If optional third arg HOR-FLAG is non-nil, split side by side | 3281 If optional third arg HOR-FLAG is non-nil, split side by side |
3345 and put SIZE columns in the first of the pair. | 3282 and put SIZE columns in the first of the pair. |
3346 */ ) | 3283 */ |
3347 (window, chsize, horflag) | 3284 (window, chsize, horflag)) |
3348 Lisp_Object window, chsize, horflag; | |
3349 { | 3285 { |
3350 Lisp_Object new; | 3286 Lisp_Object new; |
3351 struct window *o, *p; | 3287 struct window *o, *p; |
3352 struct frame *f; | 3288 struct frame *f; |
3353 int size; | 3289 int size; |
3475 Fset_window_buffer (new, o->buffer); | 3411 Fset_window_buffer (new, o->buffer); |
3476 return new; | 3412 return new; |
3477 } | 3413 } |
3478 | 3414 |
3479 | 3415 |
3480 DEFUN ("enlarge-window", Fenlarge_window, Senlarge_window, 1, 3, "_p" /* | 3416 DEFUN ("enlarge-window", Fenlarge_window, 1, 3, "_p", /* |
3481 Make the selected window ARG lines bigger. | 3417 Make the selected window ARG lines bigger. |
3482 From program, optional second arg non-nil means grow sideways ARG columns, | 3418 From program, optional second arg non-nil means grow sideways ARG columns, |
3483 and optional third ARG specifies the window to change instead of the | 3419 and optional third ARG specifies the window to change instead of the |
3484 selected window. | 3420 selected window. |
3485 */ ) | 3421 */ |
3486 (n, side, window) | 3422 (n, side, window)) |
3487 Lisp_Object n, side, window; | |
3488 { | 3423 { |
3489 struct window *w = decode_window (window); | 3424 struct window *w = decode_window (window); |
3490 CHECK_INT (n); | 3425 CHECK_INT (n); |
3491 change_window_height (w, XINT (n), !NILP (side)); | 3426 change_window_height (w, XINT (n), !NILP (side)); |
3492 return Qnil; | 3427 return Qnil; |
3493 } | 3428 } |
3494 | 3429 |
3495 DEFUN ("shrink-window", Fshrink_window, Sshrink_window, 1, 3, "_p" /* | 3430 DEFUN ("shrink-window", Fshrink_window, 1, 3, "_p", /* |
3496 Make the selected window ARG lines smaller. | 3431 Make the selected window ARG lines smaller. |
3497 From program, optional second arg non-nil means shrink sideways ARG columns, | 3432 From program, optional second arg non-nil means shrink sideways ARG columns, |
3498 and optional third ARG specifies the window to change instead of the | 3433 and optional third ARG specifies the window to change instead of the |
3499 selected window. | 3434 selected window. |
3500 */ ) | 3435 */ |
3501 (n, side, window) | 3436 (n, side, window)) |
3502 Lisp_Object n, side, window; | |
3503 { | 3437 { |
3504 struct window *w = decode_window (window); | 3438 struct window *w = decode_window (window); |
3505 CHECK_INT (n); | 3439 CHECK_INT (n); |
3506 change_window_height (w, -XINT (n), !NILP (side)); | 3440 change_window_height (w, -XINT (n), !NILP (side)); |
3507 return Qnil; | 3441 return Qnil; |
4105 } | 4039 } |
4106 } | 4040 } |
4107 | 4041 |
4108 } | 4042 } |
4109 | 4043 |
4110 DEFUN ("scroll-up", Fscroll_up, Sscroll_up, 0, 1, "_P" /* | 4044 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /* |
4111 Scroll text of current window upward ARG lines; or near full screen if no ARG. | 4045 Scroll text of current window upward ARG lines; or near full screen if no ARG. |
4112 A near full screen is `next-screen-context-lines' less than a full screen. | 4046 A near full screen is `next-screen-context-lines' less than a full screen. |
4113 Negative ARG means scroll downward. | 4047 Negative ARG means scroll downward. |
4114 When calling from a program, supply a number as argument or nil. | 4048 When calling from a program, supply a number as argument or nil. |
4115 */ ) | 4049 */ |
4116 (n) | 4050 (n)) |
4117 Lisp_Object n; | |
4118 { | 4051 { |
4119 window_scroll (Fselected_window (Qnil), n, 1, ERROR_ME); | 4052 window_scroll (Fselected_window (Qnil), n, 1, ERROR_ME); |
4120 return Qnil; | 4053 return Qnil; |
4121 } | 4054 } |
4122 | 4055 |
4123 DEFUN ("scroll-down", Fscroll_down, Sscroll_down, 0, 1, "_P" /* | 4056 DEFUN ("scroll-down", Fscroll_down, 0, 1, "_P", /* |
4124 Scroll text of current window downward ARG lines; or near full screen if no ARG. | 4057 Scroll text of current window downward ARG lines; or near full screen if no ARG. |
4125 A near full screen is `next-screen-context-lines' less than a full screen. | 4058 A near full screen is `next-screen-context-lines' less than a full screen. |
4126 Negative ARG means scroll upward. | 4059 Negative ARG means scroll upward. |
4127 When calling from a program, supply a number as argument or nil. | 4060 When calling from a program, supply a number as argument or nil. |
4128 */ ) | 4061 */ |
4129 (n) | 4062 (n)) |
4130 Lisp_Object n; | |
4131 { | 4063 { |
4132 window_scroll (Fselected_window (Qnil), n, -1, ERROR_ME); | 4064 window_scroll (Fselected_window (Qnil), n, -1, ERROR_ME); |
4133 return Qnil; | 4065 return Qnil; |
4134 } | 4066 } |
4135 | 4067 |
4136 DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, Sother_window_for_scrolling, 0, 0, 0 /* | 4068 DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, 0, 0, 0, /* |
4137 Return the other window for \"other window scroll\" commands. | 4069 Return the other window for \"other window scroll\" commands. |
4138 If in the minibuffer, `minibuffer-scroll-window' if non-nil | 4070 If in the minibuffer, `minibuffer-scroll-window' if non-nil |
4139 specifies the window. | 4071 specifies the window. |
4140 If `other-window-scroll-buffer' is non-nil, a window | 4072 If `other-window-scroll-buffer' is non-nil, a window |
4141 showing that buffer is used. | 4073 showing that buffer is used. |
4142 */ ) | 4074 */ |
4143 () | 4075 ()) |
4144 { | 4076 { |
4145 Lisp_Object window; | 4077 Lisp_Object window; |
4146 Lisp_Object selected_window = Fselected_window (Qnil); | 4078 Lisp_Object selected_window = Fselected_window (Qnil); |
4147 | 4079 |
4148 if (MINI_WINDOW_P (XWINDOW (selected_window)) | 4080 if (MINI_WINDOW_P (XWINDOW (selected_window)) |
4176 error ("There is no other window"); | 4108 error ("There is no other window"); |
4177 | 4109 |
4178 return window; | 4110 return window; |
4179 } | 4111 } |
4180 | 4112 |
4181 DEFUN ("scroll-other-window", Fscroll_other_window, Sscroll_other_window, 0, 1, "_P" /* | 4113 DEFUN ("scroll-other-window", Fscroll_other_window, 0, 1, "_P", /* |
4182 Scroll next window upward ARG lines; or near full frame if no ARG. | 4114 Scroll next window upward ARG lines; or near full frame if no ARG. |
4183 The next window is the one below the current one; or the one at the top | 4115 The next window is the one below the current one; or the one at the top |
4184 if the current one is at the bottom. Negative ARG means scroll downward. | 4116 if the current one is at the bottom. Negative ARG means scroll downward. |
4185 When calling from a program, supply a number as argument or nil. | 4117 When calling from a program, supply a number as argument or nil. |
4186 | 4118 |
4187 If in the minibuffer, `minibuf-scroll-window' if non-nil | 4119 If in the minibuffer, `minibuf-scroll-window' if non-nil |
4188 specifies the window to scroll. | 4120 specifies the window to scroll. |
4189 If `other-window-scroll-buffer' is non-nil, scroll the window | 4121 If `other-window-scroll-buffer' is non-nil, scroll the window |
4190 showing that buffer, popping the buffer up if necessary. | 4122 showing that buffer, popping the buffer up if necessary. |
4191 */ ) | 4123 */ |
4192 (n) | 4124 (n)) |
4193 Lisp_Object n; | |
4194 { | 4125 { |
4195 window_scroll (Fother_window_for_scrolling (), n, 1, ERROR_ME); | 4126 window_scroll (Fother_window_for_scrolling (), n, 1, ERROR_ME); |
4196 return Qnil; | 4127 return Qnil; |
4197 } | 4128 } |
4198 | 4129 |
4199 DEFUN ("scroll-left", Fscroll_left, Sscroll_left, 0, 1, "_P" /* | 4130 DEFUN ("scroll-left", Fscroll_left, 0, 1, "_P", /* |
4200 Scroll selected window display ARG columns left. | 4131 Scroll selected window display ARG columns left. |
4201 Default for ARG is window width minus 2. | 4132 Default for ARG is window width minus 2. |
4202 */ ) | 4133 */ |
4203 (arg) | 4134 (arg)) |
4204 Lisp_Object arg; | |
4205 { | 4135 { |
4206 Lisp_Object window = Fselected_window (Qnil); | 4136 Lisp_Object window = Fselected_window (Qnil); |
4207 struct window *w = XWINDOW (window); | 4137 struct window *w = XWINDOW (window); |
4208 | 4138 |
4209 if (NILP (arg)) | 4139 if (NILP (arg)) |
4213 | 4143 |
4214 return | 4144 return |
4215 Fset_window_hscroll (window, make_int (w->hscroll + XINT (arg))); | 4145 Fset_window_hscroll (window, make_int (w->hscroll + XINT (arg))); |
4216 } | 4146 } |
4217 | 4147 |
4218 DEFUN ("scroll-right", Fscroll_right, Sscroll_right, 0, 1, "_P" /* | 4148 DEFUN ("scroll-right", Fscroll_right, 0, 1, "_P", /* |
4219 Scroll selected window display ARG columns right. | 4149 Scroll selected window display ARG columns right. |
4220 Default for ARG is window width minus 2. | 4150 Default for ARG is window width minus 2. |
4221 */ ) | 4151 */ |
4222 (arg) | 4152 (arg)) |
4223 Lisp_Object arg; | |
4224 { | 4153 { |
4225 Lisp_Object window = Fselected_window (Qnil); | 4154 Lisp_Object window = Fselected_window (Qnil); |
4226 struct window *w = XWINDOW (window); | 4155 struct window *w = XWINDOW (window); |
4227 | 4156 |
4228 if (NILP (arg)) | 4157 if (NILP (arg)) |
4232 | 4161 |
4233 return | 4162 return |
4234 Fset_window_hscroll (window, make_int (w->hscroll - XINT (arg))); | 4163 Fset_window_hscroll (window, make_int (w->hscroll - XINT (arg))); |
4235 } | 4164 } |
4236 | 4165 |
4237 DEFUN ("recenter", Frecenter, Srecenter, 0, 2, "_P" /* | 4166 DEFUN ("recenter", Frecenter, 0, 2, "_P", /* |
4238 Center point in WINDOW and redisplay frame. With ARG, put point on line ARG. | 4167 Center point in WINDOW and redisplay frame. With ARG, put point on line ARG. |
4239 The desired position of point is always relative to the window. | 4168 The desired position of point is always relative to the window. |
4240 Just C-u as prefix means put point in the center of the window. | 4169 Just C-u as prefix means put point in the center of the window. |
4241 No arg (i.e., it is nil) erases the entire frame and then | 4170 No arg (i.e., it is nil) erases the entire frame and then |
4242 redraws with point in the center of the window. | 4171 redraws with point in the center of the window. |
4243 If WINDOW is nil, the selected window is used. | 4172 If WINDOW is nil, the selected window is used. |
4244 */ ) | 4173 */ |
4245 (n, window) | 4174 (n, window)) |
4246 Lisp_Object n, window; | |
4247 { | 4175 { |
4248 struct window *w; | 4176 struct window *w; |
4249 struct buffer *b; | 4177 struct buffer *b; |
4250 Bufpos startp; | 4178 Bufpos startp; |
4251 Bufpos opoint; | 4179 Bufpos opoint; |
4285 w->force_start = 1; | 4213 w->force_start = 1; |
4286 MARK_WINDOWS_CHANGED (w); | 4214 MARK_WINDOWS_CHANGED (w); |
4287 return Qnil; | 4215 return Qnil; |
4288 } | 4216 } |
4289 | 4217 |
4290 DEFUN ("move-to-window-line", Fmove_to_window_line, Smove_to_window_line, | 4218 DEFUN ("move-to-window-line", Fmove_to_window_line, 1, 2, "_P", /* |
4291 1, 2, "_P" /* | |
4292 Position point relative to WINDOW. | 4219 Position point relative to WINDOW. |
4293 With no argument, position text at center of window. | 4220 With no argument, position text at center of window. |
4294 An argument specifies window line; zero means top of window, | 4221 An argument specifies window line; zero means top of window, |
4295 negative means relative to bottom of window. | 4222 negative means relative to bottom of window. |
4296 If WINDOW is nil, the selected window is used. | 4223 If WINDOW is nil, the selected window is used. |
4297 */ ) | 4224 */ |
4298 (arg, window) | 4225 (arg, window)) |
4299 Lisp_Object arg, window; | |
4300 { | 4226 { |
4301 struct window *w; | 4227 struct window *w; |
4302 struct buffer *b; | 4228 struct buffer *b; |
4303 int height; | 4229 int height; |
4304 Bufpos start, new_point; | 4230 Bufpos start, new_point; |
4510 stats->line_start += | 4436 stats->line_start += |
4511 compute_line_start_cache_dynarr_usage (w->line_start_cache, ovstats); | 4437 compute_line_start_cache_dynarr_usage (w->line_start_cache, ovstats); |
4512 compute_window_mirror_usage (find_window_mirror (w), stats, ovstats); | 4438 compute_window_mirror_usage (find_window_mirror (w), stats, ovstats); |
4513 } | 4439 } |
4514 | 4440 |
4515 DEFUN ("window-memory-usage", Fwindow_memory_usage, Swindow_memory_usage, | 4441 DEFUN ("window-memory-usage", Fwindow_memory_usage, 1, 1, 0, /* |
4516 1, 1, 0 /* | |
4517 Return stats about the memory usage of window WINDOW. | 4442 Return stats about the memory usage of window WINDOW. |
4518 The values returned are in the form an alist of usage types and byte | 4443 The values returned are in the form an alist of usage types and byte |
4519 counts. The byte counts attempt to encompass all the memory used | 4444 counts. The byte counts attempt to encompass all the memory used |
4520 by the window (separate from the memory logically associated with a | 4445 by the window (separate from the memory logically associated with a |
4521 buffer or frame), including internal structures and any malloc() | 4446 buffer or frame), including internal structures and any malloc() |
4529 Multiple slices of the total memory usage may be returned, separated | 4454 Multiple slices of the total memory usage may be returned, separated |
4530 by a nil. Each slice represents a particular view of the memory, a | 4455 by a nil. Each slice represents a particular view of the memory, a |
4531 particular way of partitioning it into groups. Within a slice, there | 4456 particular way of partitioning it into groups. Within a slice, there |
4532 is no overlap between the groups of memory, and each slice collectively | 4457 is no overlap between the groups of memory, and each slice collectively |
4533 represents all the memory concerned. | 4458 represents all the memory concerned. |
4534 */ ) | 4459 */ |
4535 (window) | 4460 (window)) |
4536 Lisp_Object window; | |
4537 { | 4461 { |
4538 struct window_stats stats; | 4462 struct window_stats stats; |
4539 struct overhead_stats ovstats; | 4463 struct overhead_stats ovstats; |
4540 | 4464 |
4541 CHECK_WINDOW (window); /* dead windows should be allowed, no? */ | 4465 CHECK_WINDOW (window); /* dead windows should be allowed, no? */ |
4776 } | 4700 } |
4777 | 4701 |
4778 return 1; | 4702 return 1; |
4779 } | 4703 } |
4780 | 4704 |
4781 DEFUN ("window-configuration-p", Fwindow_configuration_p, | 4705 DEFUN ("window-configuration-p", Fwindow_configuration_p, 1, 1, 0, /* |
4782 Swindow_configuration_p, 1, 1, 0 /* | |
4783 T if OBJECT is a window-configuration object. | 4706 T if OBJECT is a window-configuration object. |
4784 */ ) | 4707 */ |
4785 (obj) | 4708 (obj)) |
4786 Lisp_Object obj; | |
4787 { | 4709 { |
4788 return (WINDOW_CONFIGURATIONP (obj) ? Qt : Qnil); | 4710 return (WINDOW_CONFIGURATIONP (obj) ? Qt : Qnil); |
4789 } | 4711 } |
4790 | 4712 |
4791 /* | 4713 /* |
4851 window_config); | 4773 window_config); |
4852 | 4774 |
4853 return Qnil; | 4775 return Qnil; |
4854 } | 4776 } |
4855 | 4777 |
4856 DEFUN ("set-window-configuration", | 4778 DEFUN ("set-window-configuration", Fset_window_configuration, 1, 1, 0, /* |
4857 Fset_window_configuration, Sset_window_configuration, | |
4858 1, 1, 0 /* | |
4859 Set the configuration of windows and buffers as specified by CONFIGURATION. | 4779 Set the configuration of windows and buffers as specified by CONFIGURATION. |
4860 CONFIGURATION must be a value previously returned | 4780 CONFIGURATION must be a value previously returned |
4861 by `current-window-configuration' (which see). | 4781 by `current-window-configuration' (which see). |
4862 */ ) | 4782 */ |
4863 (configuration) | 4783 (configuration)) |
4864 Lisp_Object configuration; | |
4865 { | 4784 { |
4866 struct window *w; | 4785 struct window *w; |
4867 struct window_config *config; | 4786 struct window_config *config; |
4868 struct saved_window *p; | 4787 struct saved_window *p; |
4869 Lisp_Object new_current_buffer; | 4788 Lisp_Object new_current_buffer; |
5341 redirection (see `redirect-frame-focus'). | 5260 redirection (see `redirect-frame-focus'). |
5342 | 5261 |
5343 */ | 5262 */ |
5344 #endif | 5263 #endif |
5345 | 5264 |
5346 DEFUN ("current-window-configuration", | 5265 DEFUN ("current-window-configuration", Fcurrent_window_configuration, 0, 1, 0, /* |
5347 Fcurrent_window_configuration, Scurrent_window_configuration, 0, 1, 0 /* | |
5348 Return an object representing the current window configuration of FRAME. | 5266 Return an object representing the current window configuration of FRAME. |
5349 If FRAME is nil or omitted, use the selected frame. | 5267 If FRAME is nil or omitted, use the selected frame. |
5350 This describes the number of windows, their sizes and current buffers, | 5268 This describes the number of windows, their sizes and current buffers, |
5351 and for each displayed buffer, where display starts, and the positions of | 5269 and for each displayed buffer, where display starts, and the positions of |
5352 point and mark. An exception is made for point in the current buffer: | 5270 point and mark. An exception is made for point in the current buffer: |
5353 its value is -not- saved. | 5271 its value is -not- saved. |
5354 */ ) | 5272 */ |
5355 (frame) | 5273 (frame)) |
5356 Lisp_Object frame; | |
5357 { | 5274 { |
5358 Lisp_Object result = Qnil; | 5275 Lisp_Object result = Qnil; |
5359 struct frame *f; | 5276 struct frame *f; |
5360 int n_windows; | 5277 int n_windows; |
5361 | 5278 |
5401 Lisp_Object val = Fset_window_configuration (window_config); | 5318 Lisp_Object val = Fset_window_configuration (window_config); |
5402 free_window_configuration (window_config); | 5319 free_window_configuration (window_config); |
5403 return val; | 5320 return val; |
5404 } | 5321 } |
5405 | 5322 |
5406 DEFUN ("save-window-excursion", Fsave_window_excursion, Ssave_window_excursion, | 5323 DEFUN ("save-window-excursion", Fsave_window_excursion, 0, UNEVALLED, 0, /* |
5407 0, UNEVALLED, 0 /* | |
5408 Execute body, preserving window sizes and contents. | 5324 Execute body, preserving window sizes and contents. |
5409 Restores which buffer appears in which window, where display starts, | 5325 Restores which buffer appears in which window, where display starts, |
5410 as well as the current buffer. | 5326 as well as the current buffer. |
5411 Does not restore the value of point in current buffer. | 5327 Does not restore the value of point in current buffer. |
5412 */ ) | 5328 */ |
5413 (args) | 5329 (args)) |
5414 Lisp_Object args; | |
5415 { | 5330 { |
5416 /* This function can GC */ | 5331 /* This function can GC */ |
5417 Lisp_Object val; | 5332 Lisp_Object val; |
5418 int speccount = specpdl_depth (); | 5333 int speccount = specpdl_depth (); |
5419 | 5334 |
5493 #endif | 5408 #endif |
5494 defsymbol (&Qother_redisplay, "other-redisplay"); | 5409 defsymbol (&Qother_redisplay, "other-redisplay"); |
5495 /* Qother in general.c */ | 5410 /* Qother in general.c */ |
5496 #endif | 5411 #endif |
5497 | 5412 |
5498 defsubr (&Sselected_window); | 5413 DEFSUBR (Fselected_window); |
5499 defsubr (&Sminibuffer_window); | 5414 DEFSUBR (Fminibuffer_window); |
5500 defsubr (&Swindow_minibuffer_p); | 5415 DEFSUBR (Fwindow_minibuffer_p); |
5501 defsubr (&Swindowp); | 5416 DEFSUBR (Fwindowp); |
5502 defsubr (&Swindow_live_p); | 5417 DEFSUBR (Fwindow_live_p); |
5503 defsubr (&Swindow_first_hchild); | 5418 DEFSUBR (Fwindow_first_hchild); |
5504 defsubr (&Swindow_first_vchild); | 5419 DEFSUBR (Fwindow_first_vchild); |
5505 defsubr (&Swindow_next_child); | 5420 DEFSUBR (Fwindow_next_child); |
5506 defsubr (&Swindow_previous_child); | 5421 DEFSUBR (Fwindow_previous_child); |
5507 defsubr (&Swindow_parent); | 5422 DEFSUBR (Fwindow_parent); |
5508 defsubr (&Swindow_lowest_p); | 5423 DEFSUBR (Fwindow_lowest_p); |
5509 defsubr (&Swindow_highest_p); | 5424 DEFSUBR (Fwindow_highest_p); |
5510 defsubr (&Swindow_leftmost_p); | 5425 DEFSUBR (Fwindow_leftmost_p); |
5511 defsubr (&Swindow_rightmost_p); | 5426 DEFSUBR (Fwindow_rightmost_p); |
5512 defsubr (&Spos_visible_in_window_p); | 5427 DEFSUBR (Fpos_visible_in_window_p); |
5513 defsubr (&Swindow_buffer); | 5428 DEFSUBR (Fwindow_buffer); |
5514 defsubr (&Swindow_frame); | 5429 DEFSUBR (Fwindow_frame); |
5515 defsubr (&Swindow_height); | 5430 DEFSUBR (Fwindow_height); |
5516 defsubr (&Swindow_displayed_height); | 5431 DEFSUBR (Fwindow_displayed_height); |
5517 defsubr (&Swindow_width); | 5432 DEFSUBR (Fwindow_width); |
5518 defsubr (&Swindow_pixel_height); | 5433 DEFSUBR (Fwindow_pixel_height); |
5519 defsubr (&Swindow_pixel_width); | 5434 DEFSUBR (Fwindow_pixel_width); |
5520 defsubr (&Swindow_hscroll); | 5435 DEFSUBR (Fwindow_hscroll); |
5521 #if 0 /* bogus RMS crock */ | 5436 #if 0 /* bogus RMS crock */ |
5522 defsubr (&Swindow_redisplay_end_trigger); | 5437 DEFSUBR (Fwindow_redisplay_end_trigger); |
5523 defsubr (&Sset_window_redisplay_end_trigger); | 5438 DEFSUBR (Fset_window_redisplay_end_trigger); |
5524 #endif | 5439 #endif |
5525 defsubr (&Sset_window_hscroll); | 5440 DEFSUBR (Fset_window_hscroll); |
5526 defsubr (&Swindow_pixel_edges); | 5441 DEFSUBR (Fwindow_pixel_edges); |
5527 defsubr (&Swindow_point); | 5442 DEFSUBR (Fwindow_point); |
5528 defsubr (&Swindow_start); | 5443 DEFSUBR (Fwindow_start); |
5529 defsubr (&Swindow_end); | 5444 DEFSUBR (Fwindow_end); |
5530 defsubr (&Sset_window_point); | 5445 DEFSUBR (Fset_window_point); |
5531 defsubr (&Sset_window_start); | 5446 DEFSUBR (Fset_window_start); |
5532 defsubr (&Swindow_dedicated_p); | 5447 DEFSUBR (Fwindow_dedicated_p); |
5533 defsubr (&Sset_window_dedicated_p); | 5448 DEFSUBR (Fset_window_dedicated_p); |
5534 defsubr (&Snext_window); | 5449 DEFSUBR (Fnext_window); |
5535 defsubr (&Sprevious_window); | 5450 DEFSUBR (Fprevious_window); |
5536 defsubr (&Snext_vertical_window); | 5451 DEFSUBR (Fnext_vertical_window); |
5537 defsubr (&Sother_window); | 5452 DEFSUBR (Fother_window); |
5538 defsubr (&Sget_lru_window); | 5453 DEFSUBR (Fget_lru_window); |
5539 defsubr (&Sget_largest_window); | 5454 DEFSUBR (Fget_largest_window); |
5540 defsubr (&Sget_buffer_window); | 5455 DEFSUBR (Fget_buffer_window); |
5541 defsubr (&Swindow_left_margin_pixel_width); | 5456 DEFSUBR (Fwindow_left_margin_pixel_width); |
5542 defsubr (&Swindow_right_margin_pixel_width); | 5457 DEFSUBR (Fwindow_right_margin_pixel_width); |
5543 defsubr (&Sdelete_other_windows); | 5458 DEFSUBR (Fdelete_other_windows); |
5544 defsubr (&Sdelete_windows_on); | 5459 DEFSUBR (Fdelete_windows_on); |
5545 defsubr (&Sreplace_buffer_in_windows); | 5460 DEFSUBR (Freplace_buffer_in_windows); |
5546 defsubr (&Sdelete_window); | 5461 DEFSUBR (Fdelete_window); |
5547 defsubr (&Sset_window_buffer); | 5462 DEFSUBR (Fset_window_buffer); |
5548 defsubr (&Sselect_window); | 5463 DEFSUBR (Fselect_window); |
5549 defsubr (&Ssplit_window); | 5464 DEFSUBR (Fsplit_window); |
5550 defsubr (&Senlarge_window); | 5465 DEFSUBR (Fenlarge_window); |
5551 defsubr (&Sshrink_window); | 5466 DEFSUBR (Fshrink_window); |
5552 defsubr (&Sscroll_up); | 5467 DEFSUBR (Fscroll_up); |
5553 defsubr (&Sscroll_down); | 5468 DEFSUBR (Fscroll_down); |
5554 defsubr (&Sscroll_left); | 5469 DEFSUBR (Fscroll_left); |
5555 defsubr (&Sscroll_right); | 5470 DEFSUBR (Fscroll_right); |
5556 defsubr (&Sother_window_for_scrolling); | 5471 DEFSUBR (Fother_window_for_scrolling); |
5557 defsubr (&Sscroll_other_window); | 5472 DEFSUBR (Fscroll_other_window); |
5558 defsubr (&Srecenter); | 5473 DEFSUBR (Frecenter); |
5559 defsubr (&Smove_to_window_line); | 5474 DEFSUBR (Fmove_to_window_line); |
5560 #ifdef MEMORY_USAGE_STATS | 5475 #ifdef MEMORY_USAGE_STATS |
5561 defsubr (&Swindow_memory_usage); | 5476 DEFSUBR (Fwindow_memory_usage); |
5562 #endif | 5477 #endif |
5563 defsubr (&Swindow_configuration_p); | 5478 DEFSUBR (Fwindow_configuration_p); |
5564 defsubr (&Sset_window_configuration); | 5479 DEFSUBR (Fset_window_configuration); |
5565 defsubr (&Scurrent_window_configuration); | 5480 DEFSUBR (Fcurrent_window_configuration); |
5566 defsubr (&Ssave_window_excursion); | 5481 DEFSUBR (Fsave_window_excursion); |
5567 } | 5482 } |
5568 | 5483 |
5569 void | 5484 void |
5570 vars_of_window (void) | 5485 vars_of_window (void) |
5571 { | 5486 { |