Changeset 3442

Show
Ignore:
Timestamp:
09/06/04 22:28:02 (4 years ago)
Author:
miyoshi
Message:

(IT_OVERFLOW_NEWLINE_INTO_FRINGE): New macro from Emacs
CVS HEAD.
(move_it_in_display_line_to): Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.1/src/ChangeLog.Meadow

    r3430 r3442  
     12004-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 
    172004-08-29  MIYOSHI Masanori  <miyoshi@meadowy.org> 
    28 
  • branches/2.1/src/xdisp.c

    r3349 r3442  
    282282 
    283283Lisp_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 */ 
    284294 
    285295/* Name of the face used to highlight trailing whitespace.  */ 
     
    49864996  it->glyph_row = NULL; 
    49874997 
     4998#define BUFFER_POS_REACHED_P()                      \ 
     4999  ((op & MOVE_TO_POS) != 0                          \ 
     5000   && BUFFERP (it->object)                          \ 
     5001   && IT_CHARPOS (*it) >= to_charpos) 
     5002 
    49885003  while (1) 
    49895004    { 
    49905005      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.  */ 
    49935011      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 ())) 
    49975014        { 
    49985015          result = MOVE_POS_MATCH_OR_ZV; 
    49995016          break; 
    50005017        } 
    5001            
     5018 
    50025019      /* The call to produce_glyphs will get the metrics of the 
    50035020         display element IT is loaded with.  We record in x the 
     
    50055022         fit on the line.  */ 
    50065023      x = it->current_x; 
    5007        
     5024 
    50085025      /* Remember the line height so far in case the next element doesn't 
    50095026         fit on the line.  */ 
     
    50135030          descent = it->max_descent; 
    50145031        } 
    5015        
     5032 
    50165033      PRODUCE_GLYPHS (it); 
    50175034 
     
    50465063          int single_glyph_width = it->pixel_width / it->nglyphs; 
    50475064          int new_x; 
    5048            
     5065 
    50495066          for (i = 0; i < it->nglyphs; ++i, x = new_x) 
    50505067            { 
     
    50545071              if ((op & MOVE_TO_X) && new_x > to_x) 
    50555072                { 
     5073                  if (BUFFER_POS_REACHED_P ()) 
     5074                    goto buffer_pos_reached; 
    50565075                  it->current_x = x; 
    50575076                  result = MOVE_X_REACHED; 
     
    50765095                      it->current_x = new_x; 
    50775096                      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                        } 
    50795123                    } 
    50805124                  else 
     
    50845128                      it->max_descent = descent; 
    50855129                    } 
    5086                    
     5130 
    50875131                  TRACE_MOVE ((stderr, "move_it_in: continued at %d\n", 
    50885132                               IT_CHARPOS (*it))); 
     
    50905134                  break; 
    50915135                } 
     5136              else if (BUFFER_POS_REACHED_P ()) 
     5137                goto buffer_pos_reached; 
    50925138              else if (new_x > it->first_visible_x) 
    50935139                { 
     
    50985144              else 
    50995145                { 
    5100                   /* Glyph is completely off the left margin of the display  
     5146                  /* Glyph is completely off the left margin of the display 
    51015147                     area.  Nothing to do.  */ 
    51025148                } 
     
    51055151          if (result != MOVE_UNDEFINED) 
    51065152            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; 
    51075162        } 
    51085163      else if ((op & MOVE_TO_X) && it->current_x >= to_x) 
     
    51165171          break; 
    51175172        } 
    5118    
     5173 
    51195174      /* Is this a line end?  If yes, we're done.  */ 
    51205175      if (ITERATOR_AT_END_OF_LINE_P (it)) 
     
    51235178          break; 
    51245179        } 
    5125        
     5180 
    51265181      /* The current display element has been consumed.  Advance 
    51275182         to the next.  */ 
    51285183      set_iterator_to_next (it, 1); 
    5129        
     5184 
    51305185      /* Stop if lines are truncated and IT's current x-position is 
    51315186         past the right edge of the window now.  */ 
     
    51335188          && it->current_x >= it->last_visible_x) 
    51345189        { 
     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 */ 
    51355206          result = MOVE_LINE_TRUNCATED; 
    51365207          break; 
    51375208        } 
    51385209    } 
     5210 
     5211#undef BUFFER_POS_REACHED_P 
    51395212 
    51405213  /* Restore the iterator settings altered at the beginning of this