comparison src/window.c @ 173:8eaf7971accc r20-3b13

Import from CVS: tag r20-3b13
author cvs
date Mon, 13 Aug 2007 09:49:09 +0200
parents 538048ae2ab8
children 3d6bfa290dbd
comparison
equal deleted inserted replaced
172:a38aed19690b 173:8eaf7971accc
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);
216 return (Qnil); 216 return Qnil;
217 } 217 }
218 218
219 static void 219 static void
220 print_window (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 220 print_window (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
221 { 221 {
351 351
352 p->dedicated = Qnil; 352 p->dedicated = Qnil;
353 p->windows_changed = 1; 353 p->windows_changed = 1;
354 p->shadow_thickness_changed = 1; 354 p->shadow_thickness_changed = 1;
355 355
356 return (val); 356 return val;
357 } 357 }
358 #undef INIT_DISP_VARIABLE 358 #undef INIT_DISP_VARIABLE
359 359
360 /* 360 /*
361 * The redisplay structures used to be stored with each window. While 361 * The redisplay structures used to be stored with each window. While
947 if (margin_cwidth > window_cwidth) 947 if (margin_cwidth > window_cwidth)
948 margin_cwidth = window_cwidth; 948 margin_cwidth = window_cwidth;
949 949
950 /* At the user level the margin is always specified in characters. 950 /* At the user level the margin is always specified in characters.
951 Internally however it is manipulated in terms of pixels. */ 951 Internally however it is manipulated in terms of pixels. */
952 return (margin_cwidth * font_width); 952 return margin_cwidth * font_width;
953 } 953 }
954 954
955 int 955 int
956 window_left_margin_width (struct window *w) 956 window_left_margin_width (struct window *w)
957 { 957 {
1115 DEFUN ("windowp", Fwindowp, 1, 1, 0, /* 1115 DEFUN ("windowp", Fwindowp, 1, 1, 0, /*
1116 Return t if OBJ is a window. 1116 Return t if OBJ is a window.
1117 */ 1117 */
1118 (obj)) 1118 (obj))
1119 { 1119 {
1120 return (WINDOWP (obj) ? Qt : Qnil); 1120 return WINDOWP (obj) ? Qt : Qnil;
1121 } 1121 }
1122 1122
1123 DEFUN ("window-live-p", Fwindow_live_p, 1, 1, 0, /* 1123 DEFUN ("window-live-p", Fwindow_live_p, 1, 1, 0, /*
1124 Return t if OBJ is a window which is currently visible. 1124 Return t if OBJ is a window which is currently visible.
1125 */ 1125 */
1126 (obj)) 1126 (obj))
1127 { 1127 {
1128 return (WINDOWP (obj) && WINDOW_LIVE_P (XWINDOW (obj)) ? Qt : Qnil); 1128 return WINDOWP (obj) && WINDOW_LIVE_P (XWINDOW (obj)) ? Qt : Qnil;
1129 } 1129 }
1130 1130
1131 DEFUN ("selected-window", Fselected_window, 0, 1, 0, /* 1131 DEFUN ("selected-window", Fselected_window, 0, 1, 0, /*
1132 Return the window that the cursor now appears in and commands apply to. 1132 Return the window that the cursor now appears in and commands apply to.
1133 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return 1133 If the optional argument CON-DEV-OR-FRAME is specified and is a frame, return
1165 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /* 1165 DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /*
1166 Return non-nil if WINDOW is a minibuffer window. 1166 Return non-nil if WINDOW is a minibuffer window.
1167 */ 1167 */
1168 (window)) 1168 (window))
1169 { 1169 {
1170 return (MINI_WINDOW_P (decode_window (window)) ? Qt : Qnil); 1170 return MINI_WINDOW_P (decode_window (window)) ? Qt : Qnil;
1171 } 1171 }
1172 1172
1173 DEFUN ("window-first-hchild", Fwindow_first_hchild, 1, 1, 0, /* 1173 DEFUN ("window-first-hchild", Fwindow_first_hchild, 1, 1, 0, /*
1174 Return the first horizontal child of WINDOW, or nil. 1174 Return the first horizontal child of WINDOW, or nil.
1175 */ 1175 */
1339 Return the height of WINDOW in pixels. Defaults to current window. 1339 Return the height of WINDOW in pixels. Defaults to current window.
1340 This includes the window's modeline and horizontal scrollbar (if any). 1340 This includes the window's modeline and horizontal scrollbar (if any).
1341 */ 1341 */
1342 (window)) 1342 (window))
1343 { 1343 {
1344 return (make_int (decode_window (window)->pixel_height)); 1344 return make_int (decode_window (window)->pixel_height);
1345 } 1345 }
1346 1346
1347 DEFUN ("window-width", Fwindow_width, 0, 1, 0, /* 1347 DEFUN ("window-width", Fwindow_width, 0, 1, 0, /*
1348 Return the number of display columns in WINDOW. 1348 Return the number of display columns in WINDOW.
1349 This is the width that is usable columns available for text in WINDOW. 1349 This is the width that is usable columns available for text in WINDOW.
1350 */ 1350 */
1351 (window)) 1351 (window))
1352 { 1352 {
1353 return (make_int (window_char_width (decode_window (window), 0))); 1353 return make_int (window_char_width (decode_window (window), 0));
1354 } 1354 }
1355 1355
1356 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /* 1356 DEFUN ("window-pixel-width", Fwindow_pixel_width, 0, 1, 0, /*
1357 Return the width of WINDOW in pixels. Defaults to current window. 1357 Return the width of WINDOW in pixels. Defaults to current window.
1358 */ 1358 */
1359 (window)) 1359 (window))
1360 { 1360 {
1361 return (make_int (decode_window (window)->pixel_width)); 1361 return make_int (decode_window (window)->pixel_width);
1362 } 1362 }
1363 1363
1364 DEFUN ("window-hscroll", Fwindow_hscroll, 0, 1, 0, /* 1364 DEFUN ("window-hscroll", Fwindow_hscroll, 0, 1, 0, /*
1365 Return the number of columns by which WINDOW is scrolled from left margin. 1365 Return the number of columns by which WINDOW is scrolled from left margin.
1366 */ 1366 */
1367 (window)) 1367 (window))
1368 { 1368 {
1369 return (make_int (decode_window (window)->hscroll)); 1369 return make_int (decode_window (window)->hscroll);
1370 } 1370 }
1371 1371
1372 DEFUN ("set-window-hscroll", Fset_window_hscroll, 2, 2, 0, /* 1372 DEFUN ("set-window-hscroll", Fset_window_hscroll, 2, 2, 0, /*
1373 Set number of columns WINDOW is scrolled from left margin to NCOL. 1373 Set number of columns WINDOW is scrolled from left margin to NCOL.
1374 NCOL should be zero or positive. 1374 NCOL should be zero or positive.
1493 return value; 1493 return value;
1494 } 1494 }
1495 else 1495 else
1496 { 1496 {
1497 Bufpos startp = marker_position (w->start[CURRENT_DISP]); 1497 Bufpos startp = marker_position (w->start[CURRENT_DISP]);
1498 return (make_int (end_of_last_line (w, startp))); 1498 return make_int (end_of_last_line (w, startp));
1499 } 1499 }
1500 } 1500 }
1501 1501
1502 DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /* 1502 DEFUN ("set-window-point", Fset_window_point, 2, 2, 0, /*
1503 Make point value in WINDOW be at position POS in WINDOW's buffer. 1503 Make point value in WINDOW be at position POS in WINDOW's buffer.
2565 2565
2566 w = next_window; 2566 w = next_window;
2567 } 2567 }
2568 } 2568 }
2569 2569
2570 if (type == GET_BUFFER_WINDOW_COUNT) 2570 return type == GET_BUFFER_WINDOW_COUNT ? make_int (count) : best_window;
2571 return (make_int (count));
2572 else
2573 return (best_window);
2574 } 2571 }
2575 2572
2576 #if 0 /* not currently used */ 2573 #if 0 /* not currently used */
2577 2574
2578 int 2575 int
2649 2646
2650 /* At this point we damn well better have found something. */ 2647 /* At this point we damn well better have found something. */
2651 if (NILP (w)) abort (); 2648 if (NILP (w)) abort ();
2652 #endif 2649 #endif
2653 2650
2654 return (w); 2651 return w;
2655 } 2652 }
2656 2653
2657 DEFUN ("get-largest-window", Fget_largest_window, 0, 2, 0, /* 2654 DEFUN ("get-largest-window", Fget_largest_window, 0, 2, 0, /*
2658 Return the window largest in area. 2655 Return the window largest in area.
2659 If optional argument FRAME is `visible', search all visible frames. 2656 If optional argument FRAME is `visible', search all visible frames.
5030 #endif 5027 #endif
5031 } 5028 }
5032 else 5029 else
5033 set_frame_selected_window (f, config->current_window); 5030 set_frame_selected_window (f, config->current_window);
5034 } 5031 }
5032 else
5033 old_window_config = Qnil; /* Warning suppression */
5035 5034
5036 /* Restore the minimum heights recorded in the configuration. */ 5035 /* Restore the minimum heights recorded in the configuration. */
5037 window_min_height = config->min_height; 5036 window_min_height = config->min_height;
5038 window_min_width = config->min_width; 5037 window_min_width = config->min_width;
5039 5038