* configure.ac (HAVE_MENUS): Remove.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 29 Nov 2013 01:22:40 +0000 (20:22 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 29 Nov 2013 01:22:40 +0000 (20:22 -0500)
* src/xmenu.c (Fmenu_or_popup_active_p):
* src/window.c (Fset_window_configuration):
* src/menu.c (Fx_popup_menu, Fx_popup_dialog):
* src/keyboard.c (record_menu_key, read_char_x_menu_prompt):
* src/fns.c (Fyes_or_no_p):
* src/editfns.c (Fmessage_box, Fmessage_or_box):
* src/alloc.c (make_save_ptr_ptr):
* src/xdisp.c, src/w32menu.c, src/term.c, src/xterm.h, src/xterm.c:
Remove HAVE_MENUS.

16 files changed:
ChangeLog
configure.ac
nt/inc/ms-w32.h
src/ChangeLog
src/alloc.c
src/editfns.c
src/fns.c
src/keyboard.c
src/menu.c
src/term.c
src/w32menu.c
src/window.c
src/xdisp.c
src/xmenu.c
src/xterm.c
src/xterm.h

index 184f0e1..8c2f85c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-11-29  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * configure.ac (HAVE_MENUS): Remove.
+
 2013-11-28  Glenn Morris  <rgm@gnu.org>
 
        * configure.ac (PATH_SEP): Replace with pre-existing SEPCHAR.
index fe1a280..0d07d56 100644 (file)
@@ -1866,9 +1866,6 @@ to configure.])
    fi
 fi
 
-### We always support menus.
-HAVE_MENUS=yes
-
 # Does the opsystem file prohibit the use of the GNU malloc?
 # Assume not, until told otherwise.
 GNU_MALLOC=yes
@@ -4620,8 +4617,7 @@ else
 fi
 AC_SUBST(LIBX_OTHER)
 
-if test "$HAVE_GTK" = yes ||
-   test "$HAVE_MENUS" != yes || test "$HAVE_X11" != yes; then
+if test "$HAVE_GTK" = yes || test "$HAVE_X11" != yes; then
   LIBXMENU=
 elif test "$USE_X_TOOLKIT" = none; then
   LIBXMENU='$(oldXMenudir)/libXMenu11.a'
@@ -4630,11 +4626,6 @@ else
 fi
 AC_SUBST(LIBXMENU)
 
-if test "${HAVE_MENUS}" = "yes" ; then
-  AC_DEFINE(HAVE_MENUS, 1,
-           [Define to 1 if you have mouse menus.  (This is supported in all configurations, but the option to specify it remains.)])
-fi
-
 if test "${GNU_MALLOC}" = "yes" ; then
   AC_DEFINE(GNU_MALLOC, 1,
            [Define to 1 if you want to use the GNU memory allocator.])
index e27ae4d..cd6ec17 100644 (file)
@@ -156,9 +156,6 @@ extern char *getenv ();
 # ifndef HAVE_WINDOW_SYSTEM
 #  define HAVE_WINDOW_SYSTEM 1
 # endif
-# ifndef HAVE_MENUS
-#  define HAVE_MENUS 1
-# endif
 #endif
 
 /* Get some redefinitions in place.  */
@@ -176,7 +173,7 @@ extern char *getenv ();
 extern struct tm * sys_localtime (const time_t *);
 /* MinGW64 uses a 2-argument _setjmp, and setjmp is a macro defined to
    supply the 2nd arg correctly, so don't use _setjmp directly in that
-   case. */
+   case.  */
 #undef HAVE__SETJMP
 #endif
 
index 3231f5b..134e082 100644 (file)
@@ -1,5 +1,14 @@
 2013-11-29  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * xmenu.c (Fmenu_or_popup_active_p):
+       * window.c (Fset_window_configuration):
+       * menu.c (Fx_popup_menu, Fx_popup_dialog):
+       * keyboard.c (record_menu_key, read_char_x_menu_prompt):
+       * fns.c (Fyes_or_no_p):
+       * editfns.c (Fmessage_box, Fmessage_or_box):
+       * alloc.c (make_save_ptr_ptr):
+       * xdisp.c, w32menu.c, term.c, xterm.h, xterm.c: Remove HAVE_MENUS.
+
        * window.c (Fset_window_configuration): Move select_window later.
 
 2013-11-28  Stefan Monnier  <monnier@iro.umontreal.ca>
