diff options
| author | Juanma Barranquero | 2014-04-30 21:54:52 +0200 |
|---|---|---|
| committer | Juanma Barranquero | 2014-04-30 21:54:52 +0200 |
| commit | 09b911adf4e22bbcac8c588bc14ade801276732e (patch) | |
| tree | 0d9eb9708479bb491d7e1e2bb030aa3e90299526 /src/term.c | |
| parent | b0e36b7048c88aa24f6955c53fbe790bb9ebc54f (diff) | |
| parent | 426b5dafdd837328d624a8ec5bfd567f2865c9f5 (diff) | |
| download | emacs-09b911adf4e22bbcac8c588bc14ade801276732e.tar.gz emacs-09b911adf4e22bbcac8c588bc14ade801276732e.zip | |
Merge from emacs-24; up to 2014-05-01T10:21:17Z!rgm@gnu.org
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c index 6ea9a4eba9a..c636b8cac8b 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -2924,6 +2924,13 @@ tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces, | |||
| 2924 | menu_help_paneno = pn - 1; | 2924 | menu_help_paneno = pn - 1; |
| 2925 | menu_help_itemno = j; | 2925 | menu_help_itemno = j; |
| 2926 | } | 2926 | } |
| 2927 | /* Take note of the coordinates of the active menu item, to | ||
| 2928 | display the cursor there. */ | ||
| 2929 | if (mousehere) | ||
| 2930 | { | ||
| 2931 | row = y + i; | ||
| 2932 | col = x; | ||
| 2933 | } | ||
| 2927 | display_tty_menu_item (menu->text[j], max_width, face, x, y + i, | 2934 | display_tty_menu_item (menu->text[j], max_width, face, x, y + i, |
| 2928 | menu->submenu[j] != NULL); | 2935 | menu->submenu[j] != NULL); |
| 2929 | } | 2936 | } |
| @@ -3204,6 +3211,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, | |||
| 3204 | bool first_time; | 3211 | bool first_time; |
| 3205 | Lisp_Object selectface; | 3212 | Lisp_Object selectface; |
| 3206 | int first_item = 0; | 3213 | int first_item = 0; |
| 3214 | int col, row; | ||
| 3207 | 3215 | ||
| 3208 | /* Don't allow non-positive x0 and y0, lest the menu will wrap | 3216 | /* Don't allow non-positive x0 and y0, lest the menu will wrap |
| 3209 | around the display. */ | 3217 | around the display. */ |
| @@ -3391,7 +3399,14 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, | |||
| 3391 | faces, x, y, first_item, 1); | 3399 | faces, x, y, first_item, 1); |
| 3392 | tty_hide_cursor (tty); | 3400 | tty_hide_cursor (tty); |
| 3393 | fflush (tty->output); | 3401 | fflush (tty->output); |
| 3402 | /* The call to display help-echo below will move the cursor, | ||
| 3403 | so remember its current position as computed by | ||
| 3404 | tty_menu_display. */ | ||
| 3405 | col = cursorX (tty); | ||
| 3406 | row = cursorY (tty); | ||
| 3394 | } | 3407 | } |
| 3408 | else | ||
| 3409 | row = -1; | ||
| 3395 | 3410 | ||
| 3396 | /* Display the help-echo message for the currently-selected menu | 3411 | /* Display the help-echo message for the currently-selected menu |
| 3397 | item. */ | 3412 | item. */ |
| @@ -3400,6 +3415,11 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx, | |||
| 3400 | { | 3415 | { |
| 3401 | help_callback (menu_help_message, | 3416 | help_callback (menu_help_message, |
| 3402 | menu_help_paneno, menu_help_itemno); | 3417 | menu_help_paneno, menu_help_itemno); |
| 3418 | /* Move the cursor to the beginning of the current menu | ||
| 3419 | item, so that screen readers and other accessibility aids | ||
| 3420 | know where the active region is. */ | ||
| 3421 | if (0 <= row) | ||
| 3422 | cursor_to (sf, row, col); | ||
| 3403 | tty_hide_cursor (tty); | 3423 | tty_hide_cursor (tty); |
| 3404 | fflush (tty->output); | 3424 | fflush (tty->output); |
| 3405 | prev_menu_help_message = menu_help_message; | 3425 | prev_menu_help_message = menu_help_message; |