diff options
| author | Gerd Moellmann | 2000-12-29 14:24:09 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-12-29 14:24:09 +0000 |
| commit | 2c79b73234a559398fb8e1914234115b0abc6320 (patch) | |
| tree | c488898f59519e2d6c50228e911260465ab3fcbf /src | |
| parent | 5e56e175e9a94579114956067aa42cfe5dd53ce4 (diff) | |
| download | emacs-2c79b73234a559398fb8e1914234115b0abc6320.tar.gz emacs-2c79b73234a559398fb8e1914234115b0abc6320.zip | |
(move_it_by_lines): Don't do optimizations if NEED_Y_P
is zero. It's not worth the complexity.
(invisible_text_between_p): Put in #if 0 because unused.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 76 |
1 files changed, 6 insertions, 70 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 6127fe4e00a..ae35c982e97 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5071,6 +5071,8 @@ move_it_vertically (it, dy) | |||
| 5071 | } | 5071 | } |
| 5072 | 5072 | ||
| 5073 | 5073 | ||
| 5074 | #if 0 /* Currently not used. */ | ||
| 5075 | |||
| 5074 | /* Return non-zero if some text between buffer positions START_CHARPOS | 5076 | /* Return non-zero if some text between buffer positions START_CHARPOS |
| 5075 | and END_CHARPOS is invisible. IT->window is the window for text | 5077 | and END_CHARPOS is invisible. IT->window is the window for text |
| 5076 | property lookup. */ | 5078 | property lookup. */ |
| @@ -5101,6 +5103,8 @@ invisible_text_between_p (it, start_charpos, end_charpos) | |||
| 5101 | return invisible_found_p; | 5103 | return invisible_found_p; |
| 5102 | } | 5104 | } |
| 5103 | 5105 | ||
| 5106 | #endif /* 0 */ | ||
| 5107 | |||
| 5104 | 5108 | ||
| 5105 | /* Move IT by a specified number DVPOS of screen lines down. DVPOS | 5109 | /* Move IT by a specified number DVPOS of screen lines down. DVPOS |
| 5106 | negative means move up. DVPOS == 0 means move to the start of the | 5110 | negative means move up. DVPOS == 0 means move to the start of the |
| @@ -5136,80 +5140,12 @@ move_it_by_lines (it, dvpos, need_y_p) | |||
| 5136 | xassert (it->current_x == 0 && it->hpos == 0); | 5140 | xassert (it->current_x == 0 && it->hpos == 0); |
| 5137 | } | 5141 | } |
| 5138 | else if (dvpos > 0) | 5142 | else if (dvpos > 0) |
| 5139 | { | 5143 | move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); |
| 5140 | /* If there are no continuation lines, and if there is no | ||
| 5141 | selective display, try the simple method of moving forward | ||
| 5142 | DVPOS newlines, then see where we are. */ | ||
| 5143 | if (!need_y_p && it->truncate_lines_p && it->selective == 0) | ||
| 5144 | { | ||
| 5145 | int shortage = 0, charpos; | ||
| 5146 | |||
| 5147 | if (FETCH_BYTE (IT_BYTEPOS (*it)) == '\n') | ||
| 5148 | charpos = IT_CHARPOS (*it) + 1; | ||
| 5149 | else | ||
| 5150 | charpos = scan_buffer ('\n', IT_CHARPOS (*it), 0, dvpos, | ||
| 5151 | &shortage, 0); | ||
| 5152 | |||
| 5153 | if (!invisible_text_between_p (it, IT_CHARPOS (*it), charpos)) | ||
| 5154 | { | ||
| 5155 | struct text_pos pos; | ||
| 5156 | CHARPOS (pos) = charpos; | ||
| 5157 | BYTEPOS (pos) = CHAR_TO_BYTE (charpos); | ||
| 5158 | reseat (it, pos, 1); | ||
| 5159 | it->vpos += dvpos - shortage; | ||
| 5160 | it->hpos = it->current_x = 0; | ||
| 5161 | return; | ||
| 5162 | } | ||
| 5163 | } | ||
| 5164 | |||
| 5165 | move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS); | ||
| 5166 | } | ||
| 5167 | else | 5144 | else |
| 5168 | { | 5145 | { |
| 5169 | struct it it2; | 5146 | struct it it2; |
| 5170 | int start_charpos, i; | 5147 | int start_charpos, i; |
| 5171 | 5148 | ||
| 5172 | /* If there are no continuation lines, and if there is no | ||
| 5173 | selective display, try the simple method of moving backward | ||
| 5174 | -DVPOS newlines. */ | ||
| 5175 | if (!need_y_p && it->truncate_lines_p && it->selective == 0) | ||
| 5176 | { | ||
| 5177 | int shortage; | ||
| 5178 | int charpos = IT_CHARPOS (*it); | ||
| 5179 | int bytepos = IT_BYTEPOS (*it); | ||
| 5180 | |||
| 5181 | /* If in the middle of a line, go to its start. */ | ||
| 5182 | if (charpos > BEGV && FETCH_BYTE (bytepos - 1) != '\n') | ||
| 5183 | { | ||
| 5184 | charpos = find_next_newline_no_quit (charpos, -1); | ||
| 5185 | bytepos = CHAR_TO_BYTE (charpos); | ||
| 5186 | } | ||
| 5187 | |||
| 5188 | if (charpos == BEGV) | ||
| 5189 | { | ||
| 5190 | struct text_pos pos; | ||
| 5191 | CHARPOS (pos) = charpos; | ||
| 5192 | BYTEPOS (pos) = bytepos; | ||
| 5193 | reseat (it, pos, 1); | ||
| 5194 | it->hpos = it->current_x = 0; | ||
| 5195 | return; | ||
| 5196 | } | ||
| 5197 | else | ||
| 5198 | { | ||
| 5199 | charpos = scan_buffer ('\n', charpos - 1, 0, dvpos, &shortage, 0); | ||
| 5200 | if (!invisible_text_between_p (it, charpos, IT_CHARPOS (*it))) | ||
| 5201 | { | ||
| 5202 | struct text_pos pos; | ||
| 5203 | CHARPOS (pos) = charpos; | ||
| 5204 | BYTEPOS (pos) = CHAR_TO_BYTE (charpos); | ||
| 5205 | reseat (it, pos, 1); | ||
| 5206 | it->vpos += dvpos + (shortage ? shortage - 1 : 0); | ||
| 5207 | it->hpos = it->current_x = 0; | ||
| 5208 | return; | ||
| 5209 | } | ||
| 5210 | } | ||
| 5211 | } | ||
| 5212 | |||
| 5213 | /* Go back -DVPOS visible lines and reseat the iterator there. */ | 5149 | /* Go back -DVPOS visible lines and reseat the iterator there. */ |
| 5214 | start_charpos = IT_CHARPOS (*it); | 5150 | start_charpos = IT_CHARPOS (*it); |
| 5215 | for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i) | 5151 | for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i) |