diff options
| author | Joakim Verona | 2012-12-12 16:42:23 +0100 |
|---|---|---|
| committer | Joakim Verona | 2012-12-12 16:42:23 +0100 |
| commit | 835350a08a35b0045270154ed0c74e736ba725fe (patch) | |
| tree | 80d47d915cc4fb910dfd88e05541bf16c2031ee8 /src | |
| parent | 8986f115b01183ffdc4cfc912ba426959266ef1a (diff) | |
| parent | 2dd61a9b332356fa24d96527a71ef4fe29fb9e5c (diff) | |
| download | emacs-835350a08a35b0045270154ed0c74e736ba725fe.tar.gz emacs-835350a08a35b0045270154ed0c74e736ba725fe.zip | |
auto upstream
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/dispnew.c | 9 | ||||
| -rw-r--r-- | src/gtkutil.c | 9 | ||||
| -rw-r--r-- | src/window.c | 4 | ||||
| -rw-r--r-- | src/xdisp.c | 12 | ||||
| -rw-r--r-- | src/xterm.c | 4 |
6 files changed, 20 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d19b7be7395..3070fcb6e9d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds. | ||
| 4 | * gtkutil.c (xg_set_toolkit_scroll_bar_thumb): | ||
| 5 | * window.c (Frecenter): | ||
| 6 | * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs): | ||
| 7 | * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise. | ||
| 8 | |||
| 1 | 2012-12-12 Daniel Colascione <dancol@dancol.org> | 9 | 2012-12-12 Daniel Colascione <dancol@dancol.org> |
| 2 | 10 | ||
| 3 | * unexcw.c (fixup_executable): use posix_fallocate to ensure that | 11 | * unexcw.c (fixup_executable): use posix_fallocate to ensure that |
diff --git a/src/dispnew.c b/src/dispnew.c index 5c162cdfadf..89ee09a8432 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -4021,11 +4021,10 @@ set_window_cursor_after_update (struct window *w) | |||
| 4021 | vpos = w->cursor.vpos; | 4021 | vpos = w->cursor.vpos; |
| 4022 | } | 4022 | } |
| 4023 | 4023 | ||
| 4024 | /* Window cursor can be out of sync for horizontally split windows. */ | 4024 | /* Window cursor can be out of sync for horizontally split windows. |
| 4025 | hpos = max (-1, hpos); /* -1 is for when cursor is on the left fringe */ | 4025 | Horisontal position is -1 when cursor is on the left fringe. */ |
| 4026 | hpos = min (w->current_matrix->matrix_w - 1, hpos); | 4026 | hpos = clip_to_bounds (-1, hpos, w->current_matrix->matrix_w - 1); |
| 4027 | vpos = max (0, vpos); | 4027 | vpos = clip_to_bounds (0, vpos, w->current_matrix->nrows - 1); |
| 4028 | vpos = min (w->current_matrix->nrows - 1, vpos); | ||
| 4029 | rif->cursor_to (vpos, hpos, cy, cx); | 4028 | rif->cursor_to (vpos, hpos, cy, cx); |
| 4030 | } | 4029 | } |
| 4031 | 4030 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 52a6c37b0d5..9f2b652525f 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -3796,13 +3796,8 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, | |||
| 3796 | shown = (gdouble) portion / whole; | 3796 | shown = (gdouble) portion / whole; |
| 3797 | } | 3797 | } |
| 3798 | 3798 | ||
| 3799 | size = shown * XG_SB_RANGE; | 3799 | size = clip_to_bounds (1, shown * XG_SB_RANGE, XG_SB_RANGE); |
| 3800 | size = min (size, XG_SB_RANGE); | 3800 | value = clip_to_bounds (XG_SB_MIN, top * XG_SB_RANGE, XG_SB_MAX - size); |
| 3801 | size = max (size, 1); | ||
| 3802 | |||
| 3803 | value = top * XG_SB_RANGE; | ||
| 3804 | value = min (value, XG_SB_MAX - size); | ||
| 3805 | value = max (value, XG_SB_MIN); | ||
| 3806 | 3801 | ||
| 3807 | /* Assume all lines are of equal size. */ | 3802 | /* Assume all lines are of equal size. */ |
| 3808 | new_step = size / max (1, FRAME_LINES (f)); | 3803 | new_step = size / max (1, FRAME_LINES (f)); |
diff --git a/src/window.c b/src/window.c index 4631a898d3e..3e3cd3a571c 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -5351,8 +5351,8 @@ and redisplay normally--don't erase and redraw the frame. */) | |||
| 5351 | iarg += ht; | 5351 | iarg += ht; |
| 5352 | 5352 | ||
| 5353 | /* Don't let it get into the margin at either top or bottom. */ | 5353 | /* Don't let it get into the margin at either top or bottom. */ |
| 5354 | iarg = max (iarg, this_scroll_margin); | 5354 | iarg = clip_to_bounds (this_scroll_margin, iarg, |
| 5355 | iarg = min (iarg, ht - this_scroll_margin - 1); | 5355 | ht - this_scroll_margin - 1); |
| 5356 | 5356 | ||
| 5357 | pos = *vmotion (PT, - iarg, w); | 5357 | pos = *vmotion (PT, - iarg, w); |
| 5358 | charpos = pos.bufpos; | 5358 | charpos = pos.bufpos; |
diff --git a/src/xdisp.c b/src/xdisp.c index c6f4b440e74..4173c82da54 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -10447,8 +10447,7 @@ resize_mini_window (struct window *w, int exact_p) | |||
| 10447 | max_height = total_height / 4; | 10447 | max_height = total_height / 4; |
| 10448 | 10448 | ||
| 10449 | /* Correct that max. height if it's bogus. */ | 10449 | /* Correct that max. height if it's bogus. */ |
| 10450 | max_height = max (1, max_height); | 10450 | max_height = clip_to_bounds (1, max_height, total_height); |
| 10451 | max_height = min (total_height, max_height); | ||
| 10452 | 10451 | ||
| 10453 | /* Find out the height of the text in the window. */ | 10452 | /* Find out the height of the text in the window. */ |
| 10454 | if (it.line_wrap == TRUNCATE) | 10453 | if (it.line_wrap == TRUNCATE) |
| @@ -12550,11 +12549,7 @@ hscroll_window_tree (Lisp_Object window) | |||
| 12550 | if (w == XWINDOW (selected_window)) | 12549 | if (w == XWINDOW (selected_window)) |
| 12551 | pt = PT; | 12550 | pt = PT; |
| 12552 | else | 12551 | else |
| 12553 | { | 12552 | pt = clip_to_bounds (BEGV, marker_position (w->pointm), ZV); |
| 12554 | pt = marker_position (w->pointm); | ||
| 12555 | pt = max (BEGV, pt); | ||
| 12556 | pt = min (ZV, pt); | ||
| 12557 | } | ||
| 12558 | 12553 | ||
| 12559 | /* Move iterator to pt starting at cursor_row->start in | 12554 | /* Move iterator to pt starting at cursor_row->start in |
| 12560 | a line with infinite width. */ | 12555 | a line with infinite width. */ |
| @@ -23644,8 +23639,7 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row, | |||
| 23644 | 23639 | ||
| 23645 | /* Let's rather be paranoid than getting a SEGV. */ | 23640 | /* Let's rather be paranoid than getting a SEGV. */ |
| 23646 | end = min (end, row->used[area]); | 23641 | end = min (end, row->used[area]); |
| 23647 | start = max (0, start); | 23642 | start = clip_to_bounds (0, start, end); |
| 23648 | start = min (end, start); | ||
| 23649 | 23643 | ||
| 23650 | /* Translate X to frame coordinates. Set last_x to the right | 23644 | /* Translate X to frame coordinates. Set last_x to the right |
| 23651 | end of the drawing area. */ | 23645 | end of the drawing area. */ |
diff --git a/src/xterm.c b/src/xterm.c index 5a3019401f6..2cb59431fbb 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -4843,9 +4843,7 @@ x_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, int portion, int positio | |||
| 4843 | /* Slider size. Must be in the range [1 .. MAX - MIN] where MAX | 4843 | /* Slider size. Must be in the range [1 .. MAX - MIN] where MAX |
| 4844 | is the scroll bar's maximum and MIN is the scroll bar's minimum | 4844 | is the scroll bar's maximum and MIN is the scroll bar's minimum |
| 4845 | value. */ | 4845 | value. */ |
| 4846 | size = shown * XM_SB_MAX; | 4846 | size = clip_to_bounds (1, shown * XM_SB_MAX, XM_SB_MAX); |
| 4847 | size = min (size, XM_SB_MAX); | ||
| 4848 | size = max (size, 1); | ||
| 4849 | 4847 | ||
| 4850 | /* Position. Must be in the range [MIN .. MAX - SLIDER_SIZE]. */ | 4848 | /* Position. Must be in the range [MIN .. MAX - SLIDER_SIZE]. */ |
| 4851 | value = top * XM_SB_MAX; | 4849 | value = top * XM_SB_MAX; |