diff options
| author | Karl Heuer | 1997-02-20 06:42:13 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-02-20 06:42:13 +0000 |
| commit | 5a255667ccda2348780ddb49b2513d2cd8cf6fa0 (patch) | |
| tree | dfc405be0ee25503dba3f311fd2543f971c5205c /src/window.c | |
| parent | fafd594b01a488a6a81123f70616083b9ec6b59e (diff) | |
| download | emacs-5a255667ccda2348780ddb49b2513d2cd8cf6fa0.tar.gz emacs-5a255667ccda2348780ddb49b2513d2cd8cf6fa0.zip | |
(Fpos_visible_in_window_p): Bug fix. Specify big
negative number for the argument TOHPOS of compute_motion().
We don't need to calculate to (HPOS==0), but can stop immediately
when VPOS pasts HEIGHT.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index 34b64ca24d4..98cae3214ec 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -253,8 +253,17 @@ POS defaults to point; WINDOW, to the selected window.") | |||
| 253 | return Qnil; | 253 | return Qnil; |
| 254 | 254 | ||
| 255 | /* If that info is not correct, calculate afresh */ | 255 | /* If that info is not correct, calculate afresh */ |
| 256 | /* BUG FIX for the 7th arg (TOHPOS). | ||
| 257 | |||
| 258 | '0' is harmless, however, ' - (1 << (BITS_PER_SHORT - 1))' is | ||
| 259 | more appropriate here. In case of HSCROLL > 0, this can avoid | ||
| 260 | needless calculation done until (HPOS == 0). | ||
| 261 | |||
| 262 | We want to determine if the position POSINT is in HEIGHT or | ||
| 263 | not. We don't have to do calculation until (HPOS == 0). We | ||
| 264 | can stop it when VPOS goes beyond HEIGHT. */ | ||
| 256 | posval = *compute_motion (top, 0, (hscroll ? 1 - hscroll : 0), 0, | 265 | posval = *compute_motion (top, 0, (hscroll ? 1 - hscroll : 0), 0, |
| 257 | posint, height, 0, | 266 | posint, height, - (1 << (BITS_PER_SHORT - 1)), |
| 258 | window_internal_width (w) - 1, | 267 | window_internal_width (w) - 1, |
| 259 | hscroll, 0, w); | 268 | hscroll, 0, w); |
| 260 | 269 | ||
| @@ -1573,7 +1582,7 @@ value is reasonable when this function is called.") | |||
| 1573 | 1582 | ||
| 1574 | Fset_marker (w->start, make_number (pos.bufpos), w->buffer); | 1583 | Fset_marker (w->start, make_number (pos.bufpos), w->buffer); |
| 1575 | w->start_at_line_beg = ((pos.bufpos == BEGV | 1584 | w->start_at_line_beg = ((pos.bufpos == BEGV |
| 1576 | || FETCH_CHAR (pos.bufpos - 1) == '\n') ? Qt | 1585 | || FETCH_BYTE (pos.bufpos - 1) == '\n') ? Qt |
| 1577 | : Qnil); | 1586 | : Qnil); |
| 1578 | /* We need to do this, so that the window-scroll-functions | 1587 | /* We need to do this, so that the window-scroll-functions |
| 1579 | get called. */ | 1588 | get called. */ |
| @@ -3055,7 +3064,7 @@ redraws with point in the center of the current window.") | |||
| 3055 | 3064 | ||
| 3056 | Fset_marker (w->start, make_number (pos.bufpos), w->buffer); | 3065 | Fset_marker (w->start, make_number (pos.bufpos), w->buffer); |
| 3057 | w->start_at_line_beg = ((pos.bufpos == BEGV | 3066 | w->start_at_line_beg = ((pos.bufpos == BEGV |
| 3058 | || FETCH_CHAR (pos.bufpos - 1) == '\n') | 3067 | || FETCH_BYTE (pos.bufpos - 1) == '\n') |
| 3059 | ? Qt : Qnil); | 3068 | ? Qt : Qnil); |
| 3060 | w->force_start = Qt; | 3069 | w->force_start = Qt; |
| 3061 | 3070 | ||