comparison src/redisplay.c @ 195:a2f645c6b9f8 r20-3b24

Import from CVS: tag r20-3b24
author cvs
date Mon, 13 Aug 2007 09:59:05 +0200
parents b405438285a2
children 41ff10fd062f
comparison
equal deleted inserted replaced
194:2947057885e5 195:a2f645c6b9f8
452 ('x is the only current possibility) */ 452 ('x is the only current possibility) */
453 Lisp_Object Vinitial_window_system; 453 Lisp_Object Vinitial_window_system;
454 454
455 Lisp_Object Vglobal_mode_string; 455 Lisp_Object Vglobal_mode_string;
456 456
457 /* The number of lines to try scrolling a 457 /* The number of lines scroll a window by when point leaves the window; if
458 window by when point leaves the window; if
459 it is <=0 then point is centered in the window */ 458 it is <=0 then point is centered in the window */
460 int scroll_step; 459 int scroll_step;
460
461 /* Scroll up to this many lines, to bring point back on screen. */
462 int scroll_conservatively;
461 463
462 /* Marker for where to display an arrow on top of the buffer text. */ 464 /* Marker for where to display an arrow on top of the buffer text. */
463 Lisp_Object Voverlay_arrow_position; 465 Lisp_Object Voverlay_arrow_position;
464 /* String to display for the arrow. */ 466 /* String to display for the arrow. */
465 Lisp_Object Voverlay_arrow_string; 467 Lisp_Object Voverlay_arrow_string;
5188 /* We still haven't gotten the window regenerated with point 5190 /* We still haven't gotten the window regenerated with point
5189 visible. Next we try scrolling a little and see if point comes 5191 visible. Next we try scrolling a little and see if point comes
5190 back onto the screen. */ 5192 back onto the screen. */
5191 if (scroll_step) 5193 if (scroll_step)
5192 { 5194 {
5193 startp = vmotion (w, startp, 5195 int scrolled = scroll_conservatively;
5194 (pointm < startp) ? -scroll_step : scroll_step, 0); 5196 for (; scrolled >= 0; scrolled -= scroll_step)
5195 regenerate_window (w, startp, pointm, DESIRED_DISP); 5197 {
5196 5198 startp = vmotion (w, startp,
5197 if (point_visible (w, pointm, DESIRED_DISP)) 5199 (pointm < startp) ? -scroll_step : scroll_step, 0);
5198 goto regeneration_done; 5200 regenerate_window (w, startp, pointm, DESIRED_DISP);
5201
5202 if (point_visible (w, pointm, DESIRED_DISP))
5203 goto regeneration_done;
5204 }
5199 } 5205 }
5200 5206
5201 /* We still haven't managed to get the screen drawn with point on 5207 /* We still haven't managed to get the screen drawn with point on
5202 the screen, so just center it and be done with it. */ 5208 the screen, so just center it and be done with it. */
5203 startp = regenerate_window_point_center (w, pointm, DESIRED_DISP); 5209 startp = regenerate_window_point_center (w, pointm, DESIRED_DISP);
8203 DEFVAR_INT ("scroll-step", &scroll_step /* 8209 DEFVAR_INT ("scroll-step", &scroll_step /*
8204 *The number of lines to try scrolling a window by when point moves out. 8210 *The number of lines to try scrolling a window by when point moves out.
8205 If that fails to bring point back on frame, point is centered instead. 8211 If that fails to bring point back on frame, point is centered instead.
8206 If this is zero, point is always centered after it moves off screen. 8212 If this is zero, point is always centered after it moves off screen.
8207 */ ); 8213 */ );
8214 scroll_step = 0;
8215
8216 DEFVAR_INT ("scroll-conservatively", &scroll_conservatively /*
8217 *Scroll up to this many lines, to bring point back on screen.
8218 */ );
8219 scroll_conservatively = 0;
8208 8220
8209 DEFVAR_BOOL_MAGIC ("truncate-partial-width-windows", 8221 DEFVAR_BOOL_MAGIC ("truncate-partial-width-windows",
8210 &truncate_partial_width_windows /* 8222 &truncate_partial_width_windows /*
8211 *Non-nil means truncate lines in all windows less than full frame wide. 8223 *Non-nil means truncate lines in all windows less than full frame wide.
8212 */ , 8224 */ ,