diff options
| author | Dmitry Antipov | 2013-09-01 20:21:48 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-09-01 20:21:48 +0400 |
| commit | cf91889acb493863b93dc199d2a39e7f3a9b4cd4 (patch) | |
| tree | af972c96d3a1021e9c0d0737f4afa5940b4387b6 /src/window.c | |
| parent | a30edef8a9491ea9b293c3ac792e52260723bd24 (diff) | |
| download | emacs-cf91889acb493863b93dc199d2a39e7f3a9b4cd4.tar.gz emacs-cf91889acb493863b93dc199d2a39e7f3a9b4cd4.zip | |
* dispextern.h (SET_TEXT_POS_FROM_MARKER): Indent.
(CLIP_TEXT_POS_FROM_MARKER): New macro.
* dispnew.c (buffer_posn_from_coords):
* window.c (Fwindow_end, displayed_window_lines):
* xdisp.c (redisplay_mode_lines): Use it.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c index 560f31e2c27..ef96861dc71 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1494,7 +1494,6 @@ if it isn't already recorded. */) | |||
| 1494 | && !noninteractive) | 1494 | && !noninteractive) |
| 1495 | { | 1495 | { |
| 1496 | struct text_pos startp; | 1496 | struct text_pos startp; |
| 1497 | ptrdiff_t charpos = marker_position (w->start); | ||
| 1498 | struct it it; | 1497 | struct it it; |
| 1499 | struct buffer *old_buffer = NULL; | 1498 | struct buffer *old_buffer = NULL; |
| 1500 | void *itdata = NULL; | 1499 | void *itdata = NULL; |
| @@ -1512,12 +1511,7 @@ if it isn't already recorded. */) | |||
| 1512 | `-l' containing a call to `rmail' with subsequent other | 1511 | `-l' containing a call to `rmail' with subsequent other |
| 1513 | commands. At the end, W->start happened to be BEG, while | 1512 | commands. At the end, W->start happened to be BEG, while |
| 1514 | rmail had already narrowed the buffer. */ | 1513 | rmail had already narrowed the buffer. */ |
| 1515 | if (charpos < BEGV) | 1514 | CLIP_TEXT_POS_FROM_MARKER (startp, w->start); |
| 1516 | SET_TEXT_POS (startp, BEGV, BEGV_BYTE); | ||
| 1517 | else if (charpos > ZV) | ||
| 1518 | SET_TEXT_POS (startp, ZV, ZV_BYTE); | ||
| 1519 | else | ||
| 1520 | SET_TEXT_POS_FROM_MARKER (startp, w->start); | ||
| 1521 | 1515 | ||
| 1522 | itdata = bidi_shelve_cache (); | 1516 | itdata = bidi_shelve_cache (); |
| 1523 | start_display (&it, w, startp); | 1517 | start_display (&it, w, startp); |
| @@ -5038,7 +5032,6 @@ displayed_window_lines (struct window *w) | |||
| 5038 | { | 5032 | { |
| 5039 | struct it it; | 5033 | struct it it; |
| 5040 | struct text_pos start; | 5034 | struct text_pos start; |
| 5041 | ptrdiff_t charpos = marker_position (w->start); | ||
| 5042 | int height = window_box_height (w); | 5035 | int height = window_box_height (w); |
| 5043 | struct buffer *old_buffer; | 5036 | struct buffer *old_buffer; |
| 5044 | int bottom_y; | 5037 | int bottom_y; |
| @@ -5055,12 +5048,7 @@ displayed_window_lines (struct window *w) | |||
| 5055 | /* In case W->start is out of the accessible range, do something | 5048 | /* In case W->start is out of the accessible range, do something |
| 5056 | reasonable. This happens in Info mode when Info-scroll-down | 5049 | reasonable. This happens in Info mode when Info-scroll-down |
| 5057 | calls (recenter -1) while W->start is 1. */ | 5050 | calls (recenter -1) while W->start is 1. */ |
| 5058 | if (charpos < BEGV) | 5051 | CLIP_TEXT_POS_FROM_MARKER (start, w->start); |
| 5059 | SET_TEXT_POS (start, BEGV, BEGV_BYTE); | ||
| 5060 | else if (charpos > ZV) | ||
| 5061 | SET_TEXT_POS (start, ZV, ZV_BYTE); | ||
| 5062 | else | ||
| 5063 | SET_TEXT_POS_FROM_MARKER (start, w->start); | ||
| 5064 | 5052 | ||
| 5065 | itdata = bidi_shelve_cache (); | 5053 | itdata = bidi_shelve_cache (); |
| 5066 | start_display (&it, w, start); | 5054 | start_display (&it, w, start); |