index 2f49de3..7024b47 100644 (file)
@@ -3477,7 +3477,7 @@ make_save_ptr_int (void *a, ptrdiff_t b)
   return val;
 }
 
-#if defined HAVE_MENUS && ! (defined USE_X_TOOLKIT || defined USE_GTK)
+#if ! (defined USE_X_TOOLKIT || defined USE_GTK)
 Lisp_Object
 make_save_ptr_ptr (void *a, void *b)
 {
index c5267d1..8e47d1f 100644 (file)
@@ -3473,7 +3473,6 @@ usage: (message-box FORMAT-STRING &rest ARGS)  */)
   else
     {
       Lisp_Object val = Fformat (nargs, args);
-#ifdef HAVE_MENUS
       Lisp_Object pane, menu;
       struct gcpro gcpro1;
 
@@ -3482,9 +3481,6 @@ usage: (message-box FORMAT-STRING &rest ARGS)  */)
       menu = Fcons (val, pane);
       Fx_popup_dialog (Qt, menu, Qt);
       UNGCPRO;
-#else /* !HAVE_MENUS */
-      message3 (val);
-#endif
       return val;
     }
 }
@@ -3503,11 +3499,9 @@ message; let the minibuffer contents show.
 usage: (message-or-box FORMAT-STRING &rest ARGS)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
-#ifdef HAVE_MENUS
   if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
       && use_dialog_box)
     return Fmessage_box (nargs, args);
-#endif
   return Fmessage (nargs, args);
 }
 
index 93829fb..4c3bde1 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -35,11 +35,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "frame.h"
 #include "window.h"
 #include "blockinput.h"
-#ifdef HAVE_MENUS
 #if defined (HAVE_X_WINDOWS)
 #include "xterm.h"
 #endif
-#endif /* HAVE_MENUS */
 
 Lisp_Object Qstring_lessp;
 static Lisp_Object Qprovide, Qrequire;
@@ -2416,7 +2414,6 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil.  */)
 
   CHECK_STRING (prompt);
 
-#ifdef HAVE_MENUS
   if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
       && use_dialog_box)
     {
@@ -2430,7 +2427,6 @@ if `last-nonmenu-event' is nil, and `use-dialog-box' is non-nil.  */)
       UNGCPRO;
       return obj;
     }
-#endif /* HAVE_MENUS */
 
   args[0] = prompt;
   args[1] = build_string ("(yes or no) ");
index be863ad..2e16a87 100644 (file)
@@ -3222,8 +3222,6 @@ read_char (int commandflag, Lisp_Object map,
   RETURN_UNGCPRO (c);
 }
 
-#ifdef HAVE_MENUS
-
 /* Record a key that came from a mouse menu.
    Record it for echoing, for this-command-keys, and so on.  */
 
@@ -3254,13 +3252,11 @@ record_menu_key (Lisp_Object c)
   /* Record this character as part of the current key.  */
   add_command_key (c);
 
-  /* Re-reading in the middle of a command */
+  /* Re-reading in the middle of a command */
   last_input_event = c;
   num_input_events++;
 }
 
-#endif /* HAVE_MENUS */
-
 /* Return true if should recognize C as "the help character".  */
 
 static bool
@@ -8359,7 +8355,6 @@ read_char_x_menu_prompt (Lisp_Object map,
   if (! menu_prompting)
     return Qnil;
 
-#ifdef HAVE_MENUS
   /* If we got to this point via a mouse click,
      use a real menu for mouse selection.  */
   if (EVENT_HAS_PARAMETERS (prev_event)
@@ -8405,7 +8400,6 @@ read_char_x_menu_prompt (Lisp_Object map,
        *used_mouse_menu = 1;
       return value;
     }
-#endif /* HAVE_MENUS */
   return Qnil ;
 }
 
index 96b8f73..9ef3b88 100644 (file)
@@ -1178,7 +1178,6 @@ no quit occurs and `x-popup-menu' returns nil.  */)
        keybinding equivalents, but we don't do that any more anyway.  */
     return Qnil;
 
-#ifdef HAVE_MENUS
   {
     bool get_current_pos_p = 0;
 
@@ -1315,7 +1314,6 @@ no quit occurs and `x-popup-menu' returns nil.  */)
 
     XSETFRAME (Vmenu_updating_frame, f);
   }
