Changeset 1492

Show
Ignore:
Timestamp:
1998年02月17日 01時45分04秒 (11 years ago)
Author:
himi
Message:

Import Original Emacs 21.0.104.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/GNU/src/dispextern.h

    r1472 r1492  
    698698  /* 1 means some glyphs in this row are displayed in mouse-face.  */ 
    699699  unsigned mouse_face_p : 1; 
    700  
    701   /* 1 means this row was ended by a newline from a string.  */ 
    702   unsigned ends_in_newline_from_string_p : 1; 
    703700 
    704701  /* Continuation lines width at the start of the row.  */ 
     
    12051202  XFontStruct *font; 
    12061203 
    1207   /* Background stipple or bitmap used for this face.  This is 
    1208      an id as returned from load_pixmap.  */ 
    1209   int stipple; 
     1204  /* Background stipple or bitmap used for this face.  */ 
     1205  Pixmap stipple; 
    12101206 
    12111207#else /* not HAVE_WINDOW_SYSTEM */ 
     
    13791375  /* The allocated size, and number of used slots of faces_by_id.  */ 
    13801376  int size, used; 
    1381  
    1382   /* Flag indicating that attributes of the `menu' face have been 
    1383      changed.  */ 
    1384   unsigned menu_face_changed_p : 1; 
    13851377}; 
    13861378 
     
    15991591     dpvec is set to ctl_chars when a control character is translated. 
    16001592     This vector is also used for incomplete multibyte character 
    1601      translation (e.g \222\244).  Such a character is at most 4 bytes, 
    1602      thus we need at most 16 bytes here.  */ 
    1603   Lisp_Object ctl_chars[16]; 
     1593     translation (e.g \222\244).  Such a character is at most 3 bytes, 
     1594     thus we need at most 12 bytes here.  */ 
     1595  Lisp_Object ctl_chars[12]; 
    16041596 
    16051597  /* Current buffer or string position of the iterator, including 
     
    21612153/* Defined in xdisp.c */ 
    21622154 
    2163 struct glyph_row *row_containing_pos P_ ((struct window *, int, 
    2164                                           struct glyph_row *, 
    2165                                           struct glyph_row *)); 
    21662155int string_buffer_position P_ ((struct window *, Lisp_Object, int)); 
    21672156int line_bottom_y P_ ((struct it *)); 
    21682157int display_prop_intangible_p P_ ((Lisp_Object)); 
    2169 void resize_echo_area_exactly P_ ((void)); 
     2158void resize_echo_area_axactly P_ ((void)); 
    21702159int resize_mini_window P_ ((struct window *, int)); 
    21712160int try_window P_ ((Lisp_Object, struct text_pos)); 
     
    22912280 
    22922281extern int inverse_video; 
    2293 extern int required_matrix_width P_ ((struct window *)); 
    2294 extern int required_matrix_height P_ ((struct window *)); 
    2295 extern int estimate_mode_line_height P_ ((struct frame *, enum face_id)); 
    2296 extern Lisp_Object mode_line_string P_ ((struct window *, int, int, int, int *)); 
     2282int estimate_mode_line_height P_ ((struct frame *, enum face_id)); 
     2283Lisp_Object mode_line_string P_ ((struct window *, int, int, int, int *)); 
    22972284extern void redraw_frame P_ ((struct frame *)); 
    22982285extern void redraw_garbaged_frames P_ ((void)); 
  • branches/GNU/src/dispnew.c

    r1472 r1492  
    132132static void update_frame_line P_ ((struct frame *, int)); 
    133133static struct dim allocate_matrices_for_frame_redisplay 
    134      P_ ((Lisp_Object, int, int, int, int *)); 
    135 static void allocate_matrices_for_window_redisplay P_ ((struct window *)); 
     134     P_ ((Lisp_Object, int, int, struct dim, int, int *)); 
     135static void allocate_matrices_for_window_redisplay P_ ((struct window *, 
     136                                                        struct dim)); 
    136137static int realloc_glyph_pool P_ ((struct glyph_pool *, struct dim)); 
    137138static void adjust_frame_glyphs P_ ((struct frame *)); 
     
    797798              && matrix->window_width == window_width) 
    798799            { 
    799               /* Find the last row in the window.  */ 
    800               for (i = 0; i < matrix->nrows && matrix->rows[i].enabled_p; ++i) 
    801                 if (MATRIX_ROW_BOTTOM_Y (matrix->rows + i) >= window_height) 
    802                   { 
    803                     ++i; 
    804                     break; 
    805                   } 
     800              i = 0; 
     801              while (matrix->rows[i].enabled_p 
     802                     && (MATRIX_ROW_BOTTOM_Y (matrix->rows + i) 
     803                         < matrix->window_height)) 
     804                ++i; 
    806805 
    807806              /* Window end is invalid, if inside of the rows that 
    808                  are invalidated below.  */ 
     807                 are invalidated.  */ 
    809808              if (INTEGERP (w->window_end_vpos) 
    810809                  && XFASTINT (w->window_end_vpos) >= i) 
     
    994993       
    995994      row->y += dy; 
    996       row->visible_height = row->height; 
    997995       
    998996      if (row->y < min_y) 
    999         row->visible_height -= min_y - row->y; 
    1000       if (row->y + row->height > max_y) 
    1001         row->visible_height -= row->y + row->height - max_y; 
     997        row->visible_height = row->height - (min_y - row->y); 
     998      else if (row->y + row->height > max_y) 
     999        row->visible_height = row->height - (row->y + row->height - max_y); 
     1000      else 
     1001        row->visible_height = row->height; 
    10021002    } 
    10031003} 
     
    11531153  row->ascent = row->phys_ascent = 0; 
    11541154  row->height = row->phys_height = CANON_Y_UNIT (XFRAME (w->frame)); 
    1155   row->visible_height = row->height; 
    1156        
     1155   
    11571156  if (row->y < min_y) 
    1158     row->visible_height -= min_y - row->y; 
    1159   if (row->y + row->height > max_y) 
    1160     row->visible_height -= row->y + row->height - max_y; 
     1157    row->visible_height = row->height - (min_y - row->y); 
     1158  else if (row->y + row->height > max_y) 
     1159    row->visible_height = row->height - (row->y + row->height - max_y); 
     1160  else 
     1161    row->visible_height = row->height; 
    11611162 
    11621163  row->enabled_p = 1; 
     
    18571858 
    18581859static struct dim 
    1859 allocate_matrices_for_frame_redisplay (window, x, y, dim_only_p
    1860                                        window_change_flags) 
     1860allocate_matrices_for_frame_redisplay (window, x, y, ch_dim
     1861                                       dim_only_p, window_change_flags) 
    18611862     Lisp_Object window; 
    18621863     int x, y; 
     1864     struct dim ch_dim; 
    18631865     int dim_only_p; 
    18641866     int *window_change_flags; 
     
    18901892         on whether this a combination or a leaf window.  */ 
    18911893      if (!NILP (w->hchild)) 
    1892         dim = allocate_matrices_for_frame_redisplay (w->hchild, x, y,  
     1894        dim = allocate_matrices_for_frame_redisplay (w->hchild, x, y, ch_dim, 
    18931895                                                     dim_only_p, 
    18941896                                                     window_change_flags); 
    18951897      else if (!NILP (w->vchild)) 
    1896         dim = allocate_matrices_for_frame_redisplay (w->vchild, x, y,  
     1898        dim = allocate_matrices_for_frame_redisplay (w->vchild, x, y, ch_dim, 
    18971899                                                     dim_only_p, 
    18981900                                                     window_change_flags); 
     
    19091911          /* Width and height MUST be chosen so that there are no 
    19101912             holes in the frame matrix.  */ 
    1911           dim.width = required_matrix_width (w); 
    1912           dim.height = required_matrix_height (w); 
     1913          dim.width = XINT (w->width); 
     1914          dim.height = XINT (w->height); 
    19131915 
    19141916          /* Will matrix be re-allocated?  */ 
     
    19751977 
    19761978 
    1977 /* Return the required height of glyph matrices for window W.  */ 
    1978  
    1979 int 
    1980 required_matrix_height (w) 
    1981      struct window *w; 
    1982 { 
    1983 #ifdef HAVE_WINDOW_SYSTEM 
    1984   struct frame *f = XFRAME (w->frame); 
    1985    
    1986   if (FRAME_WINDOW_P (f)) 
    1987     { 
    1988       int ch_height = FRAME_SMALLEST_FONT_HEIGHT (f); 
    1989       int window_pixel_height = window_box_height (w) + abs (w->vscroll); 
    1990       return (((window_pixel_height + ch_height - 1) 
    1991                / ch_height) 
    1992               /* One partially visible line at the top and 
    1993                  bottom of the window.  */ 
    1994               + 2 
    1995               /* 2 for top and mode line.  */ 
    1996               + 2); 
    1997     } 
    1998 #endif /* HAVE_WINDOW_SYSTEM */ 
    1999        
    2000   return XINT (w->height); 
    2001 } 
    2002  
    2003  
    2004 /* Return the required width of glyph matrices for window W.  */ 
    2005  
    2006 int 
    2007 required_matrix_width (w) 
    2008      struct window *w; 
    2009 { 
    2010 #ifdef HAVE_WINDOW_SYSTEM 
    2011   struct frame *f = XFRAME (w->frame); 
    2012   if (FRAME_WINDOW_P (f)) 
    2013     { 
    2014       int ch_width = FRAME_SMALLEST_CHAR_WIDTH (f); 
    2015       int window_pixel_width = XFLOATINT (w->width) * CANON_X_UNIT (f); 
    2016    
    2017       /* Compute number of glyphs needed in a glyph row.  */ 
    2018       return (((window_pixel_width + ch_width - 1) 
    2019                / ch_width) 
    2020               /* 2 partially visible columns in the text area.  */ 
    2021               + 2 
    2022               /* One partially visible column at the right 
    2023                  edge of each marginal area.  */ 
    2024               + 1 + 1); 
    2025     } 
    2026 #endif /* HAVE_WINDOW_SYSTEM */ 
    2027  
    2028   return XINT (w->width); 
    2029 } 
    2030  
    2031  
    20321979/* Allocate window matrices for window-based redisplay.  W is the 
    20331980   window whose matrices must be allocated/reallocated.  CH_DIM is the 
     
    20351982    
    20361983static void 
    2037 allocate_matrices_for_window_redisplay (w
     1984allocate_matrices_for_window_redisplay (w, ch_dim
    20381985     struct window *w; 
    2039 
     1986     struct dim ch_dim; 
     1987
     1988  struct frame *f = XFRAME (w->frame); 
     1989   
    20401990  while (w) 
    20411991    { 
    20421992      if (!NILP (w->vchild)) 
    2043         allocate_matrices_for_window_redisplay (XWINDOW (w->vchild)); 
     1993        allocate_matrices_for_window_redisplay (XWINDOW (w->vchild), ch_dim); 
    20441994      else if (!NILP (w->hchild)) 
    2045         allocate_matrices_for_window_redisplay (XWINDOW (w->hchild)); 
     1995        allocate_matrices_for_window_redisplay (XWINDOW (w->hchild), ch_dim); 
    20461996      else 
    20471997        { 
    20481998          /* W is a leaf window.  */ 
     1999          int window_pixel_width = XFLOATINT (w->width) * CANON_X_UNIT (f); 
     2000          int window_pixel_height = window_box_height (w) + abs (w->vscroll); 
    20492001          struct dim dim; 
    20502002 
     
    20562008            } 
    20572009 
    2058           dim.width = required_matrix_width (w); 
    2059           dim.height = required_matrix_height (w); 
     2010          /* Compute number of glyphs needed in a glyph row.  */ 
     2011          dim.width = (((window_pixel_width + ch_dim.width - 1) 
     2012                        / ch_dim.width) 
     2013                       /* 2 partially visible columns in the text area.  */ 
     2014                       + 2 
     2015                       /* One partially visible column at the right 
     2016                          edge of each marginal area.  */ 
     2017                       + 1 + 1); 
     2018 
     2019          /* Compute number of glyph rows needed.  */ 
     2020          dim.height = (((window_pixel_height + ch_dim.height - 1) 
     2021                         / ch_dim.height) 
     2022                        /* One partially visible line at the top and 
     2023                           bottom of the window.  */ 
     2024                        + 2 
     2025                        /* 2 for top and mode line.  */ 
     2026                        + 2); 
     2027 
     2028          /* Change matrices.  */ 
    20602029          adjust_glyph_matrix (w, w->desired_matrix, 0, 0, dim); 
    20612030          adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim); 
     
    23052274    = allocate_matrices_for_frame_redisplay (FRAME_ROOT_WINDOW (f), 
    23062275                                             0, top_window_y, 
    2307                                              1, 
     2276                                             ch_dim, 1, 
    23082277                                             &window_change_flags); 
    23092278 
     
    23212290      /* Do it for window matrices.  */ 
    23222291      allocate_matrices_for_frame_redisplay (FRAME_ROOT_WINDOW (f), 
    2323                                              0, top_window_y, 0, 
     2292                                             0, top_window_y, ch_dim, 0, 
    23242293                                             &window_change_flags); 
    23252294 
     
    23812350     
    23822351  /* Allocate/reallocate window matrices.  */ 
    2383   allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f))); 
     2352  allocate_matrices_for_window_redisplay (XWINDOW (FRAME_ROOT_WINDOW (f)), 
     2353                                          ch_dim); 
    23842354 
    23852355  /* Allocate/ reallocate matrices of the dummy window used to display 
     
    24042374    XSETFASTINT (w->height, FRAME_MENU_BAR_LINES (f)); 
    24052375    XSETFASTINT (w->width, FRAME_WINDOW_WIDTH (f)); 
    2406     allocate_matrices_for_window_redisplay (w); 
     2376    allocate_matrices_for_window_redisplay (w, ch_dim); 
    24072377  } 
    24082378#endif /* not USE_X_TOOLKIT */ 
     
    24242394  XSETFASTINT (w->height, FRAME_TOOL_BAR_LINES (f)); 
    24252395  XSETFASTINT (w->width, FRAME_WINDOW_WIDTH (f)); 
    2426   allocate_matrices_for_window_redisplay (w); 
     2396  allocate_matrices_for_window_redisplay (w, ch_dim); 
    24272397} 
    24282398 
     
    35133483  it.end_charpos = PT; 
    35143484  it.stop_charpos = min (PT, it.stop_charpos); 
    3515   it.stop_charpos = max (IT_CHARPOS (it), it.stop_charpos); 
    35163485 
    35173486  /* More than one display element may be returned for PT - 1 if 
     
    36183587     and updated_row.  */ 
    36193588  updated_row = glyph_row; 
    3620   updated_area = TEXT_AREA; 
    36213589  update_begin (f); 
    36223590  if (rif) 
     
    40864054      struct glyph_row *row, *end; 
    40874055      struct glyph_row *mode_line_row; 
    4088       struct glyph_row *header_line_row
     4056      struct glyph_row *header_line_row = NULL
    40894057      int yb, changed_p = 0, mouse_face_overwritten_p = 0, n_updated; 
    40904058 
     
    40964064      row = desired_matrix->rows; 
    40974065      end = row + desired_matrix->nrows - 1; 
    4098        
    40994066      if (row->mode_line_p) 
    4100         { 
    4101           header_line_row = row; 
    4102           ++row; 
    4103         } 
    4104       else 
    4105         header_line_row = NULL; 
     4067        header_line_row = row++; 
    41064068 
    41074069      /* Update the mode line, if necessary.  */ 
     
    41244086      /* Try reusing part of the display by copying.  */ 
    41254087      if (row < end && !desired_matrix->no_scrolling_p) 
    4126         { 
    4127           int rc = scrolling_window (w, header_line_row != NULL); 
    4128           if (rc < 0) 
    4129             { 
    4130               /* All rows were found to be equal.  */ 
    4131               paused_p = 0; 
    4132               goto set_cursor; 
    4133             } 
    4134           else if (rc > 0) 
    4135             /* We've scrolled the display.  */ 
    4136             force_p = 1; 
    4137           changed_p = 1; 
    4138         } 
     4088        if (scrolling_window (w, header_line_row != NULL) > 0) 
     4089          force_p = changed_p = 1; 
    41394090 
    41404091      /* Update the top mode line after scrolling because a new top 
     
    41824133      paused_p = row < end; 
    41834134       
    4184     set_cursor: 
    4185        
    41864135      /* Fix the appearance of overlapping(overlapped rows.  */ 
    41874136      if (!paused_p && !w->pseudo_window_p) 
     
    42074156#endif 
    42084157 
    4209       /* End the update of window W.  Don't set the cursor if we 
    4210          paused updating the display because in this case, 
    4211          set_window_cursor_after_update hasn't been called, and 
    4212          output_cursor doesn't contain the cursor location.  */ 
    4213       rif->update_window_end_hook (w, !paused_p, mouse_face_overwritten_p); 
     4158      /* End of update of window W.  */ 
     4159      rif->update_window_end_hook (w, 1, mouse_face_overwritten_p); 
    42144160    } 
    42154161  else 
     
    45714517 
    45724518          last_row = NULL; 
    4573           row = w->current_matrix->rows; 
    4574           while (row->enabled_p 
    4575                  && (last_row == NULL 
    4576                      || MATRIX_ROW_BOTTOM_Y (row) <= yb)) 
     4519          for (row = MATRIX_ROW (w->current_matrix, 0); 
     4520               row->enabled_p; 
     4521               ++row) 
    45774522            { 
    45784523              if (row->used[TEXT_AREA] 
    45794524                  && row->glyphs[TEXT_AREA][0].charpos >= 0) 
    45804525                last_row = row; 
    4581               ++row; 
     4526 
     4527              if (MATRIX_ROW_BOTTOM_Y (row) >= yb) 
     4528                break; 
    45824529            } 
    45834530           
    45844531          if (last_row) 
    45854532            { 
    4586               struct glyph *start = last_row->glyphs[TEXT_AREA]; 
    4587               struct glyph *last = start + last_row->used[TEXT_AREA] - 1; 
     4533              struct glyph *start = row->glyphs[TEXT_AREA]; 
     4534              struct glyph *last = start + row->used[TEXT_AREA] - 1; 
    45884535 
    45894536              while (last > start && last->charpos < 0) 
  • branches/GNU/src/frame.c

    r1472 r1492  
    13191319to read the mouse position, it returns the selected frame for FRAME\n\ 
    13201320and nil for X and Y.\n\ 
    1321 If `mouse-position-function' is non-nil, `mouse-position' calls it,\n\ 
    1322 passing the normal return value to that function as an argument,\n\ 
    1323 and returns whatever that function returns.") 
     1321Runs the abnormal hook `mouse-position-function' with the normal return\n\ 
     1322value as argument.") 
    13241323  () 
    13251324{ 
     
    24912490 
    24922491  DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function, 
    2493     "If non-nil, function to transform normal value of `mouse-position'.\n\ 
    2494 `mouse-position' calls this function, passing its usual return value as\n\ 
    2495 argument, and returns whatever this function returns.\n\ 
    2496 This abnormal hook exists for the benefit of packages like `xt-mouse.el'\n\ 
     2492    "If non-nil, function applied to the normal result of `mouse-position'.\n\ 
     2493This abnormal hook exists for the benefit of packages like XTerm-mouse\n\ 
    24972494which need to do mouse handling at the Lisp level."); 
    24982495  Vmouse_position_function = Qnil; 
     
    25092506this variable doesn't necessarily say anything meaningful about the\n\ 
    25102507current set of frames, or where the minibuffer is currently being\n\ 
    2511 displayed.\n\ 
    2512 \n\ 
    2513 This variable is local to the current terminal and cannot be buffer-local."); 
     2508displayed."); 
    25142509 
    25152510  staticpro (&Vframe_list); 
  • branches/GNU/src/keymap.c

    r1472 r1492  
    503503    Lisp_Object tail; 
    504504    Lisp_Object t_binding; 
    505     Lisp_Object generic_binding; 
    506505 
    507506    t_binding = Qnil; 
    508     generic_binding = Qnil; 
    509      
    510507    for (tail = XCDR (map); 
    511508         (CONSP (tail) 
     
    525522        else if (CONSP (binding)) 
    526523          { 
    527             Lisp_Object key = XCAR (binding); 
    528             int c1, c2, charset; 
    529              
    530             if (EQ (key, idx)) 
     524            if (EQ (XCAR (binding), idx)) 
    531525              { 
    532526                val = XCDR (binding); 
     
    537531                return get_keyelt (val, autoload); 
    538532              } 
    539             else if (INTEGERP (idx) 
    540                      && (XINT (idx) & CHAR_MODIFIER_MASK) == 0 
    541                      && INTEGERP (key) 
    542                      && (XINT (key) & CHAR_MODIFIER_MASK) == 0 
    543                      && !SINGLE_BYTE_CHAR_P (XINT (idx)) 
    544                      && !SINGLE_BYTE_CHAR_P (XINT (key)) 
    545                      && CHAR_VALID_P (XINT (key), 1) 
    546                      && !CHAR_VALID_P (XINT (key), 0) 
    547                      && (CHAR_CHARSET (XINT (key)) 
    548                          == CHAR_CHARSET (XINT (idx)))) 
    549               { 
    550                 /* KEY is the generic character of the charset of IDX. 
    551                    Use KEY's binding if there isn't a binding for IDX 
    552                    itself.  */ 
    553                 generic_binding = XCDR (binding); 
    554               } 
    555             else if (t_ok && EQ (XCAR (binding), Qt)) 
     533            if (t_ok && EQ (XCAR (binding), Qt)) 
    556534              t_binding = XCDR (binding); 
    557535          } 
     
    574552               All character codes without modifiers are included.  */ 
    575553            if (NATNUMP (idx) 
    576                 && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0) 
     554                && ! (XFASTINT (idx) 
     555                      & (CHAR_ALT | CHAR_SUPER | CHAR_HYPER 
     556                         | CHAR_SHIFT | CHAR_CTL | CHAR_META))) 
    577557              { 
    578558                val = Faref (binding, idx); 
     
    587567        QUIT; 
    588568      } 
    589  
    590     if (!NILP (generic_binding)) 
    591       return get_keyelt (generic_binding, autoload); 
    592569 
    593570    return get_keyelt (t_binding, autoload);