Changeset 3442
- Timestamp:
- 09/06/04 22:28:02 (4 years ago)
- Files:
-
- branches/2.1/src/ChangeLog.Meadow (modified) (1 diff)
- branches/2.1/src/xdisp.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.1/src/ChangeLog.Meadow
r3430 r3442 1 2004-09-06 MIYOSHI Masanori <miyoshi@meadowy.org> 2 3 * xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): New macro from Emacs 4 CVS HEAD. 5 (move_it_in_display_line_to): Sync up with Emacs CVS HEAD. 6 1 7 2004-08-29 MIYOSHI Masanori <miyoshi@meadowy.org> 2 8 branches/2.1/src/xdisp.c
r3349 r3442 282 282 283 283 Lisp_Object Vshow_trailing_whitespace; 284 285 #ifdef HAVE_WINDOW_SYSTEM 286 /* Test if overflow newline into fringe. Called with iterator IT 287 at or past right window margin, and with IT->current_x set. */ 288 289 #define IT_OVERFLOW_NEWLINE_INTO_FRINGE(it) \ 290 (FRAME_WINDOW_P (it->f) \ 291 && it->current_x == it->last_visible_x) 292 293 #endif /* HAVE_WINDOW_SYSTEM */ 284 294 285 295 /* Name of the face used to highlight trailing whitespace. */ … … 4986 4996 it->glyph_row = NULL; 4987 4997 4998 #define BUFFER_POS_REACHED_P() \ 4999 ((op & MOVE_TO_POS) != 0 \ 5000 && BUFFERP (it->object) \ 5001 && IT_CHARPOS (*it) >= to_charpos) 5002 4988 5003 while (1) 4989 5004 { 4990 5005 int x, i, ascent = 0, descent = 0; 4991 4992 /* Stop when ZV or TO_CHARPOS reached. */ 5006 5007 /* Stop when ZV reached. 5008 We used to stop here when TO_CHARPOS reached as well, but that is 5009 too soon if this glyph does not fit on this line. So we handle it 5010 explicitly below. */ 4993 5011 if (!get_next_display_element (it) 4994 || ((op & MOVE_TO_POS) != 0 4995 && BUFFERP (it->object) 4996 && IT_CHARPOS (*it) >= to_charpos)) 5012 || (it->truncate_lines_p 5013 && BUFFER_POS_REACHED_P ())) 4997 5014 { 4998 5015 result = MOVE_POS_MATCH_OR_ZV; 4999 5016 break; 5000 5017 } 5001 5018 5002 5019 /* The call to produce_glyphs will get the metrics of the 5003 5020 display element IT is loaded with. We record in x the … … 5005 5022 fit on the line. */ 5006 5023 x = it->current_x; 5007 5024 5008 5025 /* Remember the line height so far in case the next element doesn't 5009 5026 fit on the line. */ … … 5013 5030 descent = it->max_descent; 5014 5031 } 5015 5032 5016 5033 PRODUCE_GLYPHS (it); 5017 5034 … … 5046 5063 int single_glyph_width = it->pixel_width / it->nglyphs; 5047 5064 int new_x; 5048 5065 5049 5066 for (i = 0; i < it->nglyphs; ++i, x = new_x) 5050 5067 { … … 5054 5071 if ((op & MOVE_TO_X) && new_x > to_x) 5055 5072 { 5073 if (BUFFER_POS_REACHED_P ()) 5074 goto buffer_pos_reached; 5056 5075 it->current_x = x; 5057 5076 result = MOVE_X_REACHED; … … 5076 5095 it->current_x = new_x; 5077 5096 if (i == it->nglyphs - 1) 5078 set_iterator_to_next (it, 1); 5097 { 5098 set_iterator_to_next (it, 1); 5099 #ifdef HAVE_WINDOW_SYSTEM 5100 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 5101 { 5102 if (!get_next_display_element (it)) 5103 { 5104 result = MOVE_POS_MATCH_OR_ZV; 5105 break; 5106 } 5107 if (BUFFER_POS_REACHED_P ()) 5108 { 5109 if (ITERATOR_AT_END_OF_LINE_P (it)) 5110 result = MOVE_POS_MATCH_OR_ZV; 5111 else 5112 result = MOVE_LINE_CONTINUED; 5113 break; 5114 } 5115 if (ITERATOR_AT_END_OF_LINE_P (it)) 5116 { 5117 result = MOVE_NEWLINE_OR_CR; 5118 break; 5119 } 5120 } 5121 #endif /* HAVE_WINDOW_SYSTEM */ 5122 } 5079 5123 } 5080 5124 else … … 5084 5128 it->max_descent = descent; 5085 5129 } 5086 5130 5087 5131 TRACE_MOVE ((stderr, "move_it_in: continued at %d\n", 5088 5132 IT_CHARPOS (*it))); … … 5090 5134 break; 5091 5135 } 5136 else if (BUFFER_POS_REACHED_P ()) 5137 goto buffer_pos_reached; 5092 5138 else if (new_x > it->first_visible_x) 5093 5139 { … … 5098 5144 else 5099 5145 { 5100 /* Glyph is completely off the left margin of the display 5146 /* Glyph is completely off the left margin of the display 5101 5147 area. Nothing to do. */ 5102 5148 } … … 5105 5151 if (result != MOVE_UNDEFINED) 5106 5152 break; 5153 } 5154 else if (BUFFER_POS_REACHED_P ()) 5155 { 5156 buffer_pos_reached: 5157 it->current_x = x; 5158 it->max_ascent = ascent; 5159 it->max_descent = descent; 5160 result = MOVE_POS_MATCH_OR_ZV; 5161 break; 5107 5162 } 5108 5163 else if ((op & MOVE_TO_X) && it->current_x >= to_x) … … 5116 5171 break; 5117 5172 } 5118 5173 5119 5174 /* Is this a line end? If yes, we're done. */ 5120 5175 if (ITERATOR_AT_END_OF_LINE_P (it)) … … 5123 5178 break; 5124 5179 } 5125 5180 5126 5181 /* The current display element has been consumed. Advance 5127 5182 to the next. */ 5128 5183 set_iterator_to_next (it, 1); 5129 5184 5130 5185 /* Stop if lines are truncated and IT's current x-position is 5131 5186 past the right edge of the window now. */ … … 5133 5188 && it->current_x >= it->last_visible_x) 5134 5189 { 5190 #ifdef HAVE_WINDOW_SYSTEM 5191 if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) 5192 { 5193 if (!get_next_display_element (it) 5194 || BUFFER_POS_REACHED_P ()) 5195 { 5196 result = MOVE_POS_MATCH_OR_ZV; 5197 break; 5198 } 5199 if (ITERATOR_AT_END_OF_LINE_P (it)) 5200 { 5201 result = MOVE_NEWLINE_OR_CR; 5202 break; 5203 } 5204 } 5205 #endif /* HAVE_WINDOW_SYSTEM */ 5135 5206 result = MOVE_LINE_TRUNCATED; 5136 5207 break; 5137 5208 } 5138 5209 } 5210 5211 #undef BUFFER_POS_REACHED_P 5139 5212 5140 5213 /* Restore the iterator settings altered at the beginning of this
