diff options
| author | Tom Tromey | 2011-01-18 10:34:08 -0700 |
|---|---|---|
| committer | Tom Tromey | 2011-01-18 10:34:08 -0700 |
| commit | 8442d95df1495762b1793ad160a5c52b89c531f9 (patch) | |
| tree | ea5779c23344ebb0760ad404d170a4c937822c4e /src | |
| parent | cab0ba989e31c0ba8272adc1dbb2615f61ecb35f (diff) | |
| download | emacs-8442d95df1495762b1793ad160a5c52b89c531f9.tar.gz emacs-8442d95df1495762b1793ad160a5c52b89c531f9.zip | |
* xdisp.c (emacs_scroll_step): Rename from scroll_step.
(try_scrolling): Rename argument to 'arg_scroll_conservatively'.
(redisplay_window): Update.
(syms_of_xdisp): Update.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 30 |
2 files changed, 22 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 1b9655e9605..fc1e8054e13 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2011-01-18 Tom Tromey <tromey@redhat.com> | 1 | 2011-01-18 Tom Tromey <tromey@redhat.com> |
| 2 | 2 | ||
| 3 | * xdisp.c (emacs_scroll_step): Rename from scroll_step. | ||
| 4 | (try_scrolling): Rename argument to 'arg_scroll_conservatively'. | ||
| 5 | (redisplay_window): Update. | ||
| 6 | (syms_of_xdisp): Update. | ||
| 7 | |||
| 8 | 2011-01-18 Tom Tromey <tromey@redhat.com> | ||
| 9 | |||
| 3 | * gtkutil.h (x_gtk_use_old_file_dialog, x_gtk_show_hidden_files) | 10 | * gtkutil.h (x_gtk_use_old_file_dialog, x_gtk_show_hidden_files) |
| 4 | (x_gtk_file_dialog_help_text, x_gtk_whole_detached_tool_bar): | 11 | (x_gtk_file_dialog_help_text, x_gtk_whole_detached_tool_bar): |
| 5 | Declare. | 12 | Declare. |
diff --git a/src/xdisp.c b/src/xdisp.c index f7df35d059d..6be74937483 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -593,7 +593,7 @@ int highlight_nonselected_windows; | |||
| 593 | /* If cursor motion alone moves point off frame, try scrolling this | 593 | /* If cursor motion alone moves point off frame, try scrolling this |
| 594 | many lines up or down if that will bring it back. */ | 594 | many lines up or down if that will bring it back. */ |
| 595 | 595 | ||
| 596 | static EMACS_INT scroll_step; | 596 | static EMACS_INT emacs_scroll_step; |
| 597 | 597 | ||
| 598 | /* Nonzero means scroll just far enough to bring point back on the | 598 | /* Nonzero means scroll just far enough to bring point back on the |
| 599 | screen, when appropriate. */ | 599 | screen, when appropriate. */ |
| @@ -13166,7 +13166,7 @@ cursor_row_fully_visible_p (struct window *w, int force_p, int current_matrix_p) | |||
| 13166 | 13166 | ||
| 13167 | /* Try scrolling PT into view in window WINDOW. JUST_THIS_ONE_P | 13167 | /* Try scrolling PT into view in window WINDOW. JUST_THIS_ONE_P |
| 13168 | non-zero means only WINDOW is redisplayed in redisplay_internal. | 13168 | non-zero means only WINDOW is redisplayed in redisplay_internal. |
| 13169 | TEMP_SCROLL_STEP has the same meaning as scroll_step, and is used | 13169 | TEMP_SCROLL_STEP has the same meaning as emacs_scroll_step, and is used |
| 13170 | in redisplay_window to bring a partially visible line into view in | 13170 | in redisplay_window to bring a partially visible line into view in |
| 13171 | the case that only the cursor has moved. | 13171 | the case that only the cursor has moved. |
| 13172 | 13172 | ||
| @@ -13191,7 +13191,7 @@ enum | |||
| 13191 | 13191 | ||
| 13192 | static int | 13192 | static int |
| 13193 | try_scrolling (Lisp_Object window, int just_this_one_p, | 13193 | try_scrolling (Lisp_Object window, int just_this_one_p, |
| 13194 | EMACS_INT scroll_conservatively, EMACS_INT scroll_step, | 13194 | EMACS_INT arg_scroll_conservatively, EMACS_INT scroll_step, |
| 13195 | int temp_scroll_step, int last_line_misfit) | 13195 | int temp_scroll_step, int last_line_misfit) |
| 13196 | { | 13196 | { |
| 13197 | struct window *w = XWINDOW (window); | 13197 | struct window *w = XWINDOW (window); |
| @@ -13218,20 +13218,20 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13218 | else | 13218 | else |
| 13219 | this_scroll_margin = 0; | 13219 | this_scroll_margin = 0; |
| 13220 | 13220 | ||
| 13221 | /* Force scroll_conservatively to have a reasonable value, to avoid | 13221 | /* Force arg_scroll_conservatively to have a reasonable value, to avoid |
| 13222 | overflow while computing how much to scroll. Note that the user | 13222 | overflow while computing how much to scroll. Note that the user |
| 13223 | can supply scroll-conservatively equal to `most-positive-fixnum', | 13223 | can supply scroll-conservatively equal to `most-positive-fixnum', |
| 13224 | which can be larger than INT_MAX. */ | 13224 | which can be larger than INT_MAX. */ |
| 13225 | if (scroll_conservatively > scroll_limit) | 13225 | if (arg_scroll_conservatively > scroll_limit) |
| 13226 | { | 13226 | { |
| 13227 | scroll_conservatively = scroll_limit; | 13227 | arg_scroll_conservatively = scroll_limit; |
| 13228 | scroll_max = INT_MAX; | 13228 | scroll_max = INT_MAX; |
| 13229 | } | 13229 | } |
| 13230 | else if (scroll_step || scroll_conservatively || temp_scroll_step) | 13230 | else if (scroll_step || arg_scroll_conservatively || temp_scroll_step) |
| 13231 | /* Compute how much we should try to scroll maximally to bring | 13231 | /* Compute how much we should try to scroll maximally to bring |
| 13232 | point into view. */ | 13232 | point into view. */ |
| 13233 | scroll_max = (max (scroll_step, | 13233 | scroll_max = (max (scroll_step, |
| 13234 | max (scroll_conservatively, temp_scroll_step)) | 13234 | max (arg_scroll_conservatively, temp_scroll_step)) |
| 13235 | * FRAME_LINE_HEIGHT (f)); | 13235 | * FRAME_LINE_HEIGHT (f)); |
| 13236 | else if (NUMBERP (current_buffer->scroll_down_aggressively) | 13236 | else if (NUMBERP (current_buffer->scroll_down_aggressively) |
| 13237 | || NUMBERP (current_buffer->scroll_up_aggressively)) | 13237 | || NUMBERP (current_buffer->scroll_up_aggressively)) |
| @@ -13262,7 +13262,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13262 | /* Compute how many pixels below window bottom to stop searching | 13262 | /* Compute how many pixels below window bottom to stop searching |
| 13263 | for PT. This avoids costly search for PT that is far away if | 13263 | for PT. This avoids costly search for PT that is far away if |
| 13264 | the user limited scrolling by a small number of lines, but | 13264 | the user limited scrolling by a small number of lines, but |
| 13265 | always finds PT if scroll_conservatively is set to a large | 13265 | always finds PT if arg_scroll_conservatively is set to a large |
| 13266 | number, such as most-positive-fixnum. */ | 13266 | number, such as most-positive-fixnum. */ |
| 13267 | int slack = max (scroll_max, 10 * FRAME_LINE_HEIGHT (f)); | 13267 | int slack = max (scroll_max, 10 * FRAME_LINE_HEIGHT (f)); |
| 13268 | int y_to_move = | 13268 | int y_to_move = |
| @@ -13291,10 +13291,10 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13291 | window start down. If scrolling conservatively, move it just | 13291 | window start down. If scrolling conservatively, move it just |
| 13292 | enough down to make point visible. If scroll_step is set, | 13292 | enough down to make point visible. If scroll_step is set, |
| 13293 | move it down by scroll_step. */ | 13293 | move it down by scroll_step. */ |
| 13294 | if (scroll_conservatively) | 13294 | if (arg_scroll_conservatively) |
| 13295 | amount_to_scroll | 13295 | amount_to_scroll |
| 13296 | = min (max (dy, FRAME_LINE_HEIGHT (f)), | 13296 | = min (max (dy, FRAME_LINE_HEIGHT (f)), |
| 13297 | FRAME_LINE_HEIGHT (f) * scroll_conservatively); | 13297 | FRAME_LINE_HEIGHT (f) * arg_scroll_conservatively); |
| 13298 | else if (scroll_step || temp_scroll_step) | 13298 | else if (scroll_step || temp_scroll_step) |
| 13299 | amount_to_scroll = scroll_max; | 13299 | amount_to_scroll = scroll_max; |
| 13300 | else | 13300 | else |
| @@ -13375,7 +13375,7 @@ try_scrolling (Lisp_Object window, int just_this_one_p, | |||
| 13375 | /* Compute new window start. */ | 13375 | /* Compute new window start. */ |
| 13376 | start_display (&it, w, startp); | 13376 | start_display (&it, w, startp); |
| 13377 | 13377 | ||
| 13378 | if (scroll_conservatively) | 13378 | if (arg_scroll_conservatively) |
| 13379 | amount_to_scroll | 13379 | amount_to_scroll |
| 13380 | = max (dy, FRAME_LINE_HEIGHT (f) * max (scroll_step, temp_scroll_step)); | 13380 | = max (dy, FRAME_LINE_HEIGHT (f) * max (scroll_step, temp_scroll_step)); |
| 13381 | else if (scroll_step || temp_scroll_step) | 13381 | else if (scroll_step || temp_scroll_step) |
| @@ -14359,7 +14359,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 14359 | 14359 | ||
| 14360 | /* Try to scroll by specified few lines. */ | 14360 | /* Try to scroll by specified few lines. */ |
| 14361 | if ((scroll_conservatively | 14361 | if ((scroll_conservatively |
| 14362 | || scroll_step | 14362 | || emacs_scroll_step |
| 14363 | || temp_scroll_step | 14363 | || temp_scroll_step |
| 14364 | || NUMBERP (current_buffer->scroll_up_aggressively) | 14364 | || NUMBERP (current_buffer->scroll_up_aggressively) |
| 14365 | || NUMBERP (current_buffer->scroll_down_aggressively)) | 14365 | || NUMBERP (current_buffer->scroll_down_aggressively)) |
| @@ -14371,7 +14371,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 14371 | successful, 0 if not successful. */ | 14371 | successful, 0 if not successful. */ |
| 14372 | int rc = try_scrolling (window, just_this_one_p, | 14372 | int rc = try_scrolling (window, just_this_one_p, |
| 14373 | scroll_conservatively, | 14373 | scroll_conservatively, |
| 14374 | scroll_step, | 14374 | emacs_scroll_step, |
| 14375 | temp_scroll_step, last_line_misfit); | 14375 | temp_scroll_step, last_line_misfit); |
| 14376 | switch (rc) | 14376 | switch (rc) |
| 14377 | { | 14377 | { |
| @@ -26689,7 +26689,7 @@ where to display overlay arrows. */); | |||
| 26689 | Voverlay_arrow_variable_list | 26689 | Voverlay_arrow_variable_list |
| 26690 | = Fcons (intern_c_string ("overlay-arrow-position"), Qnil); | 26690 | = Fcons (intern_c_string ("overlay-arrow-position"), Qnil); |
| 26691 | 26691 | ||
| 26692 | DEFVAR_INT ("scroll-step", &scroll_step, | 26692 | DEFVAR_INT ("scroll-step", &emacs_scroll_step, |
| 26693 | doc: /* *The number of lines to try scrolling a window by when point moves out. | 26693 | doc: /* *The number of lines to try scrolling a window by when point moves out. |
| 26694 | If that fails to bring point back on frame, point is centered instead. | 26694 | If that fails to bring point back on frame, point is centered instead. |
| 26695 | If this is zero, point is always centered after it moves off frame. | 26695 | If this is zero, point is always centered after it moves off frame. |