/[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.843.2.32 by miles, Fri Nov 12 02:52:56 2004 UTC revision 1.843.2.33 by miles, Fri Nov 19 06:54:58 2004 UTC
# Line 265  int mouse_autoselect_window; Line 265  int mouse_autoselect_window;
265    
266  int auto_raise_tool_bar_buttons_p;  int auto_raise_tool_bar_buttons_p;
267    
268    /* Non-zero means to reposition window if cursor line is only partially visible.  */
269    
270    int make_cursor_line_fully_visible_p;
271    
272  /* Margin around tool bar buttons in pixels.  */  /* Margin around tool bar buttons in pixels.  */
273    
274  Lisp_Object Vtool_bar_button_margin;  Lisp_Object Vtool_bar_button_margin;
# Line 891  static void next_overlay_string P_ ((str Line 895  static void next_overlay_string P_ ((str
895  static void reseat P_ ((struct it *, struct text_pos, int));  static void reseat P_ ((struct it *, struct text_pos, int));
896  static void reseat_1 P_ ((struct it *, struct text_pos, int));  static void reseat_1 P_ ((struct it *, struct text_pos, int));
897  static void back_to_previous_visible_line_start P_ ((struct it *));  static void back_to_previous_visible_line_start P_ ((struct it *));
898  static void reseat_at_previous_visible_line_start P_ ((struct it *));  void reseat_at_previous_visible_line_start P_ ((struct it *));
899  static void reseat_at_next_visible_line_start P_ ((struct it *, int));  static void reseat_at_next_visible_line_start P_ ((struct it *, int));
900  static int next_element_from_display_vector P_ ((struct it *));  static int next_element_from_display_vector P_ ((struct it *));
901  static int next_element_from_string P_ ((struct it *));  static int next_element_from_string P_ ((struct it *));
# Line 1788  get_glyph_string_clip_rect (s, nr) Line 1792  get_glyph_string_clip_rect (s, nr)
1792    
1793        /* If drawing a tool-bar window, draw it over the internal border        /* If drawing a tool-bar window, draw it over the internal border
1794           at the top of the window.  */           at the top of the window.  */
1795        if (s->w == XWINDOW (s->f->tool_bar_window))        if (WINDOWP (s->f->tool_bar_window)
1796              && s->w == XWINDOW (s->f->tool_bar_window))
1797          r.y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);          r.y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);
1798      }      }
1799    
# Line 2078  init_iterator (it, w, charpos, bytepos, Line 2083  init_iterator (it, w, charpos, bytepos,
2083                                    * FRAME_LINE_HEIGHT (it->f));                                    * FRAME_LINE_HEIGHT (it->f));
2084        else if (it->f->extra_line_spacing > 0)        else if (it->f->extra_line_spacing > 0)
2085          it->extra_line_spacing = it->f->extra_line_spacing;          it->extra_line_spacing = it->f->extra_line_spacing;
2086          it->max_extra_line_spacing = 0;
2087      }      }
2088    
2089    /* If realized faces have been removed, e.g. because of face    /* If realized faces have been removed, e.g. because of face
# Line 4683  back_to_previous_visible_line_start (it) Line 4689  back_to_previous_visible_line_start (it)
4689     selective display.  At the end, update IT's overlay information,     selective display.  At the end, update IT's overlay information,
4690     face information etc.  */     face information etc.  */
4691    
4692  static void  void
4693  reseat_at_previous_visible_line_start (it)  reseat_at_previous_visible_line_start (it)
4694       struct it *it;       struct it *it;
4695  {  {
# Line 4988  get_next_display_element (it) Line 4994  get_next_display_element (it)
4994            else if ((it->c < ' '            else if ((it->c < ' '
4995                      ? (it->area != TEXT_AREA                      ? (it->area != TEXT_AREA
4996                         /* In mode line, treat \n, \t like other crl chars.  */                         /* In mode line, treat \n, \t like other crl chars.  */
4997                         || (it->glyph_row && it->glyph_row->mode_line_p)                         || (it->c != '\n'
4998                               && it->glyph_row && it->glyph_row->mode_line_p)
4999                         || (it->c != '\n' && it->c != '\t'))                         || (it->c != '\n' && it->c != '\t'))
5000                      : it->multibyte_p ? !CHAR_PRINTABLE_P (it->c)                      : it->multibyte_p ? !CHAR_PRINTABLE_P (it->c)
5001                      : (it->c >= 127                      : (it->c >= 127
# Line 6177  move_it_vertically_backward (it, dy) Line 6184  move_it_vertically_backward (it, dy)
6184  {  {
6185    int nlines, h;    int nlines, h;
6186    struct it it2, it3;    struct it it2, it3;
6187    int start_pos = IT_CHARPOS (*it);    int start_pos;
6188    
6189     move_further_back:
6190    xassert (dy >= 0);    xassert (dy >= 0);
6191    
6192      start_pos = IT_CHARPOS (*it);
6193    
6194    /* Estimate how many newlines we must move back.  */    /* Estimate how many newlines we must move back.  */
6195    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));    nlines = max (1, dy / FRAME_LINE_HEIGHT (it->f));
6196    
# Line 6246  move_it_vertically_backward (it, dy) Line 6256  move_it_vertically_backward (it, dy)
6256               a line height of 13 pixels each, recentering with point               a line height of 13 pixels each, recentering with point
6257               on the bottom line will try to move -39/2 = 19 pixels               on the bottom line will try to move -39/2 = 19 pixels
6258               backward.  Try to avoid moving into the first line.  */               backward.  Try to avoid moving into the first line.  */
6259            && it->current_y - target_y > line_height / 3 * 2            && it->current_y - target_y > line_height * 2 / 3
6260            && IT_CHARPOS (*it) > BEGV)            && IT_CHARPOS (*it) > BEGV)
6261          {          {
6262            TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",            TRACE_MOVE ((stderr, "  not far enough -> move_vert %d\n",
6263                         target_y - it->current_y));                         target_y - it->current_y));
6264            move_it_vertically (it, target_y - it->current_y);            dy = it->current_y - target_y;
6265            xassert (IT_CHARPOS (*it) >= BEGV);            goto move_further_back;
6266          }          }
6267        else if (target_y >= it->current_y + line_height        else if (target_y >= it->current_y + line_height
6268                 && IT_CHARPOS (*it) < ZV)                 && IT_CHARPOS (*it) < ZV)
# Line 6293  move_it_vertically (it, dy) Line 6303  move_it_vertically (it, dy)
6303  {  {
6304    if (dy <= 0)    if (dy <= 0)
6305      move_it_vertically_backward (it, -dy);      move_it_vertically_backward (it, -dy);
6306    else if (dy > 0)    else
6307      {      {
6308        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));
6309        move_it_to (it, ZV, -1, it->current_y + dy, -1,        move_it_to (it, ZV, -1, it->current_y + dy, -1,
# Line 6390  move_it_by_lines (it, dvpos, need_y_p) Line 6400  move_it_by_lines (it, dvpos, need_y_p)
6400        /* DVPOS == 0 means move to the start of the screen line.  */        /* DVPOS == 0 means move to the start of the screen line.  */
6401        move_it_vertically_backward (it, 0);        move_it_vertically_backward (it, 0);
6402        xassert (it->current_x == 0 && it->hpos == 0);        xassert (it->current_x == 0 && it->hpos == 0);
6403          /* Let next call to line_bottom_y calculate real line height */
6404          last_height = 0;
6405      }      }
6406    else if (dvpos > 0)    else if (dvpos > 0)
6407      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 6802  message3 (m, nbytes, multibyte) Line 6814  message3 (m, nbytes, multibyte)
6814    struct gcpro gcpro1;    struct gcpro gcpro1;
6815    
6816    GCPRO1 (m);    GCPRO1 (m);
6817      clear_message (1,1);
6818    
6819    /* First flush out any partial line written with print.  */    /* First flush out any partial line written with print.  */
6820    message_log_maybe_newline ();    message_log_maybe_newline ();
# Line 7534  resize_mini_window (w, exact_p) Line 7547  resize_mini_window (w, exact_p)
7547              height = it.current_y + last_height;              height = it.current_y + last_height;
7548            else            else
7549              height = it.current_y + it.max_ascent + it.max_descent;              height = it.current_y + it.max_ascent + it.max_descent;
7550            height -= it.extra_line_spacing;            height -= min (it.extra_line_spacing, it.max_extra_line_spacing);
7551            height = (height + unit - 1) / unit;            height = (height + unit - 1) / unit;
7552          }          }
7553    
# Line 8813  display_tool_bar_line (it) Line 8826  display_tool_bar_line (it)
8826      {      {
8827        row->height = row->phys_height = it->last_visible_y - row->y;        row->height = row->phys_height = it->last_visible_y - row->y;
8828        row->ascent = row->phys_ascent = 0;        row->ascent = row->phys_ascent = 0;
8829          row->extra_line_spacing = 0;
8830      }      }
8831    
8832    row->full_width_p = 1;    row->full_width_p = 1;
# Line 10981  make_cursor_line_fully_visible (w, force Line 10995  make_cursor_line_fully_visible (w, force
10995    struct glyph_row *row;    struct glyph_row *row;
10996    int window_height;    int window_height;
10997    
10998      if (!make_cursor_line_fully_visible_p)
10999        return 1;
11000    
11001    /* 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
11002       is full of overlay strings.  Don't do anything in that case.  */       is full of overlay strings.  Don't do anything in that case.  */
11003    if (w->cursor.vpos < 0)    if (w->cursor.vpos < 0)
# Line 10990  make_cursor_line_fully_visible (w, force Line 11007  make_cursor_line_fully_visible (w, force
11007    row = MATRIX_ROW (matrix, w->cursor.vpos);    row = MATRIX_ROW (matrix, w->cursor.vpos);
11008    
11009    /* 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.  */
11010    if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row))    if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row))
11011      return 1;      return 1;
11012    
11013    /* 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 11144  try_scrolling (window, just_this_one_p, Line 11161  try_scrolling (window, just_this_one_p,
11161      {      {
11162        start_display (&it, w, scroll_margin_pos);        start_display (&it, w, scroll_margin_pos);
11163        if (this_scroll_margin)        if (this_scroll_margin)
11164          move_it_vertically (&it, - this_scroll_margin);          move_it_vertically_backward (&it, this_scroll_margin);
11165        if (extra_scroll_margin_lines)        if (extra_scroll_margin_lines)
11166          move_it_by_lines (&it, - extra_scroll_margin_lines, 0);          move_it_by_lines (&it, - extra_scroll_margin_lines, 0);
11167        scroll_margin_pos = it.current.pos;        scroll_margin_pos = it.current.pos;
# Line 11264  try_scrolling (window, just_this_one_p, Line 11281  try_scrolling (window, just_this_one_p,
11281            if (amount_to_scroll <= 0)            if (amount_to_scroll <= 0)
11282              return SCROLLING_FAILED;              return SCROLLING_FAILED;
11283    
11284            move_it_vertically (&it, - amount_to_scroll);            move_it_vertically_backward (&it, amount_to_scroll);
11285            startp = it.current.pos;            startp = it.current.pos;
11286          }          }
11287      }      }
# Line 11568  try_cursor_movement (window, startp, scr Line 11585  try_cursor_movement (window, startp, scr
11585                /* if PT is not in the glyph row, give up.  */                /* if PT is not in the glyph row, give up.  */
11586                rc = CURSOR_MOVEMENT_MUST_SCROLL;                rc = CURSOR_MOVEMENT_MUST_SCROLL;
11587              }              }
11588            else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (row))            else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
11589                       && make_cursor_line_fully_visible_p)
11590              {              {
11591                if (PT == MATRIX_ROW_END_CHARPOS (row)                if (PT == MATRIX_ROW_END_CHARPOS (row)
11592                    && !row->ends_at_zv_p                    && !row->ends_at_zv_p
# Line 12143  redisplay_window (window, just_this_one_ Line 12161  redisplay_window (window, just_this_one_
12161    if (it.current_y <= 0)    if (it.current_y <= 0)
12162      {      {
12163        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);        init_iterator (&it, w, PT, PT_BYTE, NULL, DEFAULT_FACE_ID);
12164        move_it_vertically (&it, 0);        move_it_vertically_backward (&it, 0);
12165        xassert (IT_CHARPOS (it) <= PT);        xassert (IT_CHARPOS (it) <= PT);
12166        it.current_y = 0;        it.current_y = 0;
12167      }      }
# Line 12492  try_window_reusing_current_matrix (w) Line 12510  try_window_reusing_current_matrix (w)
12510    /* Give up if old or new display is scrolled vertically.  We could    /* Give up if old or new display is scrolled vertically.  We could
12511       make this function handle this, but right now it doesn't.  */       make this function handle this, but right now it doesn't.  */
12512    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);    start_row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
12513    if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row))    if (w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row))
12514      return 0;      return 0;
12515    
12516    /* 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 12540  try_window_reusing_current_matrix (w) Line 12558  try_window_reusing_current_matrix (w)
12558                start = start_row->start.pos;                start = start_row->start.pos;
12559                /* 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.  */
12560                if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1                if (start_row == MATRIX_MODE_LINE_ROW (w->current_matrix) - 1
12561                    || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (start_row)                    || w->vscroll || MATRIX_ROW_PARTIALLY_VISIBLE_P (w, start_row)
12562                    || CHARPOS (start) == ZV)                    || CHARPOS (start) == ZV)
12563                  {                  {
12564                    clear_glyph_matrix (w->desired_matrix);                    clear_glyph_matrix (w->desired_matrix);
# Line 13609  try_window_id (w) Line 13627  try_window_id (w)
13627           && CHARPOS (start) > BEGV)           && CHARPOS (start) > BEGV)
13628          /* Old redisplay didn't take scroll margin into account at the bottom,          /* Old redisplay didn't take scroll margin into account at the bottom,
13629             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 */
13630          || w->cursor.y + cursor_height + this_scroll_margin > it.last_visible_y)          || (w->cursor.y + (make_cursor_line_fully_visible_p
13631                               ? cursor_height + this_scroll_margin
13632                               : 1)) > it.last_visible_y)
13633        {        {
13634          w->cursor.vpos = -1;          w->cursor.vpos = -1;
13635          clear_glyph_matrix (w->desired_matrix);          clear_glyph_matrix (w->desired_matrix);
# Line 14334  compute_line_metrics (it) Line 14354  compute_line_metrics (it)
14354            row->height = it->max_ascent + it->max_descent;            row->height = it->max_ascent + it->max_descent;
14355            row->phys_ascent = it->max_phys_ascent;            row->phys_ascent = it->max_phys_ascent;
14356            row->phys_height = it->max_phys_ascent + it->max_phys_descent;            row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14357              row->extra_line_spacing = it->max_extra_line_spacing;
14358          }          }
14359    
14360        /* Compute the width of this line.  */        /* Compute the width of this line.  */
# Line 14377  compute_line_metrics (it) Line 14398  compute_line_metrics (it)
14398          row->pixel_width -= it->truncation_pixel_width;          row->pixel_width -= it->truncation_pixel_width;
14399        row->ascent = row->phys_ascent = 0;        row->ascent = row->phys_ascent = 0;
14400        row->height = row->phys_height = row->visible_height = 1;        row->height = row->phys_height = row->visible_height = 1;
14401          row->extra_line_spacing = 0;
14402      }      }
14403    
14404    /* Compute a hash code for this row.  */    /* Compute a hash code for this row.  */
# Line 14713  display_line (it) Line 14735  display_line (it)
14735    row->height = it->max_ascent + it->max_descent;    row->height = it->max_ascent + it->max_descent;
14736    row->phys_ascent = it->max_phys_ascent;    row->phys_ascent = it->max_phys_ascent;
14737    row->phys_height = it->max_phys_ascent + it->max_phys_descent;    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
14738      row->extra_line_spacing = it->max_extra_line_spacing;
14739    
14740    /* Loop generating characters.  The loop is left with IT on the next    /* Loop generating characters.  The loop is left with IT on the next
14741       character to display.  */       character to display.  */
# Line 14778  display_line (it) Line 14801  display_line (it)
14801            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14802            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14803                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14804              row->extra_line_spacing = max (row->extra_line_spacing,
14805                                             it->max_extra_line_spacing);
14806            set_iterator_to_next (it, 1);            set_iterator_to_next (it, 1);
14807            continue;            continue;
14808          }          }
# Line 14806  display_line (it) Line 14831  display_line (it)
14831            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14832            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14833                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14834              row->extra_line_spacing = max (row->extra_line_spacing,
14835                                             it->max_extra_line_spacing);
14836            if (it->current_x - it->pixel_width < it->first_visible_x)            if (it->current_x - it->pixel_width < it->first_visible_x)
14837              row->x = x - it->first_visible_x;              row->x = x - it->first_visible_x;
14838          }          }
# Line 14957  display_line (it) Line 14984  display_line (it)
14984            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
14985            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
14986                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
14987              row->extra_line_spacing = max (row->extra_line_spacing,
14988                                             it->max_extra_line_spacing);
14989    
14990            /* End of this display line if row is continued.  */            /* End of this display line if row is continued.  */
14991            if (row->continued_p || row->ends_at_zv_p)            if (row->continued_p || row->ends_at_zv_p)
# Line 15584  display_mode_element (it, depth, field_w Line 15613  display_mode_element (it, depth, field_w
15613                    {                    {
15614                      int bytepos = last - lisp_string;                      int bytepos = last - lisp_string;
15615                      int charpos = string_byte_to_char (elt, bytepos);                      int charpos = string_byte_to_char (elt, bytepos);
15616                      int endpos = (precision <= 0 ? SCHARS (elt)                      int endpos = (precision <= 0
15617                                      ? string_byte_to_char (elt,
15618                                                             this - lisp_string)
15619                                    : charpos + nchars);                                    : charpos + nchars);
15620    
15621                      n += store_mode_line_string (NULL,                      n += store_mode_line_string (NULL,
# Line 15892  store_mode_line_string (string, lisp_str Line 15923  store_mode_line_string (string, lisp_str
15923          props = mode_line_string_face_prop;          props = mode_line_string_face_prop;
15924        else if (!NILP (mode_line_string_face))        else if (!NILP (mode_line_string_face))
15925          {          {
15926            Lisp_Object face = Fplist_get (props, Qface);            Lisp_Object face = Fsafe_plist_get (props, Qface);
15927            props = Fcopy_sequence (props);            props = Fcopy_sequence (props);
15928            if (NILP (face))            if (NILP (face))
15929              face = mode_line_string_face;              face = mode_line_string_face;
# Line 15917  store_mode_line_string (string, lisp_str Line 15948  store_mode_line_string (string, lisp_str
15948            Lisp_Object face;            Lisp_Object face;
15949            if (NILP (props))            if (NILP (props))
15950              props = Ftext_properties_at (make_number (0), lisp_string);              props = Ftext_properties_at (make_number (0), lisp_string);
15951            face = Fplist_get (props, Qface);            face = Fsafe_plist_get (props, Qface);
15952            if (NILP (face))            if (NILP (face))
15953              face = mode_line_string_face;              face = mode_line_string_face;
15954            else            else
# Line 16871  display_string (string, lisp_string, fac Line 16902  display_string (string, lisp_string, fac
16902    row->height = it->max_ascent + it->max_descent;    row->height = it->max_ascent + it->max_descent;
16903    row->phys_ascent = it->max_phys_ascent;    row->phys_ascent = it->max_phys_ascent;
16904    row->phys_height = it->max_phys_ascent + it->max_phys_descent;    row->phys_height = it->max_phys_ascent + it->max_phys_descent;
16905      row->extra_line_spacing = it->max_extra_line_spacing;
16906    
16907    /* 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
16908       past last_visible_x.  */       past last_visible_x.  */
# Line 16930  display_string (string, lisp_string, fac Line 16962  display_string (string, lisp_string, fac
16962            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);            row->phys_ascent = max (row->phys_ascent, it->max_phys_ascent);
16963            row->phys_height = max (row->phys_height,            row->phys_height = max (row->phys_height,
16964                                    it->max_phys_ascent + it->max_phys_descent);                                    it->max_phys_ascent + it->max_phys_descent);
16965              row->extra_line_spacing = max (row->extra_line_spacing,
16966                                             it->max_extra_line_spacing);
16967            x += glyph->pixel_width;            x += glyph->pixel_width;
16968            ++i;            ++i;
16969          }          }
# Line 17366  init_glyph_string (s, OPTIONAL_HDC (hdc) Line 17400  init_glyph_string (s, OPTIONAL_HDC (hdc)
17400    s->y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);    s->y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
17401    
17402    /* Display the internal border below the tool-bar window.  */    /* Display the internal border below the tool-bar window.  */
17403    if (s->w == XWINDOW (s->f->tool_bar_window))    if (WINDOWP (s->f->tool_bar_window)
17404          && s->w == XWINDOW (s->f->tool_bar_window))
17405      s->y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);      s->y -= FRAME_INTERNAL_BORDER_WIDTH (s->f);
17406    
17407    s->ybase = s->y + row->ascent;    s->ybase = s->y + row->ascent;
# Line 18701  produce_stretch_glyph (it) Line 18736  produce_stretch_glyph (it)
18736    plist = XCDR (it->object);    plist = XCDR (it->object);
18737    
18738    /* Compute the width of the stretch.  */    /* Compute the width of the stretch.  */
18739    if ((prop = Fplist_get (plist, QCwidth), !NILP (prop))    if ((prop = Fsafe_plist_get (plist, QCwidth), !NILP (prop))
18740        && calc_pixel_width_or_height (&tem, it, prop, font, 1, 0))        && calc_pixel_width_or_height (&tem, it, prop, font, 1, 0))
18741      {      {
18742        /* Absolute width `:width WIDTH' specified and valid.  */        /* Absolute width `:width WIDTH' specified and valid.  */
18743        zero_width_ok_p = 1;        zero_width_ok_p = 1;
18744        width = (int)tem;        width = (int)tem;
18745      }      }
18746    else if (prop = Fplist_get (plist, QCrelative_width),    else if (prop = Fsafe_plist_get (plist, QCrelative_width),
18747             NUMVAL (prop) > 0)             NUMVAL (prop) > 0)
18748      {      {
18749        /* Relative width `:relative-width FACTOR' specified and valid.        /* Relative width `:relative-width FACTOR' specified and valid.
# Line 18732  produce_stretch_glyph (it) Line 18767  produce_stretch_glyph (it)
18767        x_produce_glyphs (&it2);        x_produce_glyphs (&it2);
18768        width = NUMVAL (prop) * it2.pixel_width;        width = NUMVAL (prop) * it2.pixel_width;
18769      }      }
18770    else if ((prop = Fplist_get (plist, QCalign_to), !NILP (prop))    else if ((prop = Fsafe_plist_get (plist, QCalign_to), !NILP (prop))
18771             && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to))             && calc_pixel_width_or_height (&tem, it, prop, font, 1, &align_to))
18772      {      {
18773        if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)        if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
# Line 18752  produce_stretch_glyph (it) Line 18787  produce_stretch_glyph (it)
18787      width = 1;      width = 1;
18788    
18789    /* Compute height.  */    /* Compute height.  */
18790    if ((prop = Fplist_get (plist, QCheight), !NILP (prop))    if ((prop = Fsafe_plist_get (plist, QCheight), !NILP (prop))
18791        && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))        && calc_pixel_width_or_height (&tem, it, prop, font, 0, 0))
18792      {      {
18793        height = (int)tem;        height = (int)tem;
18794        zero_height_ok_p = 1;        zero_height_ok_p = 1;
18795      }      }
18796    else if (prop = Fplist_get (plist, QCrelative_height),    else if (prop = Fsafe_plist_get (plist, QCrelative_height),
18797             NUMVAL (prop) > 0)             NUMVAL (prop) > 0)
18798      height = FONT_HEIGHT (font) * NUMVAL (prop);      height = FONT_HEIGHT (font) * NUMVAL (prop);
18799    else    else
# Line 18770  produce_stretch_glyph (it) Line 18805  produce_stretch_glyph (it)
18805    /* Compute percentage of height used for ascent.  If    /* Compute percentage of height used for ascent.  If
18806       `:ascent ASCENT' is present and valid, use that.  Otherwise,       `:ascent ASCENT' is present and valid, use that.  Otherwise,
18807       derive the ascent from the font in use.  */       derive the ascent from the font in use.  */
18808    if (prop = Fplist_get (plist, QCascent),    if (prop = Fsafe_plist_get (plist, QCascent),
18809        NUMVAL (prop) > 0 && NUMVAL (prop) <= 100)        NUMVAL (prop) > 0 && NUMVAL (prop) <= 100)
18810      ascent = height * NUMVAL (prop) / 100.0;      ascent = height * NUMVAL (prop) / 100.0;
18811    else if (!NILP (prop)    else if (!NILP (prop)
# Line 19594  x_produce_glyphs (it) Line 19629  x_produce_glyphs (it)
19629      it->current_x += it->pixel_width;      it->current_x += it->pixel_width;
19630    
19631    if (extra_line_spacing > 0)    if (extra_line_spacing > 0)
19632      it->descent += extra_line_spacing;      {
19633          it->descent += extra_line_spacing;
19634          if (extra_line_spacing > it->max_extra_line_spacing)
19635            it->max_extra_line_spacing = extra_line_spacing;
19636        }
19637    
19638    it->max_ascent = max (it->max_ascent, it->ascent);    it->max_ascent = max (it->max_ascent, it->ascent);
19639    it->max_descent = max (it->max_descent, it->descent);    it->max_descent = max (it->max_descent, it->descent);
# Line 20177  erase_phys_cursor (w) Line 20216  erase_phys_cursor (w)
20216    if (!cursor_row->enabled_p)    if (!cursor_row->enabled_p)
20217      goto mark_cursor_off;      goto mark_cursor_off;
20218    
20219      /* If line spacing is > 0, old cursor may only be partially visible in
20220         window after split-window.  So adjust visible height.  */
20221      cursor_row->visible_height = min (cursor_row->visible_height,
20222                                        window_text_bottom_y (w) - cursor_row->y);
20223    
20224    /* 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
20225       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
20226       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 21010  note_mode_line_or_margin_highlight (w, x Line 21054  note_mode_line_or_margin_highlight (w, x
21054    if (IMAGEP (object))    if (IMAGEP (object))
21055      {      {
21056        Lisp_Object image_map, hotspot;        Lisp_Object image_map, hotspot;
21057        if ((image_map = Fplist_get (XCDR (object), QCmap),        if ((image_map = Fsafe_plist_get (XCDR (object), QCmap),
21058             !NILP (image_map))             !NILP (image_map))
21059            && (hotspot = find_hot_spot (image_map, dx, dy),            && (hotspot = find_hot_spot (image_map, dx, dy),
21060                CONSP (hotspot))                CONSP (hotspot))
# Line 21022  note_mode_line_or_margin_highlight (w, x Line 21066  note_mode_line_or_margin_highlight (w, x
21066            /* 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.
21067               If so, we could look for mouse-enter, mouse-leave               If so, we could look for mouse-enter, mouse-leave
21068               properties in PLIST (and do something...).  */               properties in PLIST (and do something...).  */
21069            if ((plist = XCDR (hotspot), CONSP (plist)))            hotspot = XCDR (hotspot);
21070              if (CONSP (hotspot)
21071                  && (plist = XCAR (hotspot), CONSP (plist)))
21072              {              {
21073                pointer = Fplist_get (plist, Qpointer);                pointer = Fsafe_plist_get (plist, Qpointer);
21074                if (NILP (pointer))                if (NILP (pointer))
21075                  pointer = Qhand;                  pointer = Qhand;
21076                help = Fplist_get (plist, Qhelp_echo);                help = Fsafe_plist_get (plist, Qhelp_echo);
21077                if (!NILP (help))                if (!NILP (help))
21078                  {                  {
21079                    help_echo_string = help;                    help_echo_string = help;
# Line 21038  note_mode_line_or_margin_highlight (w, x Line 21084  note_mode_line_or_margin_highlight (w, x
21084                  }                  }
21085              }              }
21086            if (NILP (pointer))            if (NILP (pointer))
21087              pointer = Fplist_get (XCDR (object), QCpointer);              pointer = Fsafe_plist_get (XCDR (object), QCpointer);
21088          }          }
21089      }      }
21090    
# Line 21189  note_mouse_highlight (f, x, y) Line 21235  note_mouse_highlight (f, x, y)
21235            if (img != NULL && IMAGEP (img->spec))            if (img != NULL && IMAGEP (img->spec))
21236              {              {
21237                Lisp_Object image_map, hotspot;                Lisp_Object image_map, hotspot;
21238                if ((image_map = Fplist_get (XCDR (img->spec), QCmap),                if ((image_map = Fsafe_plist_get (XCDR (img->spec), QCmap),
21239                     !NILP (image_map))                     !NILP (image_map))
21240                    && (hotspot = find_hot_spot (image_map,                    && (hotspot = find_hot_spot (image_map,
21241                                                 glyph->slice.x + dx,                                                 glyph->slice.x + dx,
# Line 21203  note_mouse_highlight (f, x, y) Line 21249  note_mouse_highlight (f, x, y)
21249                    /* 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.
21250                       If so, we could look for mouse-enter, mouse-leave                       If so, we could look for mouse-enter, mouse-leave
21251                       properties in PLIST (and do something...).  */                       properties in PLIST (and do something...).  */
21252                    if ((plist = XCDR (hotspot), CONSP (plist)))                    hotspot = XCDR (hotspot);
21253                      if (CONSP (hotspot)
21254                          && (plist = XCAR (hotspot), CONSP (plist)))
21255                      {                      {
21256                        pointer = Fplist_get (plist, Qpointer);                        pointer = Fsafe_plist_get (plist, Qpointer);
21257                        if (NILP (pointer))                        if (NILP (pointer))
21258                          pointer = Qhand;                          pointer = Qhand;
21259                        help_echo_string = Fplist_get (plist, Qhelp_echo);                        help_echo_string = Fsafe_plist_get (plist, Qhelp_echo);
21260                        if (!NILP (help_echo_string))                        if (!NILP (help_echo_string))
21261                          {                          {
21262                            help_echo_window = window;                            help_echo_window = window;
# Line 21218  note_mouse_highlight (f, x, y) Line 21266  note_mouse_highlight (f, x, y)
21266                      }                      }
21267                  }                  }
21268                if (NILP (pointer))                if (NILP (pointer))
21269                  pointer = Fplist_get (XCDR (img->spec), QCpointer);                  pointer = Fsafe_plist_get (XCDR (img->spec), QCpointer);
21270              }              }
21271          }          }
21272    
# Line 22515  otherwise.  */); Line 22563  otherwise.  */);
22563      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.  */);
22564    auto_raise_tool_bar_buttons_p = 1;    auto_raise_tool_bar_buttons_p = 1;
22565    
22566      DEFVAR_BOOL ("make-cursor-line-fully-visible", &make_cursor_line_fully_visible_p,
22567        doc: /* *Non-nil means to scroll (recenter) cursor line if it is not fully visible.  */);
22568      make_cursor_line_fully_visible_p = 1;
22569    
22570    DEFVAR_LISP ("tool-bar-button-margin", &Vtool_bar_button_margin,    DEFVAR_LISP ("tool-bar-button-margin", &Vtool_bar_button_margin,
22571      doc: /* *Margin around tool-bar buttons in pixels.      doc: /* *Margin around tool-bar buttons in pixels.
22572  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.843.2.32  
changed lines
  Added in v.1.843.2.33

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