diff options
Diffstat (limited to 'src/xdisp.c')
| -rw-r--r-- | src/xdisp.c | 141 |
1 files changed, 72 insertions, 69 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index a7955f41e0c..bbbf37b68ac 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -754,7 +754,7 @@ static void setup_for_ellipsis (struct it *, int); | |||
| 754 | static void mark_window_display_accurate_1 (struct window *, int); | 754 | static void mark_window_display_accurate_1 (struct window *, int); |
| 755 | static int single_display_spec_string_p (Lisp_Object, Lisp_Object); | 755 | static int single_display_spec_string_p (Lisp_Object, Lisp_Object); |
| 756 | static int display_prop_string_p (Lisp_Object, Lisp_Object); | 756 | static int display_prop_string_p (Lisp_Object, Lisp_Object); |
| 757 | static int cursor_row_p (struct window *, struct glyph_row *); | 757 | static int cursor_row_p (struct glyph_row *); |
| 758 | static int redisplay_mode_lines (Lisp_Object, int); | 758 | static int redisplay_mode_lines (Lisp_Object, int); |
| 759 | static char *decode_mode_spec_coding (Lisp_Object, char *, int); | 759 | static char *decode_mode_spec_coding (Lisp_Object, char *, int); |
| 760 | 760 | ||
| @@ -802,8 +802,8 @@ static int cursor_row_fully_visible_p (struct window *, int, int); | |||
| 802 | static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int); | 802 | static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int); |
| 803 | static int try_cursor_movement (Lisp_Object, struct text_pos, int *); | 803 | static int try_cursor_movement (Lisp_Object, struct text_pos, int *); |
| 804 | static int trailing_whitespace_p (EMACS_INT); | 804 | static int trailing_whitespace_p (EMACS_INT); |
| 805 | static int message_log_check_duplicate (EMACS_INT, EMACS_INT, | 805 | static unsigned long int message_log_check_duplicate (EMACS_INT, EMACS_INT, |
| 806 | EMACS_INT, EMACS_INT); | 806 | EMACS_INT, EMACS_INT); |
| 807 | static void push_it (struct it *); | 807 | static void push_it (struct it *); |
| 808 | static void pop_it (struct it *); | 808 | static void pop_it (struct it *); |
| 809 | static void sync_frame_with_window_matrix_rows (struct window *); | 809 | static void sync_frame_with_window_matrix_rows (struct window *); |
| @@ -823,8 +823,7 @@ static int display_mode_lines (struct window *); | |||
| 823 | static int display_mode_line (struct window *, enum face_id, Lisp_Object); | 823 | static int display_mode_line (struct window *, enum face_id, Lisp_Object); |
| 824 | static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_Object, int); | 824 | static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_Object, int); |
| 825 | static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object); | 825 | static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object); |
| 826 | static const char *decode_mode_spec (struct window *, int, int, int, | 826 | static const char *decode_mode_spec (struct window *, int, int, Lisp_Object *); |
| 827 | Lisp_Object *); | ||
| 828 | static void display_menu_bar (struct window *); | 827 | static void display_menu_bar (struct window *); |
| 829 | static int display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT, int, | 828 | static int display_count_lines (EMACS_INT, EMACS_INT, EMACS_INT, int, |
| 830 | EMACS_INT *); | 829 | EMACS_INT *); |
| @@ -2181,7 +2180,7 @@ safe_eval_handler (Lisp_Object arg) | |||
| 2181 | redisplay during the evaluation. */ | 2180 | redisplay during the evaluation. */ |
| 2182 | 2181 | ||
| 2183 | Lisp_Object | 2182 | Lisp_Object |
| 2184 | safe_call (int nargs, Lisp_Object *args) | 2183 | safe_call (size_t nargs, Lisp_Object *args) |
| 2185 | { | 2184 | { |
| 2186 | Lisp_Object val; | 2185 | Lisp_Object val; |
| 2187 | 2186 | ||
| @@ -3164,6 +3163,9 @@ handle_fontified_prop (struct it *it) | |||
| 3164 | { | 3163 | { |
| 3165 | int count = SPECPDL_INDEX (); | 3164 | int count = SPECPDL_INDEX (); |
| 3166 | Lisp_Object val; | 3165 | Lisp_Object val; |
| 3166 | struct buffer *obuf = current_buffer; | ||
| 3167 | int begv = BEGV, zv = ZV; | ||
| 3168 | int old_clip_changed = current_buffer->clip_changed; | ||
| 3167 | 3169 | ||
| 3168 | val = Vfontification_functions; | 3170 | val = Vfontification_functions; |
| 3169 | specbind (Qfontification_functions, Qnil); | 3171 | specbind (Qfontification_functions, Qnil); |
| @@ -3209,6 +3211,23 @@ handle_fontified_prop (struct it *it) | |||
| 3209 | 3211 | ||
| 3210 | unbind_to (count, Qnil); | 3212 | unbind_to (count, Qnil); |
| 3211 | 3213 | ||
| 3214 | /* Fontification functions routinely call `save-restriction'. | ||
| 3215 | Normally, this tags clip_changed, which can confuse redisplay | ||
| 3216 | (see discussion in Bug#6671). Since we don't perform any | ||
| 3217 | special handling of fontification changes in the case where | ||
| 3218 | `save-restriction' isn't called, there's no point doing so in | ||
| 3219 | this case either. So, if the buffer's restrictions are | ||
| 3220 | actually left unchanged, reset clip_changed. */ | ||
| 3221 | if (obuf == current_buffer) | ||
| 3222 | { | ||
| 3223 | if (begv == BEGV && zv == ZV) | ||
| 3224 | current_buffer->clip_changed = old_clip_changed; | ||
| 3225 | } | ||
| 3226 | /* There isn't much we can reasonably do to protect against | ||
| 3227 | misbehaving fontification, but here's a fig leaf. */ | ||
| 3228 | else if (!NILP (BVAR (obuf, name))) | ||
| 3229 | set_buffer_internal_1 (obuf); | ||
| 3230 | |||
| 3212 | /* The fontification code may have added/removed text. | 3231 | /* The fontification code may have added/removed text. |
| 3213 | It could do even a lot worse, but let's at least protect against | 3232 | It could do even a lot worse, but let's at least protect against |
| 3214 | the most obvious case where only the text past `pos' gets changed', | 3233 | the most obvious case where only the text past `pos' gets changed', |
| @@ -4400,20 +4419,18 @@ display_prop_string_p (Lisp_Object prop, Lisp_Object string) | |||
| 4400 | return 0; | 4419 | return 0; |
| 4401 | } | 4420 | } |
| 4402 | 4421 | ||
| 4403 | /* Look for STRING in overlays and text properties in W's buffer, | 4422 | /* Look for STRING in overlays and text properties in the current |
| 4404 | between character positions FROM and TO (excluding TO). | 4423 | buffer, between character positions FROM and TO (excluding TO). |
| 4405 | BACK_P non-zero means look back (in this case, TO is supposed to be | 4424 | BACK_P non-zero means look back (in this case, TO is supposed to be |
| 4406 | less than FROM). | 4425 | less than FROM). |
| 4407 | Value is the first character position where STRING was found, or | 4426 | Value is the first character position where STRING was found, or |
| 4408 | zero if it wasn't found before hitting TO. | 4427 | zero if it wasn't found before hitting TO. |
| 4409 | 4428 | ||
| 4410 | W's buffer must be current. | ||
| 4411 | |||
| 4412 | This function may only use code that doesn't eval because it is | 4429 | This function may only use code that doesn't eval because it is |
| 4413 | called asynchronously from note_mouse_highlight. */ | 4430 | called asynchronously from note_mouse_highlight. */ |
| 4414 | 4431 | ||
| 4415 | static EMACS_INT | 4432 | static EMACS_INT |
| 4416 | string_buffer_position_lim (struct window *w, Lisp_Object string, | 4433 | string_buffer_position_lim (Lisp_Object string, |
| 4417 | EMACS_INT from, EMACS_INT to, int back_p) | 4434 | EMACS_INT from, EMACS_INT to, int back_p) |
| 4418 | { | 4435 | { |
| 4419 | Lisp_Object limit, prop, pos; | 4436 | Lisp_Object limit, prop, pos; |
| @@ -4451,27 +4468,25 @@ string_buffer_position_lim (struct window *w, Lisp_Object string, | |||
| 4451 | return found ? XINT (pos) : 0; | 4468 | return found ? XINT (pos) : 0; |
| 4452 | } | 4469 | } |
| 4453 | 4470 | ||
| 4454 | /* Determine which buffer position in W's buffer STRING comes from. | 4471 | /* Determine which buffer position in current buffer STRING comes from. |
| 4455 | AROUND_CHARPOS is an approximate position where it could come from. | 4472 | AROUND_CHARPOS is an approximate position where it could come from. |
| 4456 | Value is the buffer position or 0 if it couldn't be determined. | 4473 | Value is the buffer position or 0 if it couldn't be determined. |
| 4457 | 4474 | ||
| 4458 | W's buffer must be current. | ||
| 4459 | |||
| 4460 | This function is necessary because we don't record buffer positions | 4475 | This function is necessary because we don't record buffer positions |
| 4461 | in glyphs generated from strings (to keep struct glyph small). | 4476 | in glyphs generated from strings (to keep struct glyph small). |
| 4462 | This function may only use code that doesn't eval because it is | 4477 | This function may only use code that doesn't eval because it is |
| 4463 | called asynchronously from note_mouse_highlight. */ | 4478 | called asynchronously from note_mouse_highlight. */ |
| 4464 | 4479 | ||
| 4465 | EMACS_INT | 4480 | static EMACS_INT |
| 4466 | string_buffer_position (struct window *w, Lisp_Object string, EMACS_INT around_charpos) | 4481 | string_buffer_position (Lisp_Object string, EMACS_INT around_charpos) |
| 4467 | { | 4482 | { |
| 4468 | const int MAX_DISTANCE = 1000; | 4483 | const int MAX_DISTANCE = 1000; |
| 4469 | EMACS_INT found = string_buffer_position_lim (w, string, around_charpos, | 4484 | EMACS_INT found = string_buffer_position_lim (string, around_charpos, |
| 4470 | around_charpos + MAX_DISTANCE, | 4485 | around_charpos + MAX_DISTANCE, |
| 4471 | 0); | 4486 | 0); |
| 4472 | 4487 | ||
| 4473 | if (!found) | 4488 | if (!found) |
| 4474 | found = string_buffer_position_lim (w, string, around_charpos, | 4489 | found = string_buffer_position_lim (string, around_charpos, |
| 4475 | around_charpos - MAX_DISTANCE, 1); | 4490 | around_charpos - MAX_DISTANCE, 1); |
| 4476 | return found; | 4491 | return found; |
| 4477 | } | 4492 | } |
| @@ -7947,7 +7962,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) | |||
| 7947 | c = string_char_and_length (msg + i, &char_bytes); | 7962 | c = string_char_and_length (msg + i, &char_bytes); |
| 7948 | work[0] = (ASCII_CHAR_P (c) | 7963 | work[0] = (ASCII_CHAR_P (c) |
| 7949 | ? c | 7964 | ? c |
| 7950 | : multibyte_char_to_unibyte (c, Qnil)); | 7965 | : multibyte_char_to_unibyte (c)); |
| 7951 | insert_1_both (work, 1, 1, 1, 0, 0); | 7966 | insert_1_both (work, 1, 1, 1, 0, 0); |
| 7952 | } | 7967 | } |
| 7953 | } | 7968 | } |
| @@ -7973,7 +7988,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) | |||
| 7973 | if (nlflag) | 7988 | if (nlflag) |
| 7974 | { | 7989 | { |
| 7975 | EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte; | 7990 | EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte; |
| 7976 | int dups; | 7991 | unsigned long int dups; |
| 7977 | insert_1 ("\n", 1, 1, 0, 0); | 7992 | insert_1 ("\n", 1, 1, 0, 0); |
| 7978 | 7993 | ||
| 7979 | scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0); | 7994 | scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0); |
| @@ -8001,7 +8016,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) | |||
| 8001 | 8016 | ||
| 8002 | /* If you change this format, don't forget to also | 8017 | /* If you change this format, don't forget to also |
| 8003 | change message_log_check_duplicate. */ | 8018 | change message_log_check_duplicate. */ |
| 8004 | sprintf (dupstr, " [%d times]", dups); | 8019 | sprintf (dupstr, " [%lu times]", dups); |
| 8005 | duplen = strlen (dupstr); | 8020 | duplen = strlen (dupstr); |
| 8006 | TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1); | 8021 | TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1); |
| 8007 | insert_1 (dupstr, duplen, 1, 0, 1); | 8022 | insert_1 (dupstr, duplen, 1, 0, 1); |
| @@ -8063,7 +8078,7 @@ message_dolog (const char *m, EMACS_INT nbytes, int nlflag, int multibyte) | |||
| 8063 | Return 0 if different, 1 if the new one should just replace it, or a | 8078 | Return 0 if different, 1 if the new one should just replace it, or a |
| 8064 | value N > 1 if we should also append " [N times]". */ | 8079 | value N > 1 if we should also append " [N times]". */ |
| 8065 | 8080 | ||
| 8066 | static int | 8081 | static unsigned long int |
| 8067 | message_log_check_duplicate (EMACS_INT prev_bol, EMACS_INT prev_bol_byte, | 8082 | message_log_check_duplicate (EMACS_INT prev_bol, EMACS_INT prev_bol_byte, |
| 8068 | EMACS_INT this_bol, EMACS_INT this_bol_byte) | 8083 | EMACS_INT this_bol, EMACS_INT this_bol_byte) |
| 8069 | { | 8084 | { |
| @@ -8085,10 +8100,9 @@ message_log_check_duplicate (EMACS_INT prev_bol, EMACS_INT prev_bol_byte, | |||
| 8085 | return 2; | 8100 | return 2; |
| 8086 | if (*p1++ == ' ' && *p1++ == '[') | 8101 | if (*p1++ == ' ' && *p1++ == '[') |
| 8087 | { | 8102 | { |
| 8088 | int n = 0; | 8103 | char *pend; |
| 8089 | while (*p1 >= '0' && *p1 <= '9') | 8104 | unsigned long int n = strtoul ((char *) p1, &pend, 10); |
| 8090 | n = n * 10 + *p1++ - '0'; | 8105 | if (strncmp (pend, " times]\n", 8) == 0) |
| 8091 | if (strncmp ((char *) p1, " times]\n", 8) == 0) | ||
| 8092 | return n+1; | 8106 | return n+1; |
| 8093 | } | 8107 | } |
| 8094 | return 0; | 8108 | return 0; |
| @@ -9209,7 +9223,7 @@ set_message_1 (EMACS_INT a1, Lisp_Object a2, EMACS_INT nbytes, EMACS_INT multiby | |||
| 9209 | c = string_char_and_length (msg + i, &n); | 9223 | c = string_char_and_length (msg + i, &n); |
| 9210 | work[0] = (ASCII_CHAR_P (c) | 9224 | work[0] = (ASCII_CHAR_P (c) |
| 9211 | ? c | 9225 | ? c |
| 9212 | : multibyte_char_to_unibyte (c, Qnil)); | 9226 | : multibyte_char_to_unibyte (c)); |
| 9213 | insert_1_both (work, 1, 1, 1, 0, 0); | 9227 | insert_1_both (work, 1, 1, 1, 0, 0); |
| 9214 | } | 9228 | } |
| 9215 | } | 9229 | } |
| @@ -12712,7 +12726,7 @@ set_cursor_from_row (struct window *w, struct glyph_row *row, | |||
| 12712 | EMACS_INT tem; | 12726 | EMACS_INT tem; |
| 12713 | 12727 | ||
| 12714 | str = glyph->object; | 12728 | str = glyph->object; |
| 12715 | tem = string_buffer_position_lim (w, str, pos, pos_after, 0); | 12729 | tem = string_buffer_position_lim (str, pos, pos_after, 0); |
| 12716 | if (tem == 0 /* from overlay */ | 12730 | if (tem == 0 /* from overlay */ |
| 12717 | || pos <= tem) | 12731 | || pos <= tem) |
| 12718 | { | 12732 | { |
| @@ -13438,7 +13452,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 13438 | && row < w->current_matrix->rows | 13452 | && row < w->current_matrix->rows |
| 13439 | + w->current_matrix->nrows - 1 | 13453 | + w->current_matrix->nrows - 1 |
| 13440 | && MATRIX_ROW_START_CHARPOS (row+1) == PT | 13454 | && MATRIX_ROW_START_CHARPOS (row+1) == PT |
| 13441 | && !cursor_row_p (w, row)) | 13455 | && !cursor_row_p (row)) |
| 13442 | ++row; | 13456 | ++row; |
| 13443 | 13457 | ||
| 13444 | /* If within the scroll margin, scroll. Note that | 13458 | /* If within the scroll margin, scroll. Note that |
| @@ -13490,7 +13504,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 13490 | skip forward over overlay strings. */ | 13504 | skip forward over overlay strings. */ |
| 13491 | while (MATRIX_ROW_BOTTOM_Y (row) < last_y | 13505 | while (MATRIX_ROW_BOTTOM_Y (row) < last_y |
| 13492 | && MATRIX_ROW_END_CHARPOS (row) == PT | 13506 | && MATRIX_ROW_END_CHARPOS (row) == PT |
| 13493 | && !cursor_row_p (w, row)) | 13507 | && !cursor_row_p (row)) |
| 13494 | ++row; | 13508 | ++row; |
| 13495 | 13509 | ||
| 13496 | /* If within the scroll margin, scroll. */ | 13510 | /* If within the scroll margin, scroll. */ |
| @@ -13586,7 +13600,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 13586 | { | 13600 | { |
| 13587 | if (MATRIX_ROW_START_CHARPOS (row) <= PT | 13601 | if (MATRIX_ROW_START_CHARPOS (row) <= PT |
| 13588 | && PT <= MATRIX_ROW_END_CHARPOS (row) | 13602 | && PT <= MATRIX_ROW_END_CHARPOS (row) |
| 13589 | && cursor_row_p (w, row)) | 13603 | && cursor_row_p (row)) |
| 13590 | rv |= set_cursor_from_row (w, row, w->current_matrix, | 13604 | rv |= set_cursor_from_row (w, row, w->current_matrix, |
| 13591 | 0, 0, 0, 0); | 13605 | 0, 0, 0, 0); |
| 13592 | /* As soon as we've found the first suitable row | 13606 | /* As soon as we've found the first suitable row |
| @@ -13625,7 +13639,7 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste | |||
| 13625 | } | 13639 | } |
| 13626 | while (MATRIX_ROW_BOTTOM_Y (row) < last_y | 13640 | while (MATRIX_ROW_BOTTOM_Y (row) < last_y |
| 13627 | && MATRIX_ROW_START_CHARPOS (row) == PT | 13641 | && MATRIX_ROW_START_CHARPOS (row) == PT |
| 13628 | && cursor_row_p (w, row)); | 13642 | && cursor_row_p (row)); |
| 13629 | } | 13643 | } |
| 13630 | } | 13644 | } |
| 13631 | } | 13645 | } |
| @@ -14157,7 +14171,6 @@ redisplay_window (Lisp_Object window, int just_this_one_p) | |||
| 14157 | || temp_scroll_step | 14171 | || temp_scroll_step |
| 14158 | || NUMBERP (BVAR (current_buffer, scroll_up_aggressively)) | 14172 | || NUMBERP (BVAR (current_buffer, scroll_up_aggressively)) |
| 14159 | || NUMBERP (BVAR (current_buffer, scroll_down_aggressively))) | 14173 | || NUMBERP (BVAR (current_buffer, scroll_down_aggressively))) |
| 14160 | && !current_buffer->clip_changed | ||
| 14161 | && CHARPOS (startp) >= BEGV | 14174 | && CHARPOS (startp) >= BEGV |
| 14162 | && CHARPOS (startp) <= ZV) | 14175 | && CHARPOS (startp) <= ZV) |
| 14163 | { | 14176 | { |
| @@ -14625,8 +14638,6 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 14625 | 14638 | ||
| 14626 | if (CHARPOS (new_start) <= CHARPOS (start)) | 14639 | if (CHARPOS (new_start) <= CHARPOS (start)) |
| 14627 | { | 14640 | { |
| 14628 | int first_row_y; | ||
| 14629 | |||
| 14630 | /* Don't use this method if the display starts with an ellipsis | 14641 | /* Don't use this method if the display starts with an ellipsis |
| 14631 | displayed for invisible text. It's not easy to handle that case | 14642 | displayed for invisible text. It's not easy to handle that case |
| 14632 | below, and it's certainly not worth the effort since this is | 14643 | below, and it's certainly not worth the effort since this is |
| @@ -14641,7 +14652,6 @@ try_window_reusing_current_matrix (struct window *w) | |||
| 14641 | text. Note that it.vpos == 0 if or if not there is a | 14652 | text. Note that it.vpos == 0 if or if not there is a |
| 14642 | header-line; it's not the same as the MATRIX_ROW_VPOS! */ | 14653 | header-line; it's not the same as the MATRIX_ROW_VPOS! */ |
| 14643 | start_display (&it, w, new_start); | 14654 | start_display (&it, w, new_start); |
| 14644 | first_row_y = it.current_y; | ||
| 14645 | w->cursor.vpos = -1; | 14655 | w->cursor.vpos = -1; |
| 14646 | last_text_row = last_reused_text_row = NULL; | 14656 | last_text_row = last_reused_text_row = NULL; |
| 14647 | 14657 | ||
| @@ -16370,7 +16380,7 @@ With ARG, turn tracing on if and only if ARG is positive. */) | |||
| 16370 | DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "", | 16380 | DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "", |
| 16371 | doc: /* Like `format', but print result to stderr. | 16381 | doc: /* Like `format', but print result to stderr. |
| 16372 | usage: (trace-to-stderr STRING &rest OBJECTS) */) | 16382 | usage: (trace-to-stderr STRING &rest OBJECTS) */) |
| 16373 | (int nargs, Lisp_Object *args) | 16383 | (size_t nargs, Lisp_Object *args) |
| 16374 | { | 16384 | { |
| 16375 | Lisp_Object s = Fformat (nargs, args); | 16385 | Lisp_Object s = Fformat (nargs, args); |
| 16376 | fprintf (stderr, "%s", SDATA (s)); | 16386 | fprintf (stderr, "%s", SDATA (s)); |
| @@ -16953,11 +16963,11 @@ highlight_trailing_whitespace (struct frame *f, struct glyph_row *row) | |||
| 16953 | } | 16963 | } |
| 16954 | 16964 | ||
| 16955 | 16965 | ||
| 16956 | /* Value is non-zero if glyph row ROW in window W should be | 16966 | /* Value is non-zero if glyph row ROW should be |
| 16957 | used to hold the cursor. */ | 16967 | used to hold the cursor. */ |
| 16958 | 16968 | ||
| 16959 | static int | 16969 | static int |
| 16960 | cursor_row_p (struct window *w, struct glyph_row *row) | 16970 | cursor_row_p (struct glyph_row *row) |
| 16961 | { | 16971 | { |
| 16962 | int result = 1; | 16972 | int result = 1; |
| 16963 | 16973 | ||
| @@ -17870,7 +17880,7 @@ display_line (struct it *it) | |||
| 17870 | && !MATRIX_ROW (it->w->desired_matrix, cvpos)->ends_at_zv_p)) | 17880 | && !MATRIX_ROW (it->w->desired_matrix, cvpos)->ends_at_zv_p)) |
| 17871 | && PT >= MATRIX_ROW_START_CHARPOS (row) | 17881 | && PT >= MATRIX_ROW_START_CHARPOS (row) |
| 17872 | && PT <= MATRIX_ROW_END_CHARPOS (row) | 17882 | && PT <= MATRIX_ROW_END_CHARPOS (row) |
| 17873 | && cursor_row_p (it->w, row)) | 17883 | && cursor_row_p (row)) |
| 17874 | set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); | 17884 | set_cursor_from_row (it->w, row, it->w->desired_matrix, 0, 0, 0, 0); |
| 17875 | 17885 | ||
| 17876 | /* Highlight trailing whitespace. */ | 17886 | /* Highlight trailing whitespace. */ |
| @@ -18522,7 +18532,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 18522 | charpos = (STRING_MULTIBYTE (elt) | 18532 | charpos = (STRING_MULTIBYTE (elt) |
| 18523 | ? string_byte_to_char (elt, bytepos) | 18533 | ? string_byte_to_char (elt, bytepos) |
| 18524 | : bytepos); | 18534 | : bytepos); |
| 18525 | spec = decode_mode_spec (it->w, c, field, prec, &string); | 18535 | spec = decode_mode_spec (it->w, c, field, &string); |
| 18526 | multibyte = STRINGP (string) && STRING_MULTIBYTE (string); | 18536 | multibyte = STRINGP (string) && STRING_MULTIBYTE (string); |
| 18527 | 18537 | ||
| 18528 | switch (mode_line_target) | 18538 | switch (mode_line_target) |
| @@ -19007,7 +19017,7 @@ pint2str (register char *buf, register int width, register EMACS_INT d) | |||
| 19007 | 19017 | ||
| 19008 | static const char power_letter[] = | 19018 | static const char power_letter[] = |
| 19009 | { | 19019 | { |
| 19010 | 0, /* not used */ | 19020 | 0, /* no letter */ |
| 19011 | 'k', /* kilo */ | 19021 | 'k', /* kilo */ |
| 19012 | 'M', /* mega */ | 19022 | 'M', /* mega */ |
| 19013 | 'G', /* giga */ | 19023 | 'G', /* giga */ |
| @@ -19089,8 +19099,7 @@ pint2hrstr (char *buf, int width, int d) | |||
| 19089 | p = psuffix = buf + max (width, length); | 19099 | p = psuffix = buf + max (width, length); |
| 19090 | 19100 | ||
| 19091 | /* Print EXPONENT. */ | 19101 | /* Print EXPONENT. */ |
| 19092 | if (exponent) | 19102 | *psuffix++ = power_letter[exponent]; |
| 19093 | *psuffix++ = power_letter[exponent]; | ||
| 19094 | *psuffix = '\0'; | 19103 | *psuffix = '\0'; |
| 19095 | 19104 | ||
| 19096 | /* Print TENTHS. */ | 19105 | /* Print TENTHS. */ |
| @@ -19194,9 +19203,8 @@ decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_ | |||
| 19194 | } | 19203 | } |
| 19195 | 19204 | ||
| 19196 | /* Return a string for the output of a mode line %-spec for window W, | 19205 | /* Return a string for the output of a mode line %-spec for window W, |
| 19197 | generated by character C. PRECISION >= 0 means don't return a | 19206 | generated by character C. FIELD_WIDTH > 0 means pad the string |
| 19198 | string longer than that value. FIELD_WIDTH > 0 means pad the | 19207 | returned with spaces to that value. Return a Lisp string in |
| 19199 | string returned with spaces to that value. Return a Lisp string in | ||
| 19200 | *STRING if the resulting string is taken from that Lisp string. | 19208 | *STRING if the resulting string is taken from that Lisp string. |
| 19201 | 19209 | ||
| 19202 | Note we operate on the current buffer for most purposes, | 19210 | Note we operate on the current buffer for most purposes, |
| @@ -19206,7 +19214,7 @@ static char lots_of_dashes[] = "------------------------------------------------ | |||
| 19206 | 19214 | ||
| 19207 | static const char * | 19215 | static const char * |
| 19208 | decode_mode_spec (struct window *w, register int c, int field_width, | 19216 | decode_mode_spec (struct window *w, register int c, int field_width, |
| 19209 | int precision, Lisp_Object *string) | 19217 | Lisp_Object *string) |
| 19210 | { | 19218 | { |
| 19211 | Lisp_Object obj; | 19219 | Lisp_Object obj; |
| 19212 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 19220 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| @@ -22740,7 +22748,6 @@ x_produce_glyphs (struct it *it) | |||
| 22740 | int ch = COMPOSITION_GLYPH (cmp, i); | 22748 | int ch = COMPOSITION_GLYPH (cmp, i); |
| 22741 | int face_id; | 22749 | int face_id; |
| 22742 | struct face *this_face; | 22750 | struct face *this_face; |
| 22743 | int this_boff; | ||
| 22744 | 22751 | ||
| 22745 | if (ch == '\t') | 22752 | if (ch == '\t') |
| 22746 | ch = ' '; | 22753 | ch = ' '; |
| @@ -22752,9 +22759,6 @@ x_produce_glyphs (struct it *it) | |||
| 22752 | pcm = NULL; | 22759 | pcm = NULL; |
| 22753 | else | 22760 | else |
| 22754 | { | 22761 | { |
| 22755 | this_boff = font->baseline_offset; | ||
| 22756 | if (font->vertical_centering) | ||
| 22757 | this_boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff; | ||
| 22758 | get_char_face_and_encoding (it->f, ch, face_id, | 22762 | get_char_face_and_encoding (it->f, ch, face_id, |
| 22759 | &char2b, it->multibyte_p, 0); | 22763 | &char2b, it->multibyte_p, 0); |
| 22760 | pcm = get_per_char_metric (it->f, font, &char2b); | 22764 | pcm = get_per_char_metric (it->f, font, &char2b); |
| @@ -24307,7 +24311,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 24307 | END_CHARPOS, or if they come from an overlay. */ | 24311 | END_CHARPOS, or if they come from an overlay. */ |
| 24308 | if (EQ (glyph->object, before_string)) | 24312 | if (EQ (glyph->object, before_string)) |
| 24309 | { | 24313 | { |
| 24310 | pos = string_buffer_position (w, before_string, | 24314 | pos = string_buffer_position (before_string, |
| 24311 | start_charpos); | 24315 | start_charpos); |
| 24312 | /* If pos == 0, it means before_string came from an | 24316 | /* If pos == 0, it means before_string came from an |
| 24313 | overlay, not from a buffer position. */ | 24317 | overlay, not from a buffer position. */ |
| @@ -24316,7 +24320,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 24316 | } | 24320 | } |
| 24317 | else if (EQ (glyph->object, after_string)) | 24321 | else if (EQ (glyph->object, after_string)) |
| 24318 | { | 24322 | { |
| 24319 | pos = string_buffer_position (w, after_string, end_charpos); | 24323 | pos = string_buffer_position (after_string, end_charpos); |
| 24320 | if (!pos || (pos >= start_charpos && pos < end_charpos)) | 24324 | if (!pos || (pos >= start_charpos && pos < end_charpos)) |
| 24321 | break; | 24325 | break; |
| 24322 | } | 24326 | } |
| @@ -24358,7 +24362,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 24358 | END_CHARPOS, or if they come from an overlay. */ | 24362 | END_CHARPOS, or if they come from an overlay. */ |
| 24359 | if (EQ (glyph->object, before_string)) | 24363 | if (EQ (glyph->object, before_string)) |
| 24360 | { | 24364 | { |
| 24361 | pos = string_buffer_position (w, before_string, start_charpos); | 24365 | pos = string_buffer_position (before_string, start_charpos); |
| 24362 | /* If pos == 0, it means before_string came from an | 24366 | /* If pos == 0, it means before_string came from an |
| 24363 | overlay, not from a buffer position. */ | 24367 | overlay, not from a buffer position. */ |
| 24364 | if (!pos || (pos >= start_charpos && pos < end_charpos)) | 24368 | if (!pos || (pos >= start_charpos && pos < end_charpos)) |
| @@ -24366,7 +24370,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 24366 | } | 24370 | } |
| 24367 | else if (EQ (glyph->object, after_string)) | 24371 | else if (EQ (glyph->object, after_string)) |
| 24368 | { | 24372 | { |
| 24369 | pos = string_buffer_position (w, after_string, end_charpos); | 24373 | pos = string_buffer_position (after_string, end_charpos); |
| 24370 | if (!pos || (pos >= start_charpos && pos < end_charpos)) | 24374 | if (!pos || (pos >= start_charpos && pos < end_charpos)) |
| 24371 | break; | 24375 | break; |
| 24372 | } | 24376 | } |
| @@ -24424,13 +24428,13 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 24424 | END_CHARPOS, or if they come from an overlay. */ | 24428 | END_CHARPOS, or if they come from an overlay. */ |
| 24425 | if (EQ (end->object, before_string)) | 24429 | if (EQ (end->object, before_string)) |
| 24426 | { | 24430 | { |
| 24427 | pos = string_buffer_position (w, before_string, start_charpos); | 24431 | pos = string_buffer_position (before_string, start_charpos); |
| 24428 | if (!pos || (pos >= start_charpos && pos < end_charpos)) | 24432 | if (!pos || (pos >= start_charpos && pos < end_charpos)) |
| 24429 | break; | 24433 | break; |
| 24430 | } | 24434 | } |
| 24431 | else if (EQ (end->object, after_string)) | 24435 | else if (EQ (end->object, after_string)) |
| 24432 | { | 24436 | { |
| 24433 | pos = string_buffer_position (w, after_string, end_charpos); | 24437 | pos = string_buffer_position (after_string, end_charpos); |
| 24434 | if (!pos || (pos >= start_charpos && pos < end_charpos)) | 24438 | if (!pos || (pos >= start_charpos && pos < end_charpos)) |
| 24435 | break; | 24439 | break; |
| 24436 | } | 24440 | } |
| @@ -24474,13 +24478,13 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 24474 | END_CHARPOS, or if they come from an overlay. */ | 24478 | END_CHARPOS, or if they come from an overlay. */ |
| 24475 | if (EQ (end->object, before_string)) | 24479 | if (EQ (end->object, before_string)) |
| 24476 | { | 24480 | { |
| 24477 | pos = string_buffer_position (w, before_string, start_charpos); | 24481 | pos = string_buffer_position (before_string, start_charpos); |
| 24478 | if (!pos || (pos >= start_charpos && pos < end_charpos)) | 24482 | if (!pos || (pos >= start_charpos && pos < end_charpos)) |
| 24479 | break; | 24483 | break; |
| 24480 | } | 24484 | } |
| 24481 | else if (EQ (end->object, after_string)) | 24485 | else if (EQ (end->object, after_string)) |
| 24482 | { | 24486 | { |
| 24483 | pos = string_buffer_position (w, after_string, end_charpos); | 24487 | pos = string_buffer_position (after_string, end_charpos); |
| 24484 | if (!pos || (pos >= start_charpos && pos < end_charpos)) | 24488 | if (!pos || (pos >= start_charpos && pos < end_charpos)) |
| 24485 | break; | 24489 | break; |
| 24486 | } | 24490 | } |
| @@ -24957,10 +24961,9 @@ note_mode_line_or_margin_highlight (Lisp_Object window, int x, int y, | |||
| 24957 | CONSP (hotspot)) | 24961 | CONSP (hotspot)) |
| 24958 | && (hotspot = XCDR (hotspot), CONSP (hotspot))) | 24962 | && (hotspot = XCDR (hotspot), CONSP (hotspot))) |
| 24959 | { | 24963 | { |
| 24960 | Lisp_Object area_id, plist; | 24964 | Lisp_Object plist; |
| 24961 | 24965 | ||
| 24962 | area_id = XCAR (hotspot); | 24966 | /* Could check XCAR (hotspot) to see if we enter/leave this hot-spot. |
| 24963 | /* Could check AREA_ID to see if we enter/leave this hot-spot. | ||
| 24964 | If so, we could look for mouse-enter, mouse-leave | 24967 | If so, we could look for mouse-enter, mouse-leave |
| 24965 | properties in PLIST (and do something...). */ | 24968 | properties in PLIST (and do something...). */ |
| 24966 | hotspot = XCDR (hotspot); | 24969 | hotspot = XCDR (hotspot); |
| @@ -25295,10 +25298,10 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 25295 | CONSP (hotspot)) | 25298 | CONSP (hotspot)) |
| 25296 | && (hotspot = XCDR (hotspot), CONSP (hotspot))) | 25299 | && (hotspot = XCDR (hotspot), CONSP (hotspot))) |
| 25297 | { | 25300 | { |
| 25298 | Lisp_Object area_id, plist; | 25301 | Lisp_Object plist; |
| 25299 | 25302 | ||
| 25300 | area_id = XCAR (hotspot); | 25303 | /* Could check XCAR (hotspot) to see if we enter/leave |
| 25301 | /* Could check AREA_ID to see if we enter/leave this hot-spot. | 25304 | this hot-spot. |
| 25302 | If so, we could look for mouse-enter, mouse-leave | 25305 | If so, we could look for mouse-enter, mouse-leave |
| 25303 | properties in PLIST (and do something...). */ | 25306 | properties in PLIST (and do something...). */ |
| 25304 | hotspot = XCDR (hotspot); | 25307 | hotspot = XCDR (hotspot); |
| @@ -25464,7 +25467,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 25464 | check if the text under it has one. */ | 25467 | check if the text under it has one. */ |
| 25465 | struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos); | 25468 | struct glyph_row *r = MATRIX_ROW (w->current_matrix, vpos); |
| 25466 | EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); | 25469 | EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); |
| 25467 | pos = string_buffer_position (w, object, start); | 25470 | pos = string_buffer_position (object, start); |
| 25468 | if (pos > 0) | 25471 | if (pos > 0) |
| 25469 | { | 25472 | { |
| 25470 | mouse_face = get_char_property_and_overlay | 25473 | mouse_face = get_char_property_and_overlay |
| @@ -25574,7 +25577,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 25574 | struct glyph_row *r | 25577 | struct glyph_row *r |
| 25575 | = MATRIX_ROW (w->current_matrix, vpos); | 25578 | = MATRIX_ROW (w->current_matrix, vpos); |
| 25576 | EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); | 25579 | EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); |
| 25577 | EMACS_INT p = string_buffer_position (w, obj, start); | 25580 | EMACS_INT p = string_buffer_position (obj, start); |
| 25578 | if (p > 0) | 25581 | if (p > 0) |
| 25579 | { | 25582 | { |
| 25580 | help = Fget_char_property (make_number (p), | 25583 | help = Fget_char_property (make_number (p), |
| @@ -25630,7 +25633,7 @@ note_mouse_highlight (struct frame *f, int x, int y) | |||
| 25630 | struct glyph_row *r | 25633 | struct glyph_row *r |
| 25631 | = MATRIX_ROW (w->current_matrix, vpos); | 25634 | = MATRIX_ROW (w->current_matrix, vpos); |
| 25632 | EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); | 25635 | EMACS_INT start = MATRIX_ROW_START_CHARPOS (r); |
| 25633 | EMACS_INT p = string_buffer_position (w, obj, start); | 25636 | EMACS_INT p = string_buffer_position (obj, start); |
| 25634 | if (p > 0) | 25637 | if (p > 0) |
| 25635 | pointer = Fget_char_property (make_number (p), | 25638 | pointer = Fget_char_property (make_number (p), |
| 25636 | Qpointer, w->buffer); | 25639 | Qpointer, w->buffer); |