Changeset 1492
- Timestamp:
- 1998年02月17日 01時45分04秒 (11 years ago)
- Files:
-
- branches/GNU/src/dispextern.h (modified) (6 diffs)
- branches/GNU/src/dispnew.c (modified) (23 diffs)
- branches/GNU/src/doprnt.c (added)
- branches/GNU/src/dosfns.h (added)
- branches/GNU/src/frame.c (modified) (3 diffs)
- branches/GNU/src/keymap.c (modified) (5 diffs)
- branches/GNU/src/lread.c (added)
- branches/GNU/src/makefile.nt (added)
- branches/GNU/src/msdos.c (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/GNU/src/dispextern.h
r1472 r1492 698 698 /* 1 means some glyphs in this row are displayed in mouse-face. */ 699 699 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;703 700 704 701 /* Continuation lines width at the start of the row. */ … … 1205 1202 XFontStruct *font; 1206 1203 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; 1210 1206 1211 1207 #else /* not HAVE_WINDOW_SYSTEM */ … … 1379 1375 /* The allocated size, and number of used slots of faces_by_id. */ 1380 1376 int size, used; 1381 1382 /* Flag indicating that attributes of the `menu' face have been1383 changed. */1384 unsigned menu_face_changed_p : 1;1385 1377 }; 1386 1378 … … 1599 1591 dpvec is set to ctl_chars when a control character is translated. 1600 1592 This vector is also used for incomplete multibyte character 1601 translation (e.g \222\244). Such a character is at most 4bytes,1602 thus we need at most 1 6bytes here. */1603 Lisp_Object ctl_chars[1 6];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]; 1604 1596 1605 1597 /* Current buffer or string position of the iterator, including … … 2161 2153 /* Defined in xdisp.c */ 2162 2154 2163 struct glyph_row *row_containing_pos P_ ((struct window *, int,2164 struct glyph_row *,2165 struct glyph_row *));2166 2155 int string_buffer_position P_ ((struct window *, Lisp_Object, int)); 2167 2156 int line_bottom_y P_ ((struct it *)); 2168 2157 int display_prop_intangible_p P_ ((Lisp_Object)); 2169 void resize_echo_area_ exactly P_ ((void));2158 void resize_echo_area_axactly P_ ((void)); 2170 2159 int resize_mini_window P_ ((struct window *, int)); 2171 2160 int try_window P_ ((Lisp_Object, struct text_pos)); … … 2291 2280 2292 2281 extern 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 *)); 2282 int estimate_mode_line_height P_ ((struct frame *, enum face_id)); 2283 Lisp_Object mode_line_string P_ ((struct window *, int, int, int, int *)); 2297 2284 extern void redraw_frame P_ ((struct frame *)); 2298 2285 extern void redraw_garbaged_frames P_ ((void)); branches/GNU/src/dispnew.c
r1472 r1492 132 132 static void update_frame_line P_ ((struct frame *, int)); 133 133 static 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 *)); 135 static void allocate_matrices_for_window_redisplay P_ ((struct window *, 136 struct dim)); 136 137 static int realloc_glyph_pool P_ ((struct glyph_pool *, struct dim)); 137 138 static void adjust_frame_glyphs P_ ((struct frame *)); … … 797 798 && matrix->window_width == window_width) 798 799 { 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; 806 805 807 806 /* Window end is invalid, if inside of the rows that 808 are invalidated below. */807 are invalidated. */ 809 808 if (INTEGERP (w->window_end_vpos) 810 809 && XFASTINT (w->window_end_vpos) >= i) … … 994 993 995 994 row->y += dy; 996 row->visible_height = row->height;997 995 998 996 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; 1002 1002 } 1003 1003 } … … 1153 1153 row->ascent = row->phys_ascent = 0; 1154 1154 row->height = row->phys_height = CANON_Y_UNIT (XFRAME (w->frame)); 1155 row->visible_height = row->height; 1156 1155 1157 1156 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; 1161 1162 1162 1163 row->enabled_p = 1; … … 1857 1858 1858 1859 static struct dim 1859 allocate_matrices_for_frame_redisplay (window, x, y, dim_only_p,1860 window_change_flags)1860 allocate_matrices_for_frame_redisplay (window, x, y, ch_dim, 1861 dim_only_p, window_change_flags) 1861 1862 Lisp_Object window; 1862 1863 int x, y; 1864 struct dim ch_dim; 1863 1865 int dim_only_p; 1864 1866 int *window_change_flags; … … 1890 1892 on whether this a combination or a leaf window. */ 1891 1893 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, 1893 1895 dim_only_p, 1894 1896 window_change_flags); 1895 1897 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, 1897 1899 dim_only_p, 1898 1900 window_change_flags); … … 1909 1911 /* Width and height MUST be chosen so that there are no 1910 1912 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); 1913 1915 1914 1916 /* Will matrix be re-allocated? */ … … 1975 1977 1976 1978 1977 /* Return the required height of glyph matrices for window W. */1978 1979 int1980 required_matrix_height (w)1981 struct window *w;1982 {1983 #ifdef HAVE_WINDOW_SYSTEM1984 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 and1993 bottom of the window. */1994 + 21995 /* 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 int2007 required_matrix_width (w)2008 struct window *w;2009 {2010 #ifdef HAVE_WINDOW_SYSTEM2011 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 + 22022 /* One partially visible column at the right2023 edge of each marginal area. */2024 + 1 + 1);2025 }2026 #endif /* HAVE_WINDOW_SYSTEM */2027 2028 return XINT (w->width);2029 }2030 2031 2032 1979 /* Allocate window matrices for window-based redisplay. W is the 2033 1980 window whose matrices must be allocated/reallocated. CH_DIM is the … … 2035 1982 2036 1983 static void 2037 allocate_matrices_for_window_redisplay (w )1984 allocate_matrices_for_window_redisplay (w, ch_dim) 2038 1985 struct window *w; 2039 { 1986 struct dim ch_dim; 1987 { 1988 struct frame *f = XFRAME (w->frame); 1989 2040 1990 while (w) 2041 1991 { 2042 1992 if (!NILP (w->vchild)) 2043 allocate_matrices_for_window_redisplay (XWINDOW (w->vchild) );1993 allocate_matrices_for_window_redisplay (XWINDOW (w->vchild), ch_dim); 2044 1994 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); 2046 1996 else 2047 1997 { 2048 1998 /* 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); 2049 2001 struct dim dim; 2050 2002 … … 2056 2008 } 2057 2009 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. */ 2060 2029 adjust_glyph_matrix (w, w->desired_matrix, 0, 0, dim); 2061 2030 adjust_glyph_matrix (w, w->current_matrix, 0, 0, dim); … … 2305 2274 = allocate_matrices_for_frame_redisplay (FRAME_ROOT_WINDOW (f), 2306 2275 0, top_window_y, 2307 1,2276 ch_dim, 1, 2308 2277 &window_change_flags); 2309 2278 … … 2321 2290 /* Do it for window matrices. */ 2322 2291 allocate_matrices_for_frame_redisplay (FRAME_ROOT_WINDOW (f), 2323 0, top_window_y, 0,2292 0, top_window_y, ch_dim, 0, 2324 2293 &window_change_flags); 2325 2294 … … 2381 2350 2382 2351 /* 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); 2384 2354 2385 2355 /* Allocate/ reallocate matrices of the dummy window used to display … … 2404 2374 XSETFASTINT (w->height, FRAME_MENU_BAR_LINES (f)); 2405 2375 XSETFASTINT (w->width, FRAME_WINDOW_WIDTH (f)); 2406 allocate_matrices_for_window_redisplay (w );2376 allocate_matrices_for_window_redisplay (w, ch_dim); 2407 2377 } 2408 2378 #endif /* not USE_X_TOOLKIT */ … … 2424 2394 XSETFASTINT (w->height, FRAME_TOOL_BAR_LINES (f)); 2425 2395 XSETFASTINT (w->width, FRAME_WINDOW_WIDTH (f)); 2426 allocate_matrices_for_window_redisplay (w );2396 allocate_matrices_for_window_redisplay (w, ch_dim); 2427 2397 } 2428 2398 … … 3513 3483 it.end_charpos = PT; 3514 3484 it.stop_charpos = min (PT, it.stop_charpos); 3515 it.stop_charpos = max (IT_CHARPOS (it), it.stop_charpos);3516 3485 3517 3486 /* More than one display element may be returned for PT - 1 if … … 3618 3587 and updated_row. */ 3619 3588 updated_row = glyph_row; 3620 updated_area = TEXT_AREA;3621 3589 update_begin (f); 3622 3590 if (rif) … … 4086 4054 struct glyph_row *row, *end; 4087 4055 struct glyph_row *mode_line_row; 4088 struct glyph_row *header_line_row ;4056 struct glyph_row *header_line_row = NULL; 4089 4057 int yb, changed_p = 0, mouse_face_overwritten_p = 0, n_updated; 4090 4058 … … 4096 4064 row = desired_matrix->rows; 4097 4065 end = row + desired_matrix->nrows - 1; 4098 4099 4066 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++; 4106 4068 4107 4069 /* Update the mode line, if necessary. */ … … 4124 4086 /* Try reusing part of the display by copying. */ 4125 4087 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; 4139 4090 4140 4091 /* Update the top mode line after scrolling because a new top … … 4182 4133 paused_p = row < end; 4183 4134 4184 set_cursor:4185 4186 4135 /* Fix the appearance of overlapping(overlapped rows. */ 4187 4136 if (!paused_p && !w->pseudo_window_p) … … 4207 4156 #endif 4208 4157 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); 4214 4160 } 4215 4161 else … … 4571 4517 4572 4518 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) 4577 4522 { 4578 4523 if (row->used[TEXT_AREA] 4579 4524 && row->glyphs[TEXT_AREA][0].charpos >= 0) 4580 4525 last_row = row; 4581 ++row; 4526 4527 if (MATRIX_ROW_BOTTOM_Y (row) >= yb) 4528 break; 4582 4529 } 4583 4530 4584 4531 if (last_row) 4585 4532 { 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; 4588 4535 4589 4536 while (last > start && last->charpos < 0) branches/GNU/src/frame.c
r1472 r1492 1319 1319 to read the mouse position, it returns the selected frame for FRAME\n\ 1320 1320 and 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.") 1321 Runs the abnormal hook `mouse-position-function' with the normal return\n\ 1322 value as argument.") 1324 1323 () 1325 1324 { … … 2491 2490 2492 2491 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\ 2493 This abnormal hook exists for the benefit of packages like XTerm-mouse\n\ 2497 2494 which need to do mouse handling at the Lisp level."); 2498 2495 Vmouse_position_function = Qnil; … … 2509 2506 this variable doesn't necessarily say anything meaningful about the\n\ 2510 2507 current 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."); 2508 displayed."); 2514 2509 2515 2510 staticpro (&Vframe_list); branches/GNU/src/keymap.c
r1472 r1492 503 503 Lisp_Object tail; 504 504 Lisp_Object t_binding; 505 Lisp_Object generic_binding;506 505 507 506 t_binding = Qnil; 508 generic_binding = Qnil;509 510 507 for (tail = XCDR (map); 511 508 (CONSP (tail) … … 525 522 else if (CONSP (binding)) 526 523 { 527 Lisp_Object key = XCAR (binding); 528 int c1, c2, charset; 529 530 if (EQ (key, idx)) 524 if (EQ (XCAR (binding), idx)) 531 525 { 532 526 val = XCDR (binding); … … 537 531 return get_keyelt (val, autoload); 538 532 } 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)) 556 534 t_binding = XCDR (binding); 557 535 } … … 574 552 All character codes without modifiers are included. */ 575 553 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))) 577 557 { 578 558 val = Faref (binding, idx); … … 587 567 QUIT; 588 568 } 589 590 if (!NILP (generic_binding))591 return get_keyelt (generic_binding, autoload);592 569 593 570 return get_keyelt (t_binding, autoload);
