From: Eli Zaretskii Date: Mon, 30 Sep 2013 16:25:08 +0000 (+0300) Subject: Fix message-box and avoid compilation warnings. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1328^2~18 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6509f7727e1077ab60e24c3f077ff06c3cadb2d5;p=emacs.git Fix message-box and avoid compilation warnings. --- 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)); }