-#endif /* HAVE_MENUS */
 
   /* Now parse the lisp menus.  */
   record_unwind_protect_void (unuse_menu_items);
@@ -1398,7 +1396,6 @@ no quit occurs and `x-popup-menu' returns nil.  */)
 
   unbind_to (specpdl_count, Qnil);
 
-#ifdef HAVE_MENUS
 #ifdef HAVE_WINDOW_SYSTEM
   /* Hide a previous tip, if any.  */
   if (!FRAME_TERMCAP_P (f))
@@ -1460,16 +1457,12 @@ no quit occurs and `x-popup-menu' returns nil.  */)
     FRAME_DISPLAY_INFO (f)->grabbed = 0;
 #endif
 
-#endif /* HAVE_MENUS */
-
   UNGCPRO;
 
   if (error_name) error ("%s", error_name);
   return selection;
 }
 
-#ifdef HAVE_MENUS
-
 DEFUN ("x-popup-dialog", Fx_popup_dialog, Sx_popup_dialog, 2, 3, 0,
        doc: /* Pop up a dialog box and return user's selection.
 POSITION specifies which frame to use.
@@ -1605,8 +1598,6 @@ for instance using the window manager, then this produces a quit and
   }
 }
 
-#endif /* HAVE_MENUS */
-
 void
 syms_of_menu (void)
 {
index f86d71a..877d43b 100644 (file)
@@ -2739,7 +2739,7 @@ DEFUN ("gpm-mouse-stop", Fgpm_mouse_stop, Sgpm_mouse_stop,
                               Menus
  ***********************************************************************/
 
-#if defined (HAVE_MENUS) && !defined (MSDOS)
+#if !defined (MSDOS)
 
 /* TTY menu implementation and main ideas are borrowed from msdos.c.
 
@@ -3816,7 +3816,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
   return entry;
 }
 
-#endif /* HAVE_MENUS && !MSDOS */
+#endif /* !MSDOS */
 
 \f
 #ifndef MSDOS
@@ -3825,7 +3825,7 @@ tty_menu_show (struct frame *f, int x, int y, bool for_click, bool keymaps,
  ***********************************************************************/
 
 /* Initialize the tty-dependent part of frame F.  The frame must
-   already have its device initialized. */
+   already have its device initialized.  */
 
 void
 create_tty_output (struct frame *f)
@@ -3839,7 +3839,7 @@ create_tty_output (struct frame *f)
   f->output_data.tty = t;
 }
 
-/* Delete frame F's face cache, and its tty-dependent part. */
+/* Delete frame F's face cache, and its tty-dependent part.  */
 
 static void
 tty_free_frame_resources (struct frame *f)
@@ -3854,7 +3854,7 @@ tty_free_frame_resources (struct frame *f)
 
 #else  /* MSDOS */
 
-/* Delete frame F's face cache. */
+/* Delete frame F's face cache.  */
 
 static void
 tty_free_frame_resources (struct frame *f)
index b256520..b846a3f 100644 (file)
@@ -114,7 +114,6 @@ static int fill_in_menu (HMENU, widget_value *);
 
 void w32_free_menu_strings (HWND);
 
-#ifdef HAVE_MENUS
 #ifdef HAVE_DIALOGS
 Lisp_Object
 w32_popup_dialog (struct frame *f, Lisp_Object header, Lisp_Object contents)
@@ -1602,21 +1601,15 @@ w32_free_menu_strings (HWND hwnd)
   current_popup_menu = NULL;
 }
 
-#endif /* HAVE_MENUS */
-
 /* The following is used by delayed window autoselection.  */
 
 DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_p, 0, 0, 0,
        doc: /* Return t if a menu or popup dialog is active on selected frame.  */)
   (void)
 {
-#ifdef HAVE_MENUS
   struct frame *f;
   f = SELECTED_FRAME ();
   return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
-#else
-  return Qnil;
-#endif /* HAVE_MENUS */
 }
 
 void
index ea2618f..89fcb49 100644 (file)
@@ -5554,7 +5554,6 @@ the return value is nil.  Otherwise the value is t.  */)
          || data->frame_cols != previous_frame_cols)
        change_frame_size (f, data->frame_lines,
                           data->frame_cols, 0, 0, 0);
