Mercurial > hg > xemacs-beta
comparison src/window.c @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | e04119814345 |
children | 0d2f883870bc |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
75 extern void energize_buffer_hidden_hook (); | 75 extern void energize_buffer_hidden_hook (); |
76 extern void energize_window_selected_hook (); | 76 extern void energize_window_selected_hook (); |
77 extern void energize_window_deselected_hook (); | 77 extern void energize_window_deselected_hook (); |
78 extern Lisp_Object desired_psheet_buffer (); | 78 extern Lisp_Object desired_psheet_buffer (); |
79 extern void make_psheets_desired (); | 79 extern void make_psheets_desired (); |
80 #endif /* ENERGIZE */ | 80 #endif |
81 | 81 |
82 /* Thickness of shadow border around 3d modelines. */ | 82 /* Thickness of shadow border around 3d modelines. */ |
83 Lisp_Object Vmodeline_shadow_thickness; | 83 Lisp_Object Vmodeline_shadow_thickness; |
84 | 84 |
85 /* Whether a modeline should be displayed. */ | 85 /* Whether a modeline should be displayed. */ |
100 Lisp_Object Vminibuf_scroll_window; | 100 Lisp_Object Vminibuf_scroll_window; |
101 | 101 |
102 /* Non-nil means this is the buffer whose window C-M-v should scroll. */ | 102 /* Non-nil means this is the buffer whose window C-M-v should scroll. */ |
103 Lisp_Object Vother_window_scroll_buffer; | 103 Lisp_Object Vother_window_scroll_buffer; |
104 | 104 |
105 /* Non-nil means it's the function to call to display temp buffers. */ | 105 /* Non-nil means it's function to call to display temp buffers. */ |
106 Lisp_Object Vtemp_buffer_show_function; | 106 Lisp_Object Vtemp_buffer_show_function; |
107 | 107 |
108 Lisp_Object Vtemp_buffer_show_hook; | 108 Lisp_Object Vtemp_buffer_show_hook; |
109 | 109 |
110 /* If a window gets smaller than either of these, it is removed. */ | 110 /* If a window gets smaller than either of these, it is removed. */ |
142 static void finalize_window (void *header, int for_disksave); | 142 static void finalize_window (void *header, int for_disksave); |
143 DEFINE_LRECORD_IMPLEMENTATION ("window", window, | 143 DEFINE_LRECORD_IMPLEMENTATION ("window", window, |
144 mark_window, print_window, finalize_window, | 144 mark_window, print_window, finalize_window, |
145 0, 0, struct window); | 145 0, 0, struct window); |
146 | 146 |
147 #define MARK_DISP_VARIABLE(field) \ | 147 #define MARK_DISP_VARIABLE(field) \ |
148 ((markobj) (window->field[CURRENT_DISP])); \ | 148 ((markobj) (window->field[CURRENT_DISP])); \ |
149 ((markobj) (window->field[DESIRED_DISP])); \ | 149 ((markobj) (window->field[DESIRED_DISP])); \ |
150 ((markobj) (window->field[CMOTION_DISP])); | 150 ((markobj) (window->field[CMOTION_DISP])); |
151 | 151 |
152 static Lisp_Object | 152 static Lisp_Object |
153 mark_window (Lisp_Object obj, void (*markobj) (Lisp_Object)) | 153 mark_window (Lisp_Object obj, void (*markobj) (Lisp_Object)) |
154 { | 154 { |
177 ((markobj) (window->modeline_shadow_thickness)); | 177 ((markobj) (window->modeline_shadow_thickness)); |
178 #ifdef HAVE_SCROLLBARS | 178 #ifdef HAVE_SCROLLBARS |
179 ((markobj) (window->scrollbar_width)); | 179 ((markobj) (window->scrollbar_width)); |
180 ((markobj) (window->scrollbar_height)); | 180 ((markobj) (window->scrollbar_height)); |
181 ((markobj) (window->scrollbar_pointer)); | 181 ((markobj) (window->scrollbar_pointer)); |
182 #endif /* HAVE_SCROLLBARS */ | 182 #endif |
183 ((markobj) (window->left_margin_width)); | 183 ((markobj) (window->left_margin_width)); |
184 ((markobj) (window->right_margin_width)); | 184 ((markobj) (window->right_margin_width)); |
185 #ifdef HAVE_TOOLBARS | 185 #ifdef HAVE_TOOLBARS |
186 ((markobj) (window->toolbar[0])); | 186 ((markobj) (window->toolbar[0])); |
187 ((markobj) (window->toolbar[1])); | 187 ((markobj) (window->toolbar[1])); |
198 ((markobj) (window->toolbar_buttons_captioned_p)); | 198 ((markobj) (window->toolbar_buttons_captioned_p)); |
199 ((markobj) (window->default_toolbar)); | 199 ((markobj) (window->default_toolbar)); |
200 ((markobj) (window->default_toolbar_height)); | 200 ((markobj) (window->default_toolbar_height)); |
201 ((markobj) (window->default_toolbar_width)); | 201 ((markobj) (window->default_toolbar_width)); |
202 ((markobj) (window->default_toolbar_visible_p)); | 202 ((markobj) (window->default_toolbar_visible_p)); |
203 #endif /* HAVE_TOOLBARS */ | 203 #endif |
204 ((markobj) (window->minimum_line_ascent)); | 204 ((markobj) (window->minimum_line_ascent)); |
205 ((markobj) (window->minimum_line_descent)); | 205 ((markobj) (window->minimum_line_descent)); |
206 ((markobj) (window->use_left_overflow)); | 206 ((markobj) (window->use_left_overflow)); |
207 ((markobj) (window->use_right_overflow)); | 207 ((markobj) (window->use_right_overflow)); |
208 #ifdef HAVE_MENUBARS | 208 #ifdef HAVE_MENUBARS |
209 ((markobj) (window->menubar_visible_p)); | 209 ((markobj) (window->menubar_visible_p)); |
210 #endif /* HAVE_MENUBARS */ | 210 #endif |
211 ((markobj) (window->text_cursor_visible_p)); | 211 ((markobj) (window->text_cursor_visible_p)); |
212 /* End cached specifiers. */ | 212 /* End cached specifiers. */ |
213 ((markobj) (window->dedicated)); | 213 ((markobj) (window->dedicated)); |
214 mark_face_cachels (window->face_cachels, markobj); | 214 mark_face_cachels (window->face_cachels, markobj); |
215 mark_glyph_cachels (window->glyph_cachels, markobj); | 215 mark_glyph_cachels (window->glyph_cachels, markobj); |
374 * It also becomes a convenient place to stick scrollbar instances | 374 * It also becomes a convenient place to stick scrollbar instances |
375 * since they extrapolate out to having the same problem described for | 375 * since they extrapolate out to having the same problem described for |
376 * the display structures. | 376 * the display structures. |
377 */ | 377 */ |
378 | 378 |
379 /* Create a new window mirror structure and associated redisplay | 379 /* Create a new mindow mirror structure and associated redisplay |
380 structs. */ | 380 structs. */ |
381 static struct window_mirror * | 381 static struct window_mirror * |
382 new_window_mirror (struct frame *f) | 382 new_window_mirror (struct frame *f) |
383 { | 383 { |
384 struct window_mirror *t; | 384 struct window_mirror *t; |
418 } | 418 } |
419 else | 419 else |
420 if (!mir) | 420 if (!mir) |
421 mir = new_window_mirror (XFRAME (XWINDOW (win)->frame)); | 421 mir = new_window_mirror (XFRAME (XWINDOW (win)->frame)); |
422 | 422 |
423 mir->next = update_mirror_internal (XWINDOW (win)->next, mir->next); | 423 mir->next = update_mirror_internal (XWINDOW (win)->next, mir->next); |
424 mir->hchild = update_mirror_internal (XWINDOW (win)->hchild, mir->hchild); | 424 mir->hchild = update_mirror_internal (XWINDOW (win)->hchild, mir->hchild); |
425 mir->vchild = update_mirror_internal (XWINDOW (win)->vchild, mir->vchild); | 425 mir->vchild = update_mirror_internal (XWINDOW (win)->vchild, mir->vchild); |
426 | 426 |
427 /* | 427 /* |
428 * If the redisplay structs are not empty and the mirror has | 428 * If the redisplay structs are not empty and the mirror has |
648 | 648 |
649 t->buffer = b; | 649 t->buffer = b; |
650 } | 650 } |
651 | 651 |
652 | 652 |
653 /* Determining a window's position based solely on its pixel | 653 /* Determining a windows position based solely on its pixel |
654 positioning doesn't work. Instead, we do it the intelligent way, | 654 positioning doesn't work. Instead, we do it the intelligent way, |
655 by checking its positioning in the window hierarchy. */ | 655 by checking its positioning in the window hierarchy. */ |
656 int | 656 int |
657 window_is_leftmost (struct window *w) | 657 window_is_leftmost (struct window *w) |
658 { | 658 { |
802 } | 802 } |
803 else | 803 else |
804 return 0; | 804 return 0; |
805 #else | 805 #else |
806 return (!window_is_leftmost (w)); | 806 return (!window_is_leftmost (w)); |
807 #endif /* HAVE_SCROLLBARS */ | 807 #endif |
808 } | 808 } |
809 | 809 |
810 int | 810 int |
811 window_scrollbar_width (struct window *w) | 811 window_scrollbar_width (struct window *w) |
812 { | 812 { |
818 return 0; | 818 return 0; |
819 | 819 |
820 return XINT (w->scrollbar_width); | 820 return XINT (w->scrollbar_width); |
821 #else | 821 #else |
822 return 0; | 822 return 0; |
823 #endif /* HAVE_SCROLLBARS */ | 823 #endif |
824 } | 824 } |
825 | 825 |
826 /* Horizontal scrollbars are only active on windows with truncation | 826 /* Horizontal scrollbars are only active on windows with truncation |
827 turned on. */ | 827 turned on. */ |
828 int | 828 int |
836 return 0; | 836 return 0; |
837 | 837 |
838 return XINT (w->scrollbar_height); | 838 return XINT (w->scrollbar_height); |
839 #else | 839 #else |
840 return 0; | 840 return 0; |
841 #endif /* HAVE_SCROLLBARS */ | 841 #endif |
842 } | 842 } |
843 | 843 |
844 int | 844 int |
845 window_modeline_height (struct window *w) | 845 window_modeline_height (struct window *w) |
846 { | 846 { |
1172 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /* | 1172 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /* |
1173 Return non-nil if WINDOW is a minibuffer window. | 1173 Return non-nil if WINDOW is a minibuffer window. |
1174 */ | 1174 */ |
1175 (window)) | 1175 (window)) |
1176 { | 1176 { |
1177 return (MINI_WINDOW_P (decode_window (window)) ? Qt : Qnil); | 1177 struct window *w = decode_window (window); |
1178 return (MINI_WINDOW_P (w) ? Qt : Qnil); | |
1178 } | 1179 } |
1179 | 1180 |
1180 DEFUN ("window-first-hchild", Fwindow_first_hchild, 1, 1, 0, /* | 1181 DEFUN ("window-first-hchild", Fwindow_first_hchild, 1, 1, 0, /* |
1181 Return the first horizontal child of WINDOW, or nil. | 1182 Return the first horizontal child of WINDOW, or nil. |
1182 */ | 1183 */ |
1183 (window)) | 1184 (window)) |
1184 { | 1185 { |
1185 return decode_window (window)->hchild; | 1186 struct window *w = decode_window (window); |
1187 return w->hchild; | |
1186 } | 1188 } |
1187 | 1189 |
1188 DEFUN ("window-first-vchild", Fwindow_first_vchild, 1, 1, 0, /* | 1190 DEFUN ("window-first-vchild", Fwindow_first_vchild, 1, 1, 0, /* |
1189 Return the first vertical child of WINDOW, or nil. | 1191 Return the first vertical child of WINDOW, or nil. |
1190 */ | 1192 */ |
1191 (window)) | 1193 (window)) |
1192 { | 1194 { |
1193 return decode_window (window)->vchild; | 1195 struct window *w = decode_window (window); |
1196 return w->vchild; | |
1194 } | 1197 } |
1195 | 1198 |
1196 DEFUN ("window-next-child", Fwindow_next_child, 1, 1, 0, /* | 1199 DEFUN ("window-next-child", Fwindow_next_child, 1, 1, 0, /* |
1197 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. |
1198 */ | 1201 */ |
1199 (window)) | 1202 (window)) |
1200 { | 1203 { |
1201 return decode_window (window)->next; | 1204 struct window *w = decode_window (window); |
1205 return w->next; | |
1202 } | 1206 } |
1203 | 1207 |
1204 DEFUN ("window-previous-child", Fwindow_previous_child, 1, 1, 0, /* | 1208 DEFUN ("window-previous-child", Fwindow_previous_child, 1, 1, 0, /* |
1205 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. |
1206 */ | 1210 */ |
1207 (window)) | 1211 (window)) |
1208 { | 1212 { |
1209 return decode_window (window)->prev; | 1213 struct window *w = decode_window (window); |
1214 return w->prev; | |
1210 } | 1215 } |
1211 | 1216 |
1212 DEFUN ("window-parent", Fwindow_parent, 1, 1, 0, /* | 1217 DEFUN ("window-parent", Fwindow_parent, 1, 1, 0, /* |
1213 Return the parent of WINDOW, or nil. | 1218 Return the parent of WINDOW, or nil. |
1214 */ | 1219 */ |
1215 (window)) | 1220 (window)) |
1216 { | 1221 { |
1217 return decode_window (window)->parent; | 1222 struct window *w = decode_window (window); |
1223 return w->parent; | |
1218 } | 1224 } |
1219 | 1225 |
1220 DEFUN ("window-lowest-p", Fwindow_lowest_p, 1, 1, 0, /* | 1226 DEFUN ("window-lowest-p", Fwindow_lowest_p, 1, 1, 0, /* |
1221 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. |
1222 */ | 1228 */ |
1223 (window)) | 1229 (window)) |
1224 { | 1230 { |
1225 return window_is_lowest (decode_window (window)) ? Qt : Qnil; | 1231 struct window *w = decode_window (window); |
1232 return window_is_lowest (w) ? Qt : Qnil; | |
1226 } | 1233 } |
1227 | 1234 |
1228 DEFUN ("window-highest-p", Fwindow_highest_p, 1, 1, 0, /* | 1235 DEFUN ("window-highest-p", Fwindow_highest_p, 1, 1, 0, /* |
1229 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. |
1230 */ | 1237 */ |
1231 (window)) | 1238 (window)) |
1232 { | 1239 { |
1233 return window_is_highest (decode_window (window)) ? Qt : Qnil; | 1240 struct window *w = decode_window (window); |
1241 return window_is_highest (w) ? Qt : Qnil; | |
1234 } | 1242 } |
1235 | 1243 |
1236 DEFUN ("window-leftmost-p", Fwindow_leftmost_p, 1, 1, 0, /* | 1244 DEFUN ("window-leftmost-p", Fwindow_leftmost_p, 1, 1, 0, /* |
1237 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. |
1238 */ | 1246 */ |
1239 (window)) | 1247 (window)) |
1240 { | 1248 { |
1241 return window_is_leftmost (decode_window (window)) ? Qt : Qnil; | 1249 struct window *w = decode_window (window); |
1250 return window_is_leftmost (w) ? Qt : Qnil; | |
1242 } | 1251 } |
1243 | 1252 |
1244 DEFUN ("window-rightmost-p", Fwindow_rightmost_p, 1, 1, 0, /* | 1253 DEFUN ("window-rightmost-p", Fwindow_rightmost_p, 1, 1, 0, /* |
1245 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. |
1246 */ | 1255 */ |
1247 (window)) | 1256 (window)) |
1248 { | 1257 { |
1249 return window_is_rightmost (decode_window (window)) ? Qt : Qnil; | 1258 struct window *w = decode_window (window); |
1259 return window_is_rightmost (w) ? Qt : Qnil; | |
1250 } | 1260 } |
1251 | 1261 |
1252 DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, 0, 2, 0, /* | 1262 DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, 0, 2, 0, /* |
1253 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. |
1254 Returns nil if that position is scrolled vertically out of view. | 1264 Returns nil if that position is scrolled vertically out of view. |
1255 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. |
1256 */ | 1266 */ |
1257 (pos, window)) | 1267 (pos, window)) |
1258 { | 1268 { |
1259 struct window *w = decode_window (window); | 1269 struct window *w; |
1260 Bufpos top; | 1270 Bufpos top; |
1261 Bufpos posint; | 1271 Bufpos posint; |
1262 struct buffer *buf; | 1272 struct buffer *buf; |
1263 | 1273 |
1274 w = decode_window (window); | |
1264 top = marker_position (w->start[CURRENT_DISP]); | 1275 top = marker_position (w->start[CURRENT_DISP]); |
1265 | 1276 |
1266 buf = XBUFFER (w->buffer); | 1277 buf = XBUFFER (w->buffer); |
1267 | 1278 |
1268 if (NILP (pos)) | 1279 if (NILP (pos)) |
1335 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 |
1336 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 |
1337 function pretends that there are lines of text in the default | 1348 function pretends that there are lines of text in the default |
1338 font there. | 1349 font there. |
1339 */ | 1350 */ |
1340 (window)) | 1351 (window)) |
1341 { | 1352 { |
1342 return make_int (window_displayed_height (decode_window (window))); | 1353 return make_int (window_displayed_height (decode_window (window))); |
1343 } | 1354 } |
1344 | 1355 |
1345 DEFUN ("window-pixel-height", Fwindow_pixel_height, 0, 1, 0, /* | 1356 DEFUN ("window-pixel-height", Fwindow_pixel_height, 0, 1, 0, /* |
1355 Return the number of display columns in WINDOW. | 1366 Return the number of display columns in WINDOW. |
1356 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. |
1357 */ | 1368 */ |
1358 (window)) | 1369 (window)) |
1359 { | 1370 { |
1360 return (make_int (window_char_width (decode_window (window), 0))); | 1371 struct window *w = decode_window (window); |
1372 return (make_int (window_char_width (w, 0))); | |
1361 } | 1373 } |
1362 | 1374 |
1363 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /* | 1375 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /* |
1364 Return the width of WINDOW in pixels. Defaults to current window. | 1376 Return the width of WINDOW in pixels. Defaults to current window. |
1365 */ | 1377 */ |
1395 return ncol; | 1407 return ncol; |
1396 } | 1408 } |
1397 | 1409 |
1398 #if 0 /* bogus RMS crock */ | 1410 #if 0 /* bogus RMS crock */ |
1399 | 1411 |
1400 xxDEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, 0, 1, 0 /* | 1412 xxDEFUN ("window-redisplay-end-trigger", Fwindow_redisplay_end_trigger, |
1413 Swindow_redisplay_end_trigger, 0, 1, 0 /* | |
1401 Return WINDOW's redisplay end trigger value. | 1414 Return WINDOW's redisplay end trigger value. |
1402 See `set-window-redisplay-end-trigger' for more information. | 1415 See `set-window-redisplay-end-trigger' for more information. |
1403 */ | 1416 */ ) |
1404 (window)) | 1417 (window) |
1418 Lisp_Object window; | |
1405 { | 1419 { |
1406 return decode_window (window)->redisplay_end_trigger; | 1420 return decode_window (window)->redisplay_end_trigger; |
1407 } | 1421 } |
1408 | 1422 |
1409 xxDEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, 2, 2, 0 /* | 1423 xxDEFUN ("set-window-redisplay-end-trigger", Fset_window_redisplay_end_trigger, |
1424 Sset_window_redisplay_end_trigger, 2, 2, 0 /* | |
1410 Set WINDOW's redisplay end trigger value to VALUE. | 1425 Set WINDOW's redisplay end trigger value to VALUE. |
1411 VALUE should be a buffer position (typically a marker) or nil. | 1426 VALUE should be a buffer position (typically a marker) or nil. |
1412 If it is a buffer position, then if redisplay in WINDOW reaches a position | 1427 If it is a buffer position, then if redisplay in WINDOW reaches a position |
1413 beyond VALUE, the functions in `redisplay-end-trigger-functions' are called | 1428 beyond VALUE, the functions in `redisplay-end-trigger-functions' are called |
1414 with two arguments: WINDOW, and the end trigger value. | 1429 with two arguments: WINDOW, and the end trigger value. |
1415 Afterwards the end-trigger value is reset to nil. | 1430 Afterwards the end-trigger value is reset to nil. |
1416 */ | 1431 */ ) |
1417 (window, value)) | 1432 (window, value) |
1418 { | 1433 register Lisp_Object window, value; |
1419 return (decode_window (window)->redisplay_end_trigger = value); | 1434 { |
1435 register struct window *w; | |
1436 | |
1437 w = decode_window (window); | |
1438 w->redisplay_end_trigger = value; | |
1439 return value; | |
1420 } | 1440 } |
1421 | 1441 |
1422 #endif /* 0 */ | 1442 #endif /* 0 */ |
1423 | 1443 |
1424 DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* | 1444 DEFUN ("window-pixel-edges", Fwindow_pixel_edges, 0, 1, 0, /* |
1901 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 |
1902 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 |
1903 windows, eventually ending up back at the window you started with. | 1923 windows, eventually ending up back at the window you started with. |
1904 `previous-window' traverses the same cycle, in the reverse order. | 1924 `previous-window' traverses the same cycle, in the reverse order. |
1905 */ | 1925 */ |
1906 (window, minibuf, all_frames, console)) | 1926 (window, minibuf, all_frames, console)) |
1907 { | 1927 { |
1908 Lisp_Object tem; | 1928 Lisp_Object tem; |
1909 Lisp_Object start_window; | 1929 Lisp_Object start_window; |
1910 | 1930 |
1911 if (NILP (window)) | 1931 if (NILP (window)) |
2010 | 2030 |
2011 return window; | 2031 return window; |
2012 } | 2032 } |
2013 | 2033 |
2014 DEFUN ("previous-window", Fprevious_window, 0, 4, 0, /* | 2034 DEFUN ("previous-window", Fprevious_window, 0, 4, 0, /* |
2015 Return the window preceding WINDOW in canonical ordering of windows. | 2035 Return the window preceeding WINDOW in canonical ordering of windows. |
2016 If omitted, WINDOW defaults to the selected window. | 2036 If omitted, WINDOW defaults to the selected window. |
2017 | 2037 |
2018 Optional second arg MINIBUF t means count the minibuffer window even | 2038 Optional second arg MINIBUF t means count the minibuffer window even |
2019 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 |
2020 it is active. MINIBUF neither t nor nil means not to count the | 2040 it is active. MINIBUF neither t nor nil means not to count the |
2044 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 |
2045 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 |
2046 windows, eventually ending up back at the window you started with. | 2066 windows, eventually ending up back at the window you started with. |
2047 `next-window' traverses the same cycle, in the reverse order. | 2067 `next-window' traverses the same cycle, in the reverse order. |
2048 */ | 2068 */ |
2049 (window, minibuf, all_frames, console)) | 2069 (window, minibuf, all_frames, console)) |
2050 { | 2070 { |
2051 Lisp_Object tem; | 2071 Lisp_Object tem; |
2052 Lisp_Object start_window; | 2072 Lisp_Object start_window; |
2053 | 2073 |
2054 if (NILP (window)) | 2074 if (NILP (window)) |
2155 else break; | 2175 else break; |
2156 while (tem = XWINDOW (window)->next, !NILP (tem)) | 2176 while (tem = XWINDOW (window)->next, !NILP (tem)) |
2157 window = tem; | 2177 window = tem; |
2158 } | 2178 } |
2159 } | 2179 } |
2180 /* "acceptable" is the correct spelling. */ | |
2160 /* Which windows are acceptable? | 2181 /* Which windows are acceptable? |
2161 Exit the loop and accept this window if | 2182 Exit the loop and accept this window if |
2162 this isn't a minibuffer window, | 2183 this isn't a minibuffer window, |
2163 or we're accepting all minibuffer windows, | 2184 or we're accepting all minibuffer windows, |
2164 or this is the active minibuffer and we are accepting that one, or | 2185 or this is the active minibuffer and we are accepting that one, or |
4018 } | 4039 } |
4019 } | 4040 } |
4020 | 4041 |
4021 } | 4042 } |
4022 | 4043 |
4023 extern int signal_error_on_buffer_boundary; | |
4024 | |
4025 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /* | 4044 DEFUN ("scroll-up", Fscroll_up, 0, 1, "_P", /* |
4026 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. |
4027 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. |
4028 Negative ARG means scroll downward. | 4047 Negative ARG means scroll downward. |
4029 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. |
4030 | |
4031 If `signal-error-on-buffer-boundary' is nil, the usual error and | |
4032 loss of zmacs region is suppressed when moving past end of buffer. | |
4033 */ | 4049 */ |
4034 (n)) | 4050 (n)) |
4035 { | 4051 { |
4036 Error_behavior errb = | 4052 window_scroll (Fselected_window (Qnil), n, 1, ERROR_ME); |
4037 signal_error_on_buffer_boundary ? ERROR_ME : ERROR_ME_NOT; | |
4038 | |
4039 window_scroll (Fselected_window (Qnil), n, 1, errb); | |
4040 return Qnil; | 4053 return Qnil; |
4041 } | 4054 } |
4042 | 4055 |
4043 DEFUN ("scroll-down", Fscroll_down, 0, 1, "_P", /* | 4056 DEFUN ("scroll-down", Fscroll_down, 0, 1, "_P", /* |
4044 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. |
4045 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. |
4046 Negative ARG means scroll upward. | 4059 Negative ARG means scroll upward. |
4047 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. |
4048 | |
4049 If `signal-error-on-buffer-boundary' is nil, the usual error and | |
4050 loss of zmacs region is suppressed when moving past end of buffer. | |
4051 */ | 4061 */ |
4052 (n)) | 4062 (n)) |
4053 { | 4063 { |
4054 Error_behavior errb = | 4064 window_scroll (Fselected_window (Qnil), n, -1, ERROR_ME); |
4055 signal_error_on_buffer_boundary ? ERROR_ME : ERROR_ME_NOT; | |
4056 | |
4057 window_scroll (Fselected_window (Qnil), n, -1, errb); | |
4058 return Qnil; | 4065 return Qnil; |
4059 } | 4066 } |
4060 | 4067 |
4061 DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, 0, 0, 0, /* | 4068 DEFUN ("other-window-for-scrolling", Fother_window_for_scrolling, 0, 0, 0, /* |
4062 Return the other window for \"other window scroll\" commands. | 4069 Return the other window for \"other window scroll\" commands. |