diff options
| author | Gerd Moellmann | 2001-03-09 18:42:28 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-09 18:42:28 +0000 |
| commit | 7177d86b4b1036744c67a3c746facf24249d5757 (patch) | |
| tree | 2925451c621f4198326a75bed275bc306973c3db /src | |
| parent | 74bd6d658d72193652c03de3366388b9cce1911c (diff) | |
| download | emacs-7177d86b4b1036744c67a3c746facf24249d5757.tar.gz emacs-7177d86b4b1036744c67a3c746facf24249d5757.zip | |
(note_mouse_highlight): If there's no help-echo on
a string, look at the buffer text ``under'' it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/src/xterm.c b/src/xterm.c index 592c60ff2bc..bddbef78647 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6936,22 +6936,48 @@ note_mouse_highlight (f, x, y) | |||
| 6936 | } | 6936 | } |
| 6937 | else | 6937 | else |
| 6938 | { | 6938 | { |
| 6939 | Lisp_Object object = glyph->object; | ||
| 6940 | int charpos = glyph->charpos; | ||
| 6941 | |||
| 6939 | /* Try text properties. */ | 6942 | /* Try text properties. */ |
| 6940 | if ((STRINGP (glyph->object) | 6943 | if (STRINGP (object) |
| 6941 | && glyph->charpos >= 0 | 6944 | && charpos >= 0 |
| 6942 | && glyph->charpos < XSTRING (glyph->object)->size) | 6945 | && charpos < XSTRING (object)->size) |
| 6943 | || (BUFFERP (glyph->object) | 6946 | { |
| 6944 | && glyph->charpos >= BEGV | 6947 | help = Fget_text_property (make_number (charpos), |
| 6945 | && glyph->charpos < ZV)) | 6948 | Qhelp_echo, object); |
| 6946 | help = Fget_text_property (make_number (glyph->charpos), | 6949 | if (NILP (help)) |
| 6947 | Qhelp_echo, glyph->object); | 6950 | { |
| 6951 | /* If the string itself doesn't specify a help-echo, | ||
| 6952 | see if the buffer text ``under'' it does. */ | ||
| 6953 | struct glyph_row *r | ||
| 6954 | = MATRIX_ROW (w->current_matrix, vpos); | ||
| 6955 | int start = MATRIX_ROW_START_CHARPOS (r); | ||
| 6956 | int pos = string_buffer_position (w, object, start); | ||
| 6957 | if (pos > 0) | ||
| 6958 | { | ||
| 6959 | help = Fget_text_property (make_number (pos), | ||
| 6960 | Qhelp_echo, w->buffer); | ||
| 6961 | if (!NILP (help)) | ||
| 6962 | { | ||
| 6963 | charpos = pos; | ||
| 6964 | object = w->buffer; | ||
| 6965 | } | ||
| 6966 | } | ||
| 6967 | } | ||
| 6968 | } | ||
| 6969 | else if (BUFFERP (object) | ||
| 6970 | && charpos >= BEGV | ||
| 6971 | && charpos < ZV) | ||
| 6972 | help = Fget_text_property (make_number (charpos), Qhelp_echo, | ||
| 6973 | object); | ||
| 6948 | 6974 | ||
| 6949 | if (!NILP (help)) | 6975 | if (!NILP (help)) |
| 6950 | { | 6976 | { |
| 6951 | help_echo = help; | 6977 | help_echo = help; |
| 6952 | help_echo_window = window; | 6978 | help_echo_window = window; |
| 6953 | help_echo_object = glyph->object; | 6979 | help_echo_object = object; |
| 6954 | help_echo_pos = glyph->charpos; | 6980 | help_echo_pos = charpos; |
| 6955 | } | 6981 | } |
| 6956 | } | 6982 | } |
| 6957 | } | 6983 | } |