aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2000-07-10 13:46:32 +0000
committerEli Zaretskii2000-07-10 13:46:32 +0000
commit4314cf3ec947ecef90ae5ab20539b6cdb564c621 (patch)
tree3ab1f41e4c75b0989c2ff0a030625e5b863e69fa /src
parente82a2a05d63ce9809cb9d162637ab8e67fff7262 (diff)
downloademacs-4314cf3ec947ecef90ae5ab20539b6cdb564c621.tar.gz
emacs-4314cf3ec947ecef90ae5ab20539b6cdb564c621.zip
(XMenuActivate): After exiting the menu, restore the
echo area message and erase it.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/msdos.c26
2 files changed, 31 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4f415dde840..a367bc6d8ee 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12000-07-10 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * msdos.c (XMenuActivate): After exiting the menu, restore the
4 echo area message and erase it.
5
12000-07-10 Kenichi Handa <handa@etl.go.jp> 62000-07-10 Kenichi Handa <handa@etl.go.jp>
2 7
3 * fontset.c (Ffontset_info): Make the return value more compatible 8 * fontset.c (Ffontset_info): Make the return value more compatible
diff --git a/src/msdos.c b/src/msdos.c
index c34edf62009..b4b62cae34c 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -3626,6 +3626,7 @@ XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx,
3626 int title_faces[4]; /* face to display the menu title */ 3626 int title_faces[4]; /* face to display the menu title */
3627 int buffers_num_deleted = 0; 3627 int buffers_num_deleted = 0;
3628 struct frame *sf = SELECTED_FRAME(); 3628 struct frame *sf = SELECTED_FRAME();
3629 Lisp_Object saved_echo_area_message;
3629 3630
3630 /* Just in case we got here without a mouse present... */ 3631 /* Just in case we got here without a mouse present... */
3631 if (have_mouse <= 0) 3632 if (have_mouse <= 0)
@@ -3673,6 +3674,11 @@ XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx,
3673 menu->text[0][7] = '\0'; 3674 menu->text[0][7] = '\0';
3674 buffers_num_deleted = 1; 3675 buffers_num_deleted = 1;
3675 } 3676 }
3677
3678 /* We need to save the current echo area message, so that we could
3679 restore it below, before we exit. See the commentary below,
3680 before the call to message_with_string. */
3681 saved_echo_area_message = Fcurrent_message ();
3676 state[0].menu = menu; 3682 state[0].menu = menu;
3677 mouse_off (); 3683 mouse_off ();
3678 ScreenRetrieve (state[0].screen_behind = xmalloc (screensize)); 3684 ScreenRetrieve (state[0].screen_behind = xmalloc (screensize));
@@ -3791,6 +3797,26 @@ XMenuActivate (Display *foo, XMenu *menu, int *pane, int *selidx,
3791 ScreenUpdate (state[0].screen_behind); 3797 ScreenUpdate (state[0].screen_behind);
3792 if (screen_virtual_segment) 3798 if (screen_virtual_segment)
3793 dosv_refresh_virtual_screen (0, screen_size); 3799 dosv_refresh_virtual_screen (0, screen_size);
3800
3801 /* We have a situation here. ScreenUpdate has just restored the
3802 screen contents as it was before we started drawing this menu.
3803 That includes any echo area message that could have been
3804 displayed back then. (In reality, that echo area message will
3805 almost always be the ``keystroke echo'' that echoes the sequence
3806 of menu items chosen by the user.) However, if the menu had some
3807 help messages, then displaying those messages caused Emacs to
3808 forget about the original echo area message. So when
3809 ScreenUpdate restored it, it created a discrepancy between the
3810 actual screen contents and what Emacs internal data structures
3811 know about it.
3812
3813 To avoid this conflict, we force Emacs to restore the original
3814 echo area message as we found it when we entered this function.
3815 The irony of this is that we then erase the restored message
3816 right away, so the only purpose of restoring it is so that
3817 erasing it works correctly... */
3818 if (! NILP (saved_echo_area_message))
3819 message_with_string ("%s", saved_echo_area_message, 0);
3794 message (0); 3820 message (0);
3795 while (statecount--) 3821 while (statecount--)
3796 xfree (state[statecount].screen_behind); 3822 xfree (state[statecount].screen_behind);