/[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.754.2.38 by miles, Fri Nov 12 04:21:15 2004 UTC revision 1.754.2.39 by miles, Wed Dec 8 23:31:37 2004 UTC
# Line 264  int mouse_autoselect_window; Line 264  int mouse_autoselect_window;
264    
265  int auto_raise_tool_bar_buttons_p;  int auto_raise_tool_bar_buttons_p;
266    
267    /* Non-zero means to reposition window if cursor line is only partially visible.  */
268    
269    int make_cursor_line_fully_visible_p;
270    
271  /* Margin around tool bar buttons in pixels.  */  /* Margin around tool bar buttons in pixels.  */
272    
273  Lisp_Object Vtool_bar_button_margin;  Lisp_Object Vtool_bar_button_margin;
# Line 888  static void next_overlay_string P_ ((str Line 892  static void next_overlay_string P_ ((str
892  static void reseat P_ ((struct it *, struct text_pos, int));  static void reseat P_ ((struct it *, struct text_pos, int));
893  static void reseat_1 P_ ((struct it *, struct text_pos, int));  static void reseat_1 P_ ((struct it *, struct text_pos, int));
894  static void back_to_previous_visible_line_start P_ ((struct it *));  static void back_to_previous_visible_line_start P_ ((struct it *));
895  static void reseat_at_previous_visible_line_start P_ ((struct it *));  void reseat_at_previous_visible_line_start P_ ((struct it *));
896  static void reseat_at_next_visible_line_start P_ ((struct it *, int));  static void reseat_at_next_visible_line_start P_ ((struct it *, int));
897  static int next_element_from_display_vector P_ ((struct it *));  static int next_element_from_display_vector P_ ((struct it *));
898  static int next_element_from_string P_ ((struct it *));  static int next_element_from_string P_ ((struct it *));
# Line 1785  get_glyph_string_clip_rect (s, nr) Line 1789  get_glyph_string_clip_rect (s, nr)
1789    
1790        /* If drawing a tool-bar window, draw it over the internal border        /* If drawing a tool-bar window, draw it over the internal border
1791           at the top of the window.  */           at the top of the window.  */
1792        if (s->w == XWINDOW (s->f->tool_bar_window))        if (WINDOWP (s->f->tool_bar_window)
1793              && s->w == XWINDOW (s->f->tool_bar_window))
1794          r.y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);          r.y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);
1795      }      }
1796    
# Line 2075  init_iterator (it, w, charpos, bytepos, Line 2080  init_iterator (it, w, charpos, bytepos,
2080                                    * FRAME_LINE_HEIGHT (it->f));                                    * FRAME_LINE_HEIGHT (it->f));
2081        else if (it->f->extra_line_spacing > 0)        else if (it->f->extra_line_spacing > 0)
2082          it->extra_line_spacing = it->f->extra_line_spacing;          it->extra_line_spacing = it->f->extra_line_spacing;
2083          it->max_extra_line_spacing = 0;
2084      }      }
2085    
2086    /* If realized faces have been removed, e.g. because of face    /* If realized faces have been removed, e.g. because of face
# Line 4587  back_to_previous_visible_line_start (it) Line 4593  back_to_previous_visible_line_start (it)
4593     selective display.  At the end, update IT's overlay information,     selective display.  At the end, update IT's overlay information,
4594     face information etc.  */     face information etc.  */
4595    
4596  static void  void
4597  reseat_at_previous_visible_line_start (it)  reseat_at_previous_visible_line_start (it)
4598       struct it *it;       struct it *it;
4599  {  {
# Line 4892  get_next_display_element (it) Line 4898  get_next_display_element (it)
4898               translated to octal form.  */               translated to octal form.  */
4899            else if ((it->c < ' '            else if ((it->c < ' '
4900                      && (it->area != TEXT_AREA                      && (it->area != TEXT_AREA
4901                          /* In mode line, treat \n, \t like other crl chars.  */                          /* In mode line, treat \n like other crl chars.  */
4902                          || (it->glyph_row && it->glyph_row->mode_line_p)                          || (it->c != '\n'
4903                                && it->glyph_row && it->glyph_row->mode_line_p)
4904                          || (it->c != '\n' && it->c != '\t')))                          || (it->c != '\n' && it->c != '\t')))
4905                     || (it->multibyte_p                     || (it->multibyte_p
4906                         ? ((it->c >= 127                         ? ((it->c >= 127
# Line 6067  move_it_vertically_backward (it, dy) Line 6074  move_it_vertically_backward (it, dy)
6074  {  {
6075    int nlines, h;    int nlines, h;
6076    struct it it2, it3;    struct it it2, it3;
6077    int start_pos = IT_CHARPOS (*it);    int start_pos;
6078    
6079     move_further_back:
6080    xassert (dy >= 0);    xassert (dy >= 0);
6081    
6082      start_pos = IT_CHARPOS (*it);
6083    
6084    /* Estimate how many newlines we must move back.  */    /* Estimate how many newlines we must move back.  */
6085    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));
6086    
# Line 6136  move_it_vertically_backward (it, dy) Line 6146  move_it_vertically_backward (it, dy)
6146               a line height of 13 pixels each, recentering with point               a line height of 13 pixels each, recentering with point
6147               on the bottom line will try to move -39/2 = 19 pixels               on the bottom line will try to move -39/2 = 19 pixels
6148               backward.  Try to avoid moving into the first line.  */               backward.  Try to avoid moving into the first line.  */
6149            && it->current_y - target_y > line_height / 3 * 2            && it->current_y - target_y > line_height * 2 / 3
6150            && IT_CHARPOS (*it) > BEGV)            && IT_CHARPOS (*it) > BEGV)
6151          {          {
6152            TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",            TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",
6153                         target_y - it->current_y));                         target_y - it->current_y));
6154            move_it_vertically (it, target_y - it->current_y);            dy = it->current_y - target_y;
6155            xassert (IT_CHARPOS (*it) >= BEGV);            goto move_further_back;
6156          }          }
6157        else if (target_y >= it->current_y + line_height        else if (target_y >= it->current_y + line_height
6158                 && IT_CHARPOS (*it) < ZV)                 && IT_CHARPOS (*it) < ZV)
# Line 6183  move_it_vertically (it, dy) Line 6193  move_it_vertically (it, dy)
6193  {  {
6194    if (dy <= 0)    if (dy <= 0)
6195      move_it_vertically_backward (it, -dy);      move_it_vertically_backward (it, -dy);
6196    else if (dy > 0)    else
6197      {      {
6198        TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy));        TRACE_MOVE ((stderr, "move_it_v: from %d, %d\n", IT_CHARPOS (*it), dy));
6199        move_it_to (it, ZV, -1, it->current_y + dy, -1,        move_it_to (it, ZV, -1, it->current_y + dy, -1,
# Line 6280  move_it_by_lines (it, dvpos, need_y_p) Line 6290  move_it_by_lines (it, dvpos, need_y_p)
6290        /* DVPOS == 0 means move to the start of the screen line.  */        /* DVPOS == 0 means move to the start of the screen line.  */
6291        move_it_vertically_backward (it, 0);        move_it_vertically_backward (it, 0);
6292        xassert (it->current_x == 0 && it->hpos == 0);        xassert (it->current_x == 0 && it->hpos == 0);
6293          /* Let next call to line_bottom_y calculate real line height */
6294          last_height = 0;
6295      }      }
6296    else if (dvpos > 0)    else if (dvpos > 0)
6297      move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);      move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
# Line 6691  message3 (m, nbytes, multibyte) Line 6703  message3 (m, nbytes, multibyte)
6703    struct gcpro gcpro1;    struct gcpro gcpro1;
6704    
6705    GCPRO1 (m);    GCPRO1 (m);
6706      clear_message (1,1);
6707    
6708    /* First flush out any partial line written with print.  */    /* First flush out any partial line written with print.  */
6709    message_log_maybe_newline ();    message_log_maybe_newline ();
# Line 7423  resize_mini_window (w, exact_p) Line 7436  resize_mini_window (w, exact_p)
7436              height = it.current_y + last_height;              height = it.current_y + last_height;
7437            else            else
7438              height = it.current_y + it.max_ascent + it.max_descent;              height = it.current_y + it.max_ascent + it.max_descent;
7439            height -= it.extra_line_spacing;            height -= min (it.extra_line_spacing, it.max_extra_line_spacing);
7440            height = (height + unit - 1) / unit;            height = (height + unit - 1) / unit;
7441          }          }
7442    
# Line 8701  display_tool_bar_line (it) Line 8714  display_tool_bar_line (it)
8714      {      {
8715        row->height = row->phys_height = it->last_visible_y - row->y;        row->height = row->phys_height = it->last_visible_y - row->y;
8716        row->ascent = row->phys_ascent = 0;        row->ascent = row->phys_ascent = 0;
8717          row->extra_line_spacing = 0;
8718      }      }
8719    
8720    row->full_width_p = 1;    row->full_width_p = 1;
# Line 10880  make_cursor_line_fully_visible (w, force Line 10894  make_cursor_line_fully_visible (w, force
10894    struct glyph_row *row;    struct glyph_row *row;
10895    int window_height;    int window_height;
10896    
10897      if (!make_cursor_line_fully_visible_p)
10898        return 1;
10899    
10900    /* It's not always possible to find the cursor, e.g, when a window    /* It's not always possible to find the cursor, e.g, when a window
10901       is full of overlay strings.  Don't do anything in that case.  */       is full of overlay strings.  Don't do anything in that case.  */
10902    if (w->cursor.vpos < 0)    if (w->cursor.vpos < 0)
# Line 10889  make_cursor_line_fully_visible (w, force Line 10906  make_cursor_line_fully_visible (w, force
10906    row = MATRIX_ROW (matrix, w->cursor.vpos);    row = MATRIX_ROW (matrix, w->cursor.vpos);
10907    
10908    /* If the cursor row is not partially visible, there's nothing to do.  */    /* If the cursor row is not partially visible, there's nothing to do.  */
10909    if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row))    if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
10910      return 1;      return 1;
10911    
10912    /* If the row the cursor is in is taller than the window's height,    /* If the row the cursor is in is taller than the window's height,
# Line 11043  try_scrolling (window, just_this_one_p, Line 11060  try_scrolling (window, just_this_one_p,
11060      {      {
11061        start_display (&it, w, scroll_margin_pos);        start_display (&it, w, scroll_margin_pos);
11062        if (this_scroll_margin)        if (this_scroll_margin)
11063          move_it_vertically (&it, - this_scroll_margin);          move_it_vertically_backward (&it, this_scroll_margin);
11064        if (extra_scroll_margin_lines)        if (extra_scroll_margin_lines)
11065          move_it_by_lines (&it, - extra_scroll_margin_lines, 0);          move_it_by_lines (&it, - extra_scroll_margin_lines, 0);
11066        scroll_margin_pos = it.current.pos;        scroll_margin_pos = it.current.pos;
# Line 11163  try_scrolling (window, just_this_one_p, Line 11180  try_scrolling (window, just_this_one_p,
11180            if (amount_to_scroll <= 0)            if (amount_to_scroll <= 0)
11181              return SCROLLING_FAILED;              return SCROLLING_FAILED;
11182    
11183            move_it_vertically (&it, - amount_to_scroll);            move_it_vertically_backward (&it, amount_to_scroll);
11184            startp = it.current.pos;            startp = it.current.pos;
11185          }          }
11186      }      }
# Line 11467  try_cursor_movement (window, startp, scr Line 11484  try_cursor_movement (window, startp, scr
11484                /* if PT is not in the glyph row, give up.  */                /* if PT is not in the glyph row, give up.  */
11485                rc = CURSOR_MOVEMENT_MUST_SCROLL;                rc = CURSOR_MOVEMENT_MUST_SCROLL;
11486              }              }
11487            else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (row))            else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
11488                       && make_cursor_line_fully_visible_p)
11489              {              {
11490                if (PT == MATRIX_ROW_END_CHARPOS (row)                if (PT == MATRIX_ROW_END_CHARPOS (row)
11491                    && !row->ends_at_zv_p                    && !row->ends_at_zv_p
# Line 12042  redisplay_window (window, just_this_one_ Line 12060  redisplay_window (window, just_this_one_
12060    if (it.current_y <= 0)    if (it.current_y <= 0)
12061      {      {
12062        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
12063        move_it_vertically (&it, 0);        move_it_vertically_backward (&it, 0);
12064        xassert (IT_CHARPOS (it) <= PT);        xassert (IT_CHARPOS (it) <= PT);
12065        it.current_y = 0;        it.current_y = 0;
12066      }      }
# Line 12391  try_window_reusing_current_matrix (w) Line 12409  try_window_reusing_current_matrix (w)
12409    /* Give up if old or new display is scrolled vertically.  We could    /* Give up if old or new display is scrolled vertically.  We could
12410       make this function handle this, but right now it doesn't.  */       make this function handle this, but right now it doesn't.  */
12411    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
12412    if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row))    if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row))
12413      return 0;      return 0;
12414    
12415    /* The variable new_start now holds the new window start.  The old    /* The variable new_start now holds the new window start.  The old
# Line 12439  try_window_reusing_current_matrix (w) Line 12457  try_window_reusing_current_matrix (w)
12457                start = start_row->start.pos;                start = start_row->start.pos;
12458                /* If there are no more rows to try, or just one, give up.  */                /* If there are no more rows to try, or just one, give up.  */
12459                if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1                if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
12460                    || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)                    || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
12461                    || CHARPOS (start) == ZV)                    || CHARPOS (start) == ZV)
12462                  {                  {
12463                    clear_glyph_matrix (w->desired_matrix);                    clear_glyph_matrix (w->desired_matrix);
# Line 13508  try_window_id (w) Line 13526  try_window_id (w)
13526           && CHARPOS (start) > BEGV)           && CHARPOS (start) > BEGV)
13527          /* Old redisplay didn't take scroll margin into account at the bottom,          /* Old redisplay didn't take scroll margin into account at the bottom,
13528             but then global-hl-line-mode doesn't scroll.  KFS 2004-06-14 */             but then global-hl-line-mode doesn't scroll.  KFS 2004-06-14 */
13529          || w->cursor.y + cursor_height + this_scroll_margin > it.last_visible_y)          || (w->cursor.y + (make_cursor_line_fully_visible_p
13530                               ? cursor_height + this_scroll_margin
13531                               : 1)) > it.last_visible_y)
13532        {        {
13533          w->cursor.vpos = -1;          w->cursor.vpos = -1;
13534          clear_glyph_matrix (w->desired_matrix);          clear_glyph_matrix (w->desired_matrix);
# Line 14233  compute_line_metrics (it) Line 14253  compute_line_metrics (it)
14253            row->height = it->max_ascent + it->max_descent;            row->height = it->max_ascent + it->max_descent;
14254            row->phys_ascent = it->max_phys_ascent;            row->phys_ascent = it->max_phys_ascent;
14255            row->phys_height = it->max_phys_ascent + it->max_phys_descent;            row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14256              row->extra_line_spacing = it->max_extra_line_spacing;
14257          }          }
14258    
14259        /* Compute the width of this line.  */        /* Compute the width of this line.  */
# Line 14276  compute_line_metrics (it) Line 14297  compute_line_metrics (it)
14297          row->pixel_width -= it->truncation_pixel_width;          row->pixel_width -= it->truncation_pixel_width;
14298        row->ascent = row->phys_ascent = 0;        row->ascent = row->phys_ascent = 0;
14299        row->height = row->phys_height = row->visible_height = 1;        row->height = row->phys_height = row->visible_height = 1;
14300          row->extra_line_spacing = 0;
14301      }      }
14302    
14303    /* Compute a hash code for this row.  */    /* Compute a hash code for this row.  */
# Line 14612  display_line (it) Line 14634  display_line (it)
14634    row->height = it->max_ascent + it->max_descent;    row->height = it->max_ascent + it->max_descent;
14635    row->phys_ascent = it->max_phys_ascent;    row->phys_ascent = it->max_phys_ascent;
14636    row->phys_height = it->max_phys_ascent + it->max_phys_descent;    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14637      row->extra_line_spacing = it->max_extra_line_spacing;
14638    
14639    /* Loop generating characters.  The loop is left with IT on the next    /* Loop generating characters.  The loop is left with IT on the next
14640       character to display.  */       character to display.  */
# Line 14677  display_line (it) Line 14700  display_line (it)
14700            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14701            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14702                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14703              row->extra_line_spacing = max (row->extra_line_spacing,
14704                                             it->max_extra_line_spacing);
14705            set_iterator_to_next (it, 1);            set_iterator_to_next (it, 1);
14706            continue;            continue;
14707          }          }
# Line 14705  display_line (it) Line 14730  display_line (it)
14730            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14731            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14732                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14733              row->extra_line_spacing = max (row->extra_line_spacing,
14734                                             it->max_extra_line_spacing);
14735            if (it->current_x - it->pixel_width < it->first_visible_x)            if (it->current_x - it->pixel_width < it->first_visible_x)
14736              row->x = x - it->first_visible_x;              row->x = x - it->first_visible_x;
14737          }          }
# Line 14856  display_line (it) Line 14883  display_line (it)
14883            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14884            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14885                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14886              row->extra_line_spacing = max (row->extra_line_spacing,
14887                                             it->max_extra_line_spacing);
14888    
14889            /* End of this display line if row is continued.  */            /* End of this display line if row is continued.  */
14890            if (row->continued_p || row->ends_at_zv_p)            if (row->continued_p || row->ends_at_zv_p)
# Line 15483  display_mode_element (it, depth, field_w Line 15512  display_mode_element (it, depth, field_w
15512                    {                    {
15513                      int bytepos = last - lisp_string;                      int bytepos = last - lisp_string;
15514                      int charpos = string_byte_to_char (elt, bytepos);                      int charpos = string_byte_to_char (elt, bytepos);
15515                      int endpos = (precision <= 0 ? SCHARS (elt)                      int endpos = (precision <= 0
15516                                      ? string_byte_to_char (elt,
15517                                                             this - lisp_string)
15518                                    : charpos + nchars);                                    : charpos + nchars);
15519    
15520                      n += store_mode_line_string (NULL,                      n += store_mode_line_string (NULL,
# Line 15791  store_mode_line_string (string, lisp_str Line 15822  store_mode_line_string (string, lisp_str
15822          props = mode_line_string_face_prop;          props = mode_line_string_face_prop;
15823        else if (!NILP (mode_line_string_face))        else if (!NILP (mode_line_string_face))
15824          {          {
15825            Lisp_Object face = Fplist_get (props, Qface);            Lisp_Object face = Fsafe_plist_get (props, Qface);
15826            props = Fcopy_sequence (props);            props = Fcopy_sequence (props);
15827            if (NILP (face))            if (NILP (face))
15828              face = mode_line_string_face;              face = mode_line_string_face;
# Line 15816  store_mode_line_string (string, lisp_str Line 15847  store_mode_line_string (string, lisp_str
15847            Lisp_Object face;            Lisp_Object face;
15848            if (NILP (props))            if (NILP (props))
15849              props = Ftext_properties_at (make_number (0), lisp_string);              props = Ftext_properties_at (make_number (0), lisp_string);
15850            face = Fplist_get (props, Qface);            face = Fsafe_plist_get (props, Qface);
15851            if (NILP (face))            if (NILP (face))
15852              face = mode_line_string_face;              face = mode_line_string_face;
15853            else            else
# Line 16767  display_string (string, lisp_string, fac Line 16798  display_string (string, lisp_string, fac
16798    row->height = it->max_ascent + it->max_descent;    row->height = it->max_ascent + it->max_descent;
16799    row->phys_ascent = it->max_phys_ascent;    row->phys_ascent = it->max_phys_ascent;
16800    row->phys_height = it->max_phys_ascent + it->max_phys_descent;    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
16801      row->extra_line_spacing = it->max_extra_line_spacing;
16802    
16803    /* This condition is for the case that we are called with current_x    /* This condition is for the case that we are called with current_x
16804       past last_visible_x.  */       past last_visible_x.  */
# Line 16826  display_string (string, lisp_string, fac Line 16858  display_string (string, lisp_string, fac
16858            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
16859            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
16860                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
16861              row->extra_line_spacing = max (row->extra_line_spacing,
16862                                             it->max_extra_line_spacing);
16863            x += glyph->pixel_width;            x += glyph->pixel_width;
16864            ++i;            ++i;
16865          }          }
# Line 17262  init_glyph_string (s, OPTIONAL_HDC (hdc) Line 17296  init_glyph_string (s, OPTIONAL_HDC (hdc)
17296    s->y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);    s->y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
17297    
17298    /* Display the internal border below the tool-bar window.  */    /* Display the internal border below the tool-bar window.  */
17299    if (s->w == XWINDOW (s->f->tool_bar_window))    if (WINDOWP (s->f->tool_bar_window)
17300          && s->w == XWINDOW (s->f->tool_bar_window))
17301      s->y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);      s->y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);
17302    
17303    s->ybase = s->y + row->ascent;    s->ybase = s->y + row->ascent;
# Line 18594  produce_stretch_glyph (it) Line 18629  produce_stretch_glyph (it)
18629    plist = XCDR (it->object);    plist = XCDR (it->object);
18630    
18631    /* Compute the width of the stretch.  */    /* Compute the width of the stretch.  */
18632    if ((prop = Fplist_get (plist, QCwidth), !NILP (prop))    if ((prop = Fsafe_plist_get (plist, QCwidth), !NILP (prop))
18633        && calc_pixel_width_or_height (&tem, it, prop, font, 1, 0))        && calc_pixel_width_or_height (&tem, it, prop, font, 1, 0))
18634      {      {
18635        /* Absolute width `:width WIDTH' specified and valid.  */        /* Absolute width `:width WIDTH' specified and valid.  */
18636        zero_width_ok_p = 1;        zero_width_ok_p = 1;
18637        width = (int)tem;        width = (int)tem;
18638      }      }
18639    else if (prop = Fplist_get (plist, QCrelative_width),    else if (prop = Fsafe_plist_get (plist, QCrelative_width),
18640             NUMVAL (prop) > 0)             NUMVAL (prop) > 0)
18641      {      {
18642        /* Relative width `:relative-width FACTOR' specified and valid.        /* Relative width `:relative-width FACTOR' specified and valid.
# Line 18625  produce_stretch_glyph (it) Line 18660  produce_stretch_glyph (it)
18660        x_produce_glyphs (&it2);        x_produce_glyphs (&it2);
18661        width = NUMVAL (prop) * it2.pixel_width;        width = NUMVAL (prop) * it2.pixel_width;
18662      }      }
18663    else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))    else if ((prop = Fsafe_plist_get (plist, QCalign_to), !NILP (prop))
18664             && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to))             && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to))
18665      {      {
18666        if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)        if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
# Line 18645  produce_stretch_glyph (it) Line 18680  produce_stretch_glyph (it)
18680      width = 1;      width = 1;
18681    
18682    /* Compute height.  */    /* Compute height.  */
18683    if ((prop = Fplist_get (plist, QCheight), !NILP (prop))    if ((prop = Fsafe_plist_get (plist, QCheight), !NILP (prop))
18684        && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))        && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
18685      {      {
18686        height = (int)tem;        height = (int)tem;
18687        zero_height_ok_p = 1;        zero_height_ok_p = 1;
18688      }      }
18689    else if (prop = Fplist_get (plist, QCrelative_height),    else if (prop = Fsafe_plist_get (plist, QCrelative_height),
18690             NUMVAL (prop) > 0)             NUMVAL (prop) > 0)
18691      height = FONT_HEIGHT (font) * NUMVAL (prop);      height = FONT_HEIGHT (font) * NUMVAL (prop);
18692    else    else
# Line 18663  produce_stretch_glyph (it) Line 18698  produce_stretch_glyph (it)
18698    /* Compute percentage of height used for ascent.  If    /* Compute percentage of height used for ascent.  If
18699       `:ascent ASCENT' is present and valid, use that.  Otherwise,       `:ascent ASCENT' is present and valid, use that.  Otherwise,
18700       derive the ascent from the font in use.  */       derive the ascent from the font in use.  */
18701    if (prop = Fplist_get (plist, QCascent),    if (prop = Fsafe_plist_get (plist, QCascent),
18702        NUMVAL (prop) > 0 && NUMVAL (prop) <= 100)        NUMVAL (prop) > 0 && NUMVAL (prop) <= 100)
18703      ascent = height * NUMVAL (prop) / 100.0;      ascent = height * NUMVAL (prop) / 100.0;
18704    else if (!NILP (prop)    else if (!NILP (prop)
# Line 19448  x_produce_glyphs (it) Line 19483  x_produce_glyphs (it)
19483      it->current_x += it->pixel_width;      it->current_x += it->pixel_width;
19484    
19485    if (extra_line_spacing > 0)    if (extra_line_spacing > 0)
19486      it->descent += extra_line_spacing;      {
19487          it->descent += extra_line_spacing;
19488          if (extra_line_spacing > it->max_extra_line_spacing)
19489            it->max_extra_line_spacing = extra_line_spacing;
19490        }
19491    
19492    it->max_ascent = max (it->max_ascent, it->ascent);    it->max_ascent = max (it->max_ascent, it->ascent);
19493    it->max_descent = max (it->max_descent, it->descent);    it->max_descent = max (it->max_descent, it->descent);
# Line 20030  erase_phys_cursor (w) Line 20069  erase_phys_cursor (w)
20069    if (!cursor_row->enabled_p)    if (!cursor_row->enabled_p)
20070      goto mark_cursor_off;      goto mark_cursor_off;
20071    
20072      /* If line spacing is > 0, old cursor may only be partially visible in
20073         window after split-window.  So adjust visible height.  */
20074      cursor_row->visible_height = min (cursor_row->visible_height,
20075                                        window_text_bottom_y (w) - cursor_row->y);
20076    
20077    /* If row is completely invisible, don't attempt to delete a cursor which    /* If row is completely invisible, don't attempt to delete a cursor which
20078       isn't there.  This can happen if cursor is at top of a window, and       isn't there.  This can happen if cursor is at top of a window, and
20079       we switch to a buffer with a header line in that window.  */       we switch to a buffer with a header line in that window.  */
# Line 20863  note_mode_line_or_margin_highlight (w, x Line 20907  note_mode_line_or_margin_highlight (w, x
20907    if (IMAGEP (object))    if (IMAGEP (object))
20908      {      {
20909        Lisp_Object image_map, hotspot;        Lisp_Object image_map, hotspot;
20910        if ((image_map = Fplist_get (XCDR (object), QCmap),        if ((image_map = Fsafe_plist_get (XCDR (object), QCmap),
20911             !NILP (image_map))             !NILP (image_map))
20912            && (hotspot = find_hot_spot (image_map, dx, dy),            && (hotspot = find_hot_spot (image_map, dx, dy),
20913                CONSP (hotspot))                CONSP (hotspot))
# Line 20875  note_mode_line_or_margin_highlight (w, x Line 20919  note_mode_line_or_margin_highlight (w, x
20919            /* Could check AREA_ID to see if we enter/leave this hot-spot.            /* Could check AREA_ID to see if we enter/leave this hot-spot.
20920               If so, we could look for mouse-enter, mouse-leave               If so, we could look for mouse-enter, mouse-leave
20921               properties in PLIST (and do something...).  */               properties in PLIST (and do something...).  */
20922            if ((plist = XCDR (hotspot), CONSP (plist)))            hotspot = XCDR (hotspot);
20923              if (CONSP (hotspot)
20924                  && (plist = XCAR (hotspot), CONSP (plist)))
20925              {              {
20926                pointer = Fplist_get (plist, Qpointer);                pointer = Fsafe_plist_get (plist, Qpointer);
20927                if (NILP (pointer))                if (NILP (pointer))
20928                  pointer = Qhand;                  pointer = Qhand;
20929                help = Fplist_get (plist, Qhelp_echo);                help = Fsafe_plist_get (plist, Qhelp_echo);
20930                if (!NILP (help))                if (!NILP (help))
20931                  {                  {
20932                    help_echo_string = help;                    help_echo_string = help;
# Line 20891  note_mode_line_or_margin_highlight (w, x Line 20937  note_mode_line_or_margin_highlight (w, x
20937                  }                  }
20938              }              }
20939            if (NILP (pointer))            if (NILP (pointer))
20940              pointer = Fplist_get (XCDR (object), QCpointer);              pointer = Fsafe_plist_get (XCDR (object), QCpointer);
20941          }          }
20942      }      }
20943    
# Line 21042  note_mouse_highlight (f, x, y) Line 21088  note_mouse_highlight (f, x, y)
21088            if (img != NULL && IMAGEP (img->spec))            if (img != NULL && IMAGEP (img->spec))
21089              {              {
21090                Lisp_Object image_map, hotspot;                Lisp_Object image_map, hotspot;
21091                if ((image_map = Fplist_get (XCDR (img->spec), QCmap),                if ((image_map = Fsafe_plist_get (XCDR (img->spec), QCmap),
21092                     !NILP (image_map))                     !NILP (image_map))
21093                    && (hotspot = find_hot_spot (image_map,                    && (hotspot = find_hot_spot (image_map,
21094                                                 glyph->slice.x + dx,                                                 glyph->slice.x + dx,
# Line 21056  note_mouse_highlight (f, x, y) Line 21102  note_mouse_highlight (f, x, y)
21102                    /* Could check AREA_ID to see if we enter/leave this hot-spot.                    /* Could check AREA_ID to see if we enter/leave this hot-spot.
21103                       If so, we could look for mouse-enter, mouse-leave                       If so, we could look for mouse-enter, mouse-leave
21104                       properties in PLIST (and do something...).  */                       properties in PLIST (and do something...).  */
21105                    if ((plist = XCDR (hotspot), CONSP (plist)))                    hotspot = XCDR (hotspot);
21106                      if (CONSP (hotspot)
21107                          && (plist = XCAR (hotspot), CONSP (plist)))
21108                      {                      {
21109                        pointer = Fplist_get (plist, Qpointer);                        pointer = Fsafe_plist_get (plist, Qpointer);
21110                        if (NILP (pointer))                        if (NILP (pointer))
21111                          pointer = Qhand;                          pointer = Qhand;
21112                        help_echo_string = Fplist_get (plist, Qhelp_echo);                        help_echo_string = Fsafe_plist_get (plist, Qhelp_echo);
21113                        if (!NILP (help_echo_string))                        if (!NILP (help_echo_string))
21114                          {                          {
21115                            help_echo_window = window;                            help_echo_window = window;
# Line 21071  note_mouse_highlight (f, x, y) Line 21119  note_mouse_highlight (f, x, y)
21119                      }                      }
21120                  }                  }
21121                if (NILP (pointer))                if (NILP (pointer))
21122                  pointer = Fplist_get (XCDR (img->spec), QCpointer);                  pointer = Fsafe_plist_get (XCDR (img->spec), QCpointer);
21123              }              }
21124          }          }
21125    
# Line 22368  otherwise.  */); Line 22416  otherwise.  */);
22416      doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them.  */);      doc: /* *Non-nil means raise tool-bar buttons when the mouse moves over them.  */);
22417    auto_raise_tool_bar_buttons_p = 1;    auto_raise_tool_bar_buttons_p = 1;
22418    
22419      DEFVAR_BOOL ("make-cursor-line-fully-visible", &make_cursor_line_fully_visible_p,
22420        doc: /* *Non-nil means to scroll (recenter) cursor line if it is not fully visible.  */);
22421      make_cursor_line_fully_visible_p = 1;
22422    
22423    DEFVAR_LISP ("tool-bar-button-margin", &Vtool_bar_button_margin,    DEFVAR_LISP ("tool-bar-button-margin", &Vtool_bar_button_margin,
22424      doc: /* *Margin around tool-bar buttons in pixels.      doc: /* *Margin around tool-bar buttons in pixels.
22425  If an integer, use that for both horizontal and vertical margins.  If an integer, use that for both horizontal and vertical margins.

Legend:
Removed from v.1.754.2.38  
changed lines
  Added in v.1.754.2.39

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