/[emacs]/emacs/src/xdisp.c
ViewVC logotype

Diff of /emacs/src/xdisp.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.783 by eliz, Sat Aug 31 10:16:40 2002 UTC revision 1.784 by rms, Sun Sep 1 13:43:38 2002 UTC
# Line 8963  redisplay_internal (preserve_echo_area) Line 8963  redisplay_internal (preserve_echo_area)
8963                  judge_scroll_bars_hook (f);                  judge_scroll_bars_hook (f);
8964    
8965                /* If fonts changed, display again.  */                /* If fonts changed, display again.  */
8966                  /* ??? rms: I suspect it is a mistake to jump all the way
8967                     back to retry here.  It should just retry this frame.  */
8968                if (fonts_changed_p)                if (fonts_changed_p)
8969                  goto retry;                  goto retry;
8970    
# Line 10098  try_cursor_movement (window, startp, scr Line 10100  try_cursor_movement (window, startp, scr
10100    
10101    
10102  /* Redisplay leaf window WINDOW.  JUST_THIS_ONE_P non-zero means only  /* Redisplay leaf window WINDOW.  JUST_THIS_ONE_P non-zero means only
10103     selected_window is redisplayed.  */     selected_window is redisplayed.
10104    
10105       We can return without actually redisplaying the window if
10106       fonts_changed_p is nonzero.  In that case, redisplay_internal will
10107       retry.  */
10108    
10109  static void  static void
10110  redisplay_window (window, just_this_one_p)  redisplay_window (window, just_this_one_p)
# Line 10305  redisplay_window (window, just_this_one_ Line 10311  redisplay_window (window, just_this_one_
10311    if (!NILP (w->force_start)    if (!NILP (w->force_start)
10312        || w->frozen_window_start_p)        || w->frozen_window_start_p)
10313      {      {
10314          /* We set this later on if we have to adjust point.  */
10315          int new_vpos = -1;
10316    
10317        w->force_start = Qnil;        w->force_start = Qnil;
10318        w->vscroll = 0;        w->vscroll = 0;
10319        w->window_end_valid = Qnil;        w->window_end_valid = Qnil;
# Line 10341  redisplay_window (window, just_this_one_ Line 10350  redisplay_window (window, just_this_one_
10350          {          {
10351            w->force_start = Qt;            w->force_start = Qt;
10352            clear_glyph_matrix (w->desired_matrix);            clear_glyph_matrix (w->desired_matrix);
10353            goto finish_scroll_bars;            goto need_larger_matrices;
10354          }          }
10355    
10356        if (w->cursor.vpos < 0 && !w->frozen_window_start_p)        if (w->cursor.vpos < 0 && !w->frozen_window_start_p)
# Line 10349  redisplay_window (window, just_this_one_ Line 10358  redisplay_window (window, just_this_one_
10358            /* If point does not appear, try to move point so it does            /* If point does not appear, try to move point so it does
10359               appear. The desired matrix has been built above, so we               appear. The desired matrix has been built above, so we
10360               can use it here.  */               can use it here.  */
10361            int window_height;            new_vpos = window_box_height (w) / 2;
10362            }
10363    
10364          if (!make_cursor_line_fully_visible (w))
10365            {
10366              /* Point does appear, but on a line partly visible at end of window.
10367                 Move it back to a fully-visible line.  */
10368              new_vpos = window_box_height (w);
10369            }
10370    
10371          /* If we need to move point for either of the above reasons,
10372             now actually do it.  */
10373          if (new_vpos >= 0)
10374            {
10375            struct glyph_row *row;            struct glyph_row *row;
10376    
           window_height = window_box_height (w) / 2;  
10377            row = MATRIX_FIRST_TEXT_ROW (w->desired_matrix);            row = MATRIX_FIRST_TEXT_ROW (w->desired_matrix);
10378            while (MATRIX_ROW_BOTTOM_Y (row) < window_height)            while (MATRIX_ROW_BOTTOM_Y (row) < new_vpos)
10379              ++row;              ++row;
10380    
10381            TEMP_SET_PT_BOTH (MATRIX_ROW_START_CHARPOS (row),            TEMP_SET_PT_BOTH (MATRIX_ROW_START_CHARPOS (row),
# Line 10378  redisplay_window (window, just_this_one_ Line 10399  redisplay_window (window, just_this_one_
10399              }              }
10400          }          }
10401    
       if (!make_cursor_line_fully_visible (w))  
         {  
           /* CVS rev. 1.761 had changed this to ``goto try_to_scroll''.  
   
              The intention of the fix -- AFAIU -- was to ensure that  
              the cursor didn't end up on a partially visible last (or  
              first?) line when scrolling.  
   
   
              But that change causes havoc when scrolling backwards and  
              a partially visible first (or last?) line is present when  
              we reach the top of the buffer.  In effect, the text  
              already in the window is repeated (each line is appended  
              to the same or another lines in the window)...  
   
              I changed it back to ``goto need_larger_matrices'' which  
              in effect mean that we don't go through `try_scrolling'  
              when the cursor is already at the first line of the buffer,  
              and there is really only a few pixels [rather than lines]  
              to scroll backwards.  I guess move_it_by_lines etc. really  
              isn't the right device for doing that, ref. the code in  
              make_cursor_line_fully_visible which was also disabled by  
              CVS rev. 1.761.  
   
              But how do we know that we are already on the top line of  
              the window showing the first line in the buffer, so that  
              scrolling really wont help here?  
   
              I cannot find a simple fix for this (I tried various  
              approaches), but I prefer to an occasional partial line  
              rather than the visual messup, so I reverted this part of  
              the fix.  
   
              Someone will need to look into this when time allows.  
   
              -- 2002-08-22, Kim F. Storm  */  
   
           goto need_larger_matrices;  
         }  
10402  #if GLYPH_DEBUG  #if GLYPH_DEBUG
10403        debug_method_add (w, "forced window start");        debug_method_add (w, "forced window start");
10404  #endif  #endif
# Line 10435  redisplay_window (window, just_this_one_ Line 10417  redisplay_window (window, just_this_one_
10417          case CURSOR_MOVEMENT_SUCCESS:          case CURSOR_MOVEMENT_SUCCESS:
10418            goto done;            goto done;
10419    
10420    #if 0  /* try_cursor_movement never returns this value.  */
10421          case CURSOR_MOVEMENT_NEED_LARGER_MATRICES:          case CURSOR_MOVEMENT_NEED_LARGER_MATRICES:
10422            goto need_larger_matrices;            goto need_larger_matrices;
10423    #endif
10424    
10425          case CURSOR_MOVEMENT_MUST_SCROLL:          case CURSOR_MOVEMENT_MUST_SCROLL:
10426            goto try_to_scroll;            goto try_to_scroll;
# Line 10765  redisplay_window (window, just_this_one_ Line 10749  redisplay_window (window, just_this_one_
10749  #endif  #endif
10750      }      }
10751    
10752      /* We go to this label, with fonts_changed_p nonzero,
10753         if it is necessary to try again using larger glyph matrices.
10754         We have to redeem the scroll bar even in this case,
10755         because the loop in redisplay_internal expects that.  */
10756   need_larger_matrices:   need_larger_matrices:
10757    ;    ;
10758   finish_scroll_bars:   finish_scroll_bars:

Legend:
Removed from v.1.783  
changed lines
  Added in v.1.784

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26