/[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.897 by kfstorm, Wed Jul 21 21:09:43 2004 UTC revision 1.897.2.1 by miles, Sat Sep 4 12:01:20 2004 UTC
# Line 306  Lisp_Object Qline_height, Qtotal; Line 306  Lisp_Object Qline_height, Qtotal;
306  extern Lisp_Object Qheight;  extern Lisp_Object Qheight;
307  extern Lisp_Object QCwidth, QCheight, QCascent;  extern Lisp_Object QCwidth, QCheight, QCascent;
308  extern Lisp_Object Qscroll_bar;  extern Lisp_Object Qscroll_bar;
309    extern Lisp_Object Qcursor;
310    
311  /* Non-nil means highlight trailing whitespace.  */  /* Non-nil means highlight trailing whitespace.  */
312    
# Line 5649  move_it_in_display_line_to (it, to_charp Line 5650  move_it_in_display_line_to (it, to_charp
5650      {      {
5651        int x, i, ascent = 0, descent = 0;        int x, i, ascent = 0, descent = 0;
5652    
5653        /* Stop when ZV or TO_CHARPOS reached.  */        /* Stop when ZV reached.
5654             We used to stop here when TO_CHARPOS reached as well, but that is
5655             too soon if this glyph does not fit on this line.  So we handle it
5656             explicitly below.  */
5657        if (!get_next_display_element (it)        if (!get_next_display_element (it)
5658            || BUFFER_POS_REACHED_P ())            || (it->truncate_lines_p
5659                  && BUFFER_POS_REACHED_P ()))
5660          {          {
5661            result = MOVE_POS_MATCH_OR_ZV;            result = MOVE_POS_MATCH_OR_ZV;
5662            break;            break;
# Line 5711  move_it_in_display_line_to (it, to_charp Line 5716  move_it_in_display_line_to (it, to_charp
5716                /* We want to leave anything reaching TO_X to the caller.  */                /* We want to leave anything reaching TO_X to the caller.  */
5717                if ((op & MOVE_TO_X) && new_x > to_x)                if ((op & MOVE_TO_X) && new_x > to_x)
5718                  {                  {
5719                      if (BUFFER_POS_REACHED_P ())
5720                        goto buffer_pos_reached;
5721                    it->current_x = x;                    it->current_x = x;
5722                    result = MOVE_X_REACHED;                    result = MOVE_X_REACHED;
5723                    break;                    break;
# Line 5738  move_it_in_display_line_to (it, to_charp Line 5745  move_it_in_display_line_to (it, to_charp
5745  #ifdef HAVE_WINDOW_SYSTEM  #ifdef HAVE_WINDOW_SYSTEM
5746                            if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))                            if (IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
5747                              {                              {
5748                                if (!get_next_display_element (it)                                if (!get_next_display_element (it))
                                   || BUFFER_POS_REACHED_P ())  
5749                                  {                                  {
5750                                    result = MOVE_POS_MATCH_OR_ZV;                                    result = MOVE_POS_MATCH_OR_ZV;
5751                                    break;                                    break;
5752                                  }                                  }
5753                                  if (BUFFER_POS_REACHED_P ())
5754                                    {
5755                                      if (ITERATOR_AT_END_OF_LINE_P (it))
5756                                        result = MOVE_POS_MATCH_OR_ZV;
5757                                      else
5758                                        result = MOVE_LINE_CONTINUED;
5759                                      break;
5760                                    }
5761                                if (ITERATOR_AT_END_OF_LINE_P (it))                                if (ITERATOR_AT_END_OF_LINE_P (it))
5762                                  {                                  {
5763                                    result = MOVE_NEWLINE_OR_CR;                                    result = MOVE_NEWLINE_OR_CR;
# Line 5765  move_it_in_display_line_to (it, to_charp Line 5779  move_it_in_display_line_to (it, to_charp
5779                    result = MOVE_LINE_CONTINUED;                    result = MOVE_LINE_CONTINUED;
5780                    break;                    break;
5781                  }                  }
5782                  else if (BUFFER_POS_REACHED_P ())
5783                    goto buffer_pos_reached;
5784                else if (new_x > it->first_visible_x)                else if (new_x > it->first_visible_x)
5785                  {                  {
5786                    /* Glyph is visible.  Increment number of glyphs that                    /* Glyph is visible.  Increment number of glyphs that
# Line 5781  move_it_in_display_line_to (it, to_charp Line 5797  move_it_in_display_line_to (it, to_charp
5797            if (result != MOVE_UNDEFINED)            if (result != MOVE_UNDEFINED)
5798              break;              break;
5799          }          }
5800          else if (BUFFER_POS_REACHED_P ())
5801            {
5802            buffer_pos_reached:
5803              it->current_x = x;
5804              it->max_ascent = ascent;
5805              it->max_descent = descent;
5806              result = MOVE_POS_MATCH_OR_ZV;
5807              break;
5808            }
5809        else if ((op & MOVE_TO_X) && it->current_x >= to_x)        else if ((op & MOVE_TO_X) && it->current_x >= to_x)
5810          {          {
5811            /* Stop when TO_X specified and reached.  This check is            /* Stop when TO_X specified and reached.  This check is
# Line 10357  redisplay_internal (preserve_echo_area) Line 10382  redisplay_internal (preserve_echo_area)
10382     This is useful in situations where you need to redisplay but no     This is useful in situations where you need to redisplay but no
10383     user action has occurred, making it inappropriate for the message     user action has occurred, making it inappropriate for the message
10384     area to be cleared.  See tracking_off and     area to be cleared.  See tracking_off and
10385     wait_reading_process_input for examples of these situations.     wait_reading_process_output for examples of these situations.
10386    
10387     FROM_WHERE is an integer saying from where this function was     FROM_WHERE is an integer saying from where this function was
10388     called.  This is useful for debugging.  */     called.  This is useful for debugging.  */
# Line 10623  set_cursor_from_row (w, row, matrix, del Line 10648  set_cursor_from_row (w, row, matrix, del
10648  {  {
10649    struct glyph *glyph = row->glyphs[TEXT_AREA];    struct glyph *glyph = row->glyphs[TEXT_AREA];
10650    struct glyph *end = glyph + row->used[TEXT_AREA];    struct glyph *end = glyph + row->used[TEXT_AREA];
10651      struct glyph *cursor = NULL;
10652    /* The first glyph that starts a sequence of glyphs from string.  */    /* The first glyph that starts a sequence of glyphs from string.  */
10653    struct glyph *string_start;    struct glyph *string_start;
10654    /* The X coordinate of string_start.  */    /* The X coordinate of string_start.  */
# Line 10632  set_cursor_from_row (w, row, matrix, del Line 10658  set_cursor_from_row (w, row, matrix, del
10658    /* The last known character position before string_start.  */    /* The last known character position before string_start.  */
10659    int string_before_pos;    int string_before_pos;
10660    int x = row->x;    int x = row->x;
10661      int cursor_x = x;
10662    int pt_old = PT - delta;    int pt_old = PT - delta;
10663    
10664    /* Skip over glyphs not having an object at the start of the row.    /* Skip over glyphs not having an object at the start of the row.
# Line 10664  set_cursor_from_row (w, row, matrix, del Line 10691  set_cursor_from_row (w, row, matrix, del
10691            string_start = glyph;            string_start = glyph;
10692            string_start_x = x;            string_start_x = x;
10693            /* Skip all glyphs from string.  */            /* Skip all glyphs from string.  */
10694            SKIP_GLYPHS (glyph, end, x, STRINGP (glyph->object));            do
10695                {
10696                  if ((cursor == NULL || glyph > cursor)
10697                      && !NILP (Fget_char_property (make_number ((glyph)->charpos),
10698                                                    Qcursor, (glyph)->object)))
10699                    {
10700                      cursor = glyph;
10701                      cursor_x = x;
10702                    }
10703                  x += glyph->pixel_width;
10704                  ++glyph;
10705                }
10706              while (glyph < end && STRINGP (glyph->object));
10707          }          }
10708      }      }
10709    
10710    if (string_start    if (cursor != NULL)
10711        && (glyph == end || !BUFFERP (glyph->object) || last_pos > pt_old))      {
10712          glyph = cursor;
10713          x = cursor_x;
10714        }
10715      else if (string_start
10716               && (glyph == end || !BUFFERP (glyph->object) || last_pos > pt_old))
10717      {      {
10718        /* We may have skipped over point because the previous glyphs        /* We may have skipped over point because the previous glyphs
10719           are from string.  As there's no easy way to know the           are from string.  As there's no easy way to know the
# Line 11061  try_scrolling (window, just_this_one_p, Line 11105  try_scrolling (window, just_this_one_p,
11105            start_display (&it, w, startp);            start_display (&it, w, startp);
11106    
11107            if (scroll_conservatively)            if (scroll_conservatively)
11108              amount_to_scroll =              amount_to_scroll
11109                max (dy, FRAME_LINE_HEIGHT (f) * max (scroll_step, temp_scroll_step));                = max (dy, FRAME_LINE_HEIGHT (f) * max (scroll_step, temp_scroll_step));
11110            else if (scroll_step || temp_scroll_step)            else if (scroll_step || temp_scroll_step)
11111              amount_to_scroll = scroll_max;              amount_to_scroll = scroll_max;
11112            else            else
# Line 11341  try_cursor_movement (window, startp, scr Line 11385  try_cursor_movement (window, startp, scr
11385            else if (PT < XFASTINT (w->last_point))            else if (PT < XFASTINT (w->last_point))
11386              {              {
11387                /* Cursor has to be moved backward.  Note that PT >=                /* Cursor has to be moved backward.  Note that PT >=
11388                   CHARPOS (startp) because of the outer                   CHARPOS (startp) because of the outer if-statement.  */
                  if-statement.  */  
11389                while (!row->mode_line_p                while (!row->mode_line_p
11390                       && (MATRIX_ROW_START_CHARPOS (row) > PT                       && (MATRIX_ROW_START_CHARPOS (row) > PT
11391                           || (MATRIX_ROW_START_CHARPOS (row) == PT                           || (MATRIX_ROW_START_CHARPOS (row) == PT
# Line 11854  redisplay_window (window, just_this_one_ Line 11897  redisplay_window (window, just_this_one_
11897               buffer.  */               buffer.  */
11898            || !NILP (Vwindow_scroll_functions)            || !NILP (Vwindow_scroll_functions)
11899            || MINI_WINDOW_P (w)            || MINI_WINDOW_P (w)
11900            || !(used_current_matrix_p =            || !(used_current_matrix_p
11901                 try_window_reusing_current_matrix (w)))                 = try_window_reusing_current_matrix (w)))
11902          {          {
11903            IF_DEBUG (debug_method_add (w, "1"));            IF_DEBUG (debug_method_add (w, "1"));
11904            try_window (window, startp);            try_window (window, startp);
# Line 11984  redisplay_window (window, just_this_one_ Line 12027  redisplay_window (window, just_this_one_
12027        || !NILP (Vwindow_scroll_functions)        || !NILP (Vwindow_scroll_functions)
12028        || !just_this_one_p        || !just_this_one_p
12029        || MINI_WINDOW_P (w)        || MINI_WINDOW_P (w)
12030        || !(used_current_matrix_p =        || !(used_current_matrix_p
12031             try_window_reusing_current_matrix (w)))             = try_window_reusing_current_matrix (w)))
12032      try_window (window, startp);      try_window (window, startp);
12033    
12034    /* If new fonts have been loaded (due to fontsets), give up.  We    /* If new fonts have been loaded (due to fontsets), give up.  We
# Line 15650  display_mode_element (it, depth, field_w Line 15693  display_mode_element (it, depth, field_w
15693     The mode_line_string_face face property is always added to the string.     The mode_line_string_face face property is always added to the string.
15694   */   */
15695    
15696  static int store_mode_line_string (string, lisp_string, copy_string, field_width, precision, props)  static int
15697    store_mode_line_string (string, lisp_string, copy_string, field_width, precision, props)
15698       char *string;       char *string;
15699       Lisp_Object lisp_string;       Lisp_Object lisp_string;
15700       int copy_string;       int copy_string;
# Line 15762  If third optional arg NO-PROPS is non-ni Line 15806  If third optional arg NO-PROPS is non-ni
15806    
15807    if (NILP (format) || EQ (format, Qt))    if (NILP (format) || EQ (format, Qt))
15808      {      {
15809        face_id = NILP (format)        face_id = (NILP (format)
15810          ? CURRENT_MODE_LINE_FACE_ID (w) :                   ? CURRENT_MODE_LINE_FACE_ID (w)
15811          HEADER_LINE_FACE_ID;                   : HEADER_LINE_FACE_ID);
15812        format = NILP (format)        format = (NILP (format)
15813          ? current_buffer->mode_line_format                  ? current_buffer->mode_line_format
15814          : current_buffer->header_line_format;                  : current_buffer->header_line_format);
15815      }      }
15816    
15817    init_iterator (&it, w, -1, -1, NULL, face_id);    init_iterator (&it, w, -1, -1, NULL, face_id);
15818    
15819    if (NILP (no_props))    if (NILP (no_props))
15820      {      {
15821        mode_line_string_face =        mode_line_string_face
15822          (face_id == MODE_LINE_FACE_ID ? Qmode_line :          = (face_id == MODE_LINE_FACE_ID ? Qmode_line
15823           face_id == MODE_LINE_INACTIVE_FACE_ID ? Qmode_line_inactive :             : face_id == MODE_LINE_INACTIVE_FACE_ID ? Qmode_line_inactive
15824           face_id == HEADER_LINE_FACE_ID ? Qheader_line : Qnil);             : face_id == HEADER_LINE_FACE_ID ? Qheader_line : Qnil);
15825    
15826        mode_line_string_face_prop =        mode_line_string_face_prop
15827          NILP (mode_line_string_face) ? Qnil :          = (NILP (mode_line_string_face) ? Qnil
15828          Fcons (Qface, Fcons (mode_line_string_face, Qnil));             : Fcons (Qface, Fcons (mode_line_string_face, Qnil)));
15829    
15830        /* We need a dummy last element in mode_line_string_list to        /* We need a dummy last element in mode_line_string_list to
15831           indicate we are building the propertized mode-line string.           indicate we are building the propertized mode-line string.
15832           Using mode_line_string_face_prop here GC protects it.  */           Using mode_line_string_face_prop here GC protects it.  */
15833        mode_line_string_list =        mode_line_string_list
15834          Fcons (mode_line_string_face_prop, Qnil);          = Fcons (mode_line_string_face_prop, Qnil);
15835        frame_title_ptr = NULL;        frame_title_ptr = NULL;
15836      }      }
15837    else    else
# Line 20868  note_mouse_highlight (f, x, y) Line 20912  note_mouse_highlight (f, x, y)
20912    
20913    if (part == ON_VERTICAL_BORDER)    if (part == ON_VERTICAL_BORDER)
20914      cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;      cursor = FRAME_X_OUTPUT (f)->horizontal_drag_cursor;
20915    else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE)    else if (part == ON_LEFT_FRINGE || part == ON_RIGHT_FRINGE
20916               || part == ON_SCROLL_BAR)
20917      cursor = FRAME_X_OUTPUT (f)->nontext_cursor;      cursor = FRAME_X_OUTPUT (f)->nontext_cursor;
20918    else    else
20919      cursor = FRAME_X_OUTPUT (f)->text_cursor;      cursor = FRAME_X_OUTPUT (f)->text_cursor;

Legend:
Removed from v.1.897  
changed lines
  Added in v.1.897.2.1

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