diff options
| author | Eli Zaretskii | 2016-03-24 20:05:49 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2016-03-24 20:05:49 +0200 |
| commit | 20a1003f6de52d574ea12e72ac5070a3d5e181ab (patch) | |
| tree | 133ab3aa46946ea216257441a57dfa1bb2a1014b /src | |
| parent | 7eba90c12227d86636aaa3da8d68b0c213fb3910 (diff) | |
| download | emacs-20a1003f6de52d574ea12e72ac5070a3d5e181ab.tar.gz emacs-20a1003f6de52d574ea12e72ac5070a3d5e181ab.zip | |
Preserve current buffer when popping up TTY menus
* src/term.c (tty_menu_show): Be sure to save and restore the
current buffer around TTY menu pop-ups. (Bug#23101)
Diffstat (limited to 'src')
| -rw-r--r-- | src/term.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/term.c b/src/term.c index 17f36795998..a77e5729b5b 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -3402,9 +3402,11 @@ static void | |||
| 3402 | tty_pop_down_menu (Lisp_Object arg) | 3402 | tty_pop_down_menu (Lisp_Object arg) |
| 3403 | { | 3403 | { |
| 3404 | tty_menu *menu = XSAVE_POINTER (arg, 0); | 3404 | tty_menu *menu = XSAVE_POINTER (arg, 0); |
| 3405 | struct buffer *orig_buffer = XSAVE_POINTER (arg, 1); | ||
| 3405 | 3406 | ||
| 3406 | block_input (); | 3407 | block_input (); |
| 3407 | tty_menu_destroy (menu); | 3408 | tty_menu_destroy (menu); |
| 3409 | set_buffer_internal (orig_buffer); | ||
| 3408 | unblock_input (); | 3410 | unblock_input (); |
| 3409 | } | 3411 | } |
| 3410 | 3412 | ||
| @@ -3683,7 +3685,10 @@ tty_menu_show (struct frame *f, int x, int y, int menuflags, | |||
| 3683 | 3685 | ||
| 3684 | pane = selidx = 0; | 3686 | pane = selidx = 0; |
| 3685 | 3687 | ||
| 3686 | record_unwind_protect (tty_pop_down_menu, make_save_ptr (menu)); | 3688 | /* We save and restore the current buffer because tty_menu_activate |
| 3689 | triggers redisplay, which switches buffers at will. */ | ||
| 3690 | record_unwind_protect (tty_pop_down_menu, | ||
| 3691 | make_save_ptr_ptr (menu, current_buffer)); | ||
| 3687 | 3692 | ||
| 3688 | specbind (Qoverriding_terminal_local_map, | 3693 | specbind (Qoverriding_terminal_local_map, |
| 3689 | Fsymbol_value (Qtty_menu_navigation_map)); | 3694 | Fsymbol_value (Qtty_menu_navigation_map)); |