-#ifdef HAVE_MENUS
       if (data->frame_menu_bar_lines
          != previous_frame_menu_bar_lines)
        {
@@ -5567,7 +5566,6 @@ the return value is nil.  Otherwise the value is t.  */)
            set_menu_bar_lines (f, make_number (data->frame_menu_bar_lines),
                                make_number (0));
        }
-#endif
 #ifdef HAVE_WINDOW_SYSTEM
       if (data->frame_tool_bar_lines
          != previous_frame_tool_bar_lines)
@@ -5752,7 +5750,6 @@ the return value is nil.  Otherwise the value is t.  */)
          || previous_frame_cols != FRAME_COLS (f))
        change_frame_size (f, previous_frame_lines, previous_frame_cols,
                           0, 0, 0);
-#ifdef HAVE_MENUS
       if (previous_frame_menu_bar_lines != FRAME_MENU_BAR_LINES (f))
        {
 #ifdef HAVE_WINDOW_SYSTEM
@@ -5765,7 +5762,6 @@ the return value is nil.  Otherwise the value is t.  */)
            set_menu_bar_lines (f, make_number (previous_frame_menu_bar_lines),
                                make_number (0));
        }
-#endif
 #ifdef HAVE_WINDOW_SYSTEM
       if (previous_frame_tool_bar_lines != FRAME_TOOL_BAR_LINES (f))
        x_set_tool_bar_lines (f, make_number (previous_frame_tool_bar_lines),
@@ -5799,7 +5795,7 @@ the return value is nil.  Otherwise the value is t.  */)
       /* This `select_window' calls record_buffer which calls Fdelq which
         invokes QUIT, so we do it here at the end rather than earlier,
         to minimize the risk of interrupting the Fset_window_configuration
-        in an inconsistent state (e.g. before frame-focus redirection is
+        in an inconsistent state (e.g. before frame-focus redirection is 
         canceled).  */
       select_window (data->current_window, Qnil, 1);
       BVAR (XBUFFER (XWINDOW (selected_window)->contents),
index 3194815..16e6341 100644 (file)
@@ -20603,7 +20603,6 @@ display_menu_bar (struct window *w)
   compute_line_metrics (&it);
 }
 
-#ifdef HAVE_MENUS
 /* Deep copy of a glyph row, including the glyphs.  */
 static void
 deep_copy_glyph_row (struct glyph_row *to, struct glyph_row *from)
@@ -20725,7 +20724,6 @@ display_tty_menu_item (const char *item_text, int width, int face_id,
   row->full_width_p = saved_width;
   row->reversed_p = saved_reversed;
 }
-#endif /* HAVE_MENUS */
 \f
 /***********************************************************************
                              Mode Line
index b2c7fb5..cdc63cb 100644 (file)
@@ -2440,11 +2440,7 @@ DEFUN ("menu-or-popup-active-p", Fmenu_or_popup_active_p, Smenu_or_popup_active_
        doc: /* Return t if a menu or popup dialog is active.  */)
   (void)
 {
-#ifdef HAVE_MENUS
   return (popup_activated ()) ? Qt : Qnil;
-#else
-  return Qnil;
-#endif /* HAVE_MENUS */
 }
 \f
 void
index c0fd954..b4c2b6a 100644 (file)
@@ -3528,7 +3528,7 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
 }
 
 
-#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
+#if !defined USE_X_TOOLKIT && !defined USE_GTK
 /* Handle an event saying the mouse has moved out of an Emacs frame.  */
 
 void
index 753debf..89676e8 100644 (file)
@@ -949,7 +949,7 @@ extern bool x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
 extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
 extern void x_query_color (struct frame *f, XColor *);
 extern void x_clear_area (Display *, Window, int, int, int, int);
-#if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
+#if !defined USE_X_TOOLKIT && !defined USE_GTK
 extern void x_mouse_leave (struct x_display_info *);
 #endif
 
@@ -963,7 +963,7 @@ extern int x_display_pixel_width (struct x_display_info *);
 extern void x_set_sticky (struct frame *, Lisp_Object, Lisp_Object);
 extern void x_wait_for_event (struct frame *, int);
 
-/* Defined in xselect.c */
+/* Defined in xselect.c */
 
 extern void x_handle_property_notify (const XPropertyEvent *);
 extern void x_handle_selection_notify (const XSelectionEvent *);