From 6509f7727e1077ab60e24c3f077ff06c3cadb2d5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 30 Sep 2013 19:25:08 +0300 Subject: [PATCH] Fix message-box and avoid compilation warnings. --- src/editfns.c | 25 ++++++++++--------------- src/frame.h | 3 --- src/window.c | 4 ++++ 3 files changed, 14 insertions(+), 18 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index 84a5c8395fc..e6e63c205b9 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3469,22 +3469,17 @@ usage: (message-box FORMAT-STRING &rest ARGS) */) { Lisp_Object val = Fformat (nargs, args); #ifdef HAVE_MENUS - /* The MS-DOS frames support popup menus even though they are - not FRAME_WINDOW_P. */ - if (FRAME_WINDOW_P (XFRAME (selected_frame)) - || FRAME_MSDOS_P (XFRAME (selected_frame))) - { - Lisp_Object pane, menu; - struct gcpro gcpro1; - pane = list1 (Fcons (build_string ("OK"), Qt)); - GCPRO1 (pane); - menu = Fcons (val, pane); - Fx_popup_dialog (Qt, menu, Qt); - UNGCPRO; - return val; - } -#endif /* HAVE_MENUS */ + Lisp_Object pane, menu; + struct gcpro gcpro1; + + pane = list1 (Fcons (build_string ("OK"), Qt)); + GCPRO1 (pane); + menu = Fcons (val, pane); + Fx_popup_dialog (Qt, menu, Qt); + UNGCPRO; +#else /* !HAVE_MENUS */ message3 (val); +#endif return val; } } diff --git a/src/frame.h b/src/frame.h index 09e4112d3a2..f06b44e836b 100644 --- a/src/frame.h +++ b/src/frame.h @@ -1250,9 +1250,6 @@ extern void x_set_tool_bar_lines (struct frame *f, Lisp_Object oldval); extern void x_activate_menubar (struct frame *); extern void x_real_positions (struct frame *, int *, int *); -extern void x_set_menu_bar_lines (struct frame *, - Lisp_Object, - Lisp_Object); extern void free_frame_menubar (struct frame *); extern void x_free_frame_resources (struct frame *); diff --git a/src/window.c b/src/window.c index 670369cd322..5103f87a27c 100644 --- a/src/window.c +++ b/src/window.c @@ -5540,10 +5540,12 @@ the return value is nil. Otherwise the value is t. */) if (data->frame_menu_bar_lines != previous_frame_menu_bar_lines) { +#ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f)) x_set_menu_bar_lines (f, make_number (data->frame_menu_bar_lines), make_number (0)); else /* TTY or MSDOS */ +#endif set_menu_bar_lines (f, make_number (data->frame_menu_bar_lines), make_number (0)); } @@ -5743,11 +5745,13 @@ the return value is nil. Otherwise the value is t. */) #ifdef HAVE_MENUS if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f)) { +#ifdef HAVE_WINDOW_SYSTEM if (FRAME_WINDOW_P (f)) x_set_menu_bar_lines (f, make_number (previous_frame_menu_bar_lines), make_number (0)); else /* TTY or MSDOS */ +#endif set_menu_bar_lines (f, make_number (previous_frame_menu_bar_lines), make_number (0)); } -- 2.39.2