diff options
| author | Eli Zaretskii | 2012-01-09 22:45:49 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-01-09 22:45:49 +0200 |
| commit | a0db8d43d73d107fd786f01eb70547e16b62fb8f (patch) | |
| tree | 77a5f9b4e49af00efd42207e4103500f88500d05 /src | |
| parent | 7655cb66d86564e792b825f1a0e1a4de7d6e6db5 (diff) | |
| download | emacs-a0db8d43d73d107fd786f01eb70547e16b62fb8f.tar.gz emacs-a0db8d43d73d107fd786f01eb70547e16b62fb8f.zip | |
Fix bug #10464 with mouse highlight of display strings.
src/xdisp.c (rows_from_pos_range): Accept additional argument
DISP_STRING, and accept any glyph in a row whose object is that
string as eligible for mouse highlight. Fixes mouse highlight of
display strings from overlays.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/xdisp.c | 24 |
2 files changed, 23 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6ef11faea19..9af9b88feef 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2012-01-09 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (rows_from_pos_range): Accept additional argument | ||
| 4 | DISP_STRING, and accept any glyph in a row whose object is that | ||
| 5 | string as eligible for mouse highlight. Fixes mouse highlight of | ||
| 6 | display strings from overlays. (Bug#10464) | ||
| 7 | |||
| 1 | 2012-01-07 Paul Eggert <eggert@cs.ucla.edu> | 8 | 2012-01-07 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 9 | ||
| 3 | emacs: fix an auto-save permissions race condition (Bug#10400) | 10 | emacs: fix an auto-save permissions race condition (Bug#10400) |
diff --git a/src/xdisp.c b/src/xdisp.c index 9427682c611..c3bda5594b2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -25817,12 +25817,14 @@ cursor_in_mouse_face_p (struct window *w) | |||
| 25817 | 25817 | ||
| 25818 | /* Find the glyph rows START_ROW and END_ROW of window W that display | 25818 | /* Find the glyph rows START_ROW and END_ROW of window W that display |
| 25819 | characters between buffer positions START_CHARPOS and END_CHARPOS | 25819 | characters between buffer positions START_CHARPOS and END_CHARPOS |
| 25820 | (excluding END_CHARPOS). This is similar to row_containing_pos, | 25820 | (excluding END_CHARPOS). DISP_STRING is a display string that |
| 25821 | but is more accurate when bidi reordering makes buffer positions | 25821 | covers these buffer positions. This is similar to |
| 25822 | change non-linearly with glyph rows. */ | 25822 | row_containing_pos, but is more accurate when bidi reordering makes |
| 25823 | buffer positions change non-linearly with glyph rows. */ | ||
| 25823 | static void | 25824 | static void |
| 25824 | rows_from_pos_range (struct window *w, | 25825 | rows_from_pos_range (struct window *w, |
| 25825 | EMACS_INT start_charpos, EMACS_INT end_charpos, | 25826 | EMACS_INT start_charpos, EMACS_INT end_charpos, |
| 25827 | Lisp_Object disp_string, | ||
| 25826 | struct glyph_row **start, struct glyph_row **end) | 25828 | struct glyph_row **start, struct glyph_row **end) |
| 25827 | { | 25829 | { |
| 25828 | struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); | 25830 | struct glyph_row *first = MATRIX_FIRST_TEXT_ROW (w->current_matrix); |
| @@ -25874,8 +25876,11 @@ rows_from_pos_range (struct window *w, | |||
| 25874 | 25876 | ||
| 25875 | while (g < e) | 25877 | while (g < e) |
| 25876 | { | 25878 | { |
| 25877 | if ((BUFFERP (g->object) || INTEGERP (g->object)) | 25879 | if (((BUFFERP (g->object) || INTEGERP (g->object)) |
| 25878 | && start_charpos <= g->charpos && g->charpos < end_charpos) | 25880 | && start_charpos <= g->charpos && g->charpos < end_charpos) |
| 25881 | /* A glyph that comes from DISP_STRING is by | ||
| 25882 | definition to be highlighted. */ | ||
| 25883 | || EQ (g->object, disp_string)) | ||
| 25879 | *start = row; | 25884 | *start = row; |
| 25880 | g++; | 25885 | g++; |
| 25881 | } | 25886 | } |
| @@ -25924,8 +25929,11 @@ rows_from_pos_range (struct window *w, | |||
| 25924 | 25929 | ||
| 25925 | while (g < e) | 25930 | while (g < e) |
| 25926 | { | 25931 | { |
| 25927 | if ((BUFFERP (g->object) || INTEGERP (g->object)) | 25932 | if (((BUFFERP (g->object) || INTEGERP (g->object)) |
| 25928 | && start_charpos <= g->charpos && g->charpos < end_charpos) | 25933 | && start_charpos <= g->charpos && g->charpos < end_charpos) |
| 25934 | /* A glyph that comes from DISP_STRING is by | ||
| 25935 | definition to be highlighted. */ | ||
| 25936 | || EQ (g->object, disp_string)) | ||
| 25929 | break; | 25937 | break; |
| 25930 | g++; | 25938 | g++; |
| 25931 | } | 25939 | } |
| @@ -25969,7 +25977,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, | |||
| 25969 | xassert (NILP (after_string) || STRINGP (after_string)); | 25977 | xassert (NILP (after_string) || STRINGP (after_string)); |
| 25970 | 25978 | ||
| 25971 | /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ | 25979 | /* Find the rows corresponding to START_CHARPOS and END_CHARPOS. */ |
| 25972 | rows_from_pos_range (w, start_charpos, end_charpos, &r1, &r2); | 25980 | rows_from_pos_range (w, start_charpos, end_charpos, disp_string, &r1, &r2); |
| 25973 | if (r1 == NULL) | 25981 | if (r1 == NULL) |
| 25974 | r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); | 25982 | r1 = MATRIX_ROW (w->current_matrix, XFASTINT (w->window_end_vpos)); |
| 25975 | /* If the before-string or display-string contains newlines, | 25983 | /* If the before-string or display-string contains newlines, |