emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 20a1003: Preserve current buffer when popping up


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-25 20a1003: Preserve current buffer when popping up TTY menus
Date: Thu, 24 Mar 2016 18:07:21 +0000

branch: emacs-25
commit 20a1003f6de52d574ea12e72ac5070a3d5e181ab
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 src/term.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/term.c b/src/term.c
index 17f3679..a77e572 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3402,9 +3402,11 @@ static void
 tty_pop_down_menu (Lisp_Object arg)
 {
   tty_menu *menu = XSAVE_POINTER (arg, 0);
+  struct buffer *orig_buffer = XSAVE_POINTER (arg, 1);
 
   block_input ();
   tty_menu_destroy (menu);
+  set_buffer_internal (orig_buffer);
   unblock_input ();
 }
 
@@ -3683,7 +3685,10 @@ tty_menu_show (struct frame *f, int x, int y, int 
menuflags,
 
   pane = selidx = 0;
 
-  record_unwind_protect (tty_pop_down_menu, make_save_ptr (menu));
+  /* We save and restore the current buffer because tty_menu_activate
+     triggers redisplay, which switches buffers at will.  */
+  record_unwind_protect (tty_pop_down_menu,
+                        make_save_ptr_ptr (menu, current_buffer));
 
   specbind (Qoverriding_terminal_local_map,
            Fsymbol_value (Qtty_menu_navigation_map));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]