Merge from emacs-23; up to 2010-06-03T05:41:49Z!rgm@gnu.org.
[bpt/emacs.git] / src / menu.c
index a90c712..851f1ac 100644 (file)
@@ -1,6 +1,7 @@
 /* Platform-independent code for terminal communications.
-   Copyright (C) 1986, 1988, 1993, 1994, 1996, 1999, 2000, 2001, 2002, 2003,
-                 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2011
+  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -61,12 +62,6 @@ extern HMENU current_popup_menu;
 #define HAVE_BOXES 1
 #endif
 
-/* The timestamp of the last input event Emacs received from the X server.  */
-/* Defined in keyboard.c.  */
-extern unsigned long last_event_timestamp;
-
-extern Lisp_Object QCtoggle, QCradio;
-
 Lisp_Object menu_items;
 
 /* If non-nil, means that the global vars defined here are already in use.
@@ -133,12 +128,14 @@ discard_menu_items (void)
   xassert (NILP (menu_items_inuse));
 }
 
+#ifdef HAVE_NS
 static Lisp_Object
 cleanup_popup_menu (Lisp_Object arg)
 {
   discard_menu_items ();
   return Qnil;
 }
+#endif
 
 /* This undoes save_menu_items, and it is called by the specpdl unwind
    mechanism.  */
@@ -666,7 +663,7 @@ digest_single_submenu (int start, int end, int top_level_items)
        {
          /* Create a new pane.  */
          Lisp_Object pane_name, prefix;
-         char *pane_string;
+         const char *pane_string;
 
          panes_seen++;
 
@@ -699,7 +696,7 @@ digest_single_submenu (int start, int end, int top_level_items)
 #endif
 
          pane_string = (NILP (pane_name)
-                        ? "" : (char *) SDATA (pane_name));
+                        ? "" : SSDATA (pane_name));
          /* If there is just one top-level pane, put all its items directly
             under the top-level menu.  */
          if (menu_items_n_panes == 1)
@@ -851,7 +848,7 @@ update_submenu_strings (widget_value *first_wv)
     {
       if (STRINGP (wv->lname))
         {
-          wv->name = (char *) SDATA (wv->lname);
+          wv->name = SSDATA (wv->lname);
 
           /* Ignore the @ that means "separate pane".
              This is a kludge, but this isn't worth more time.  */
@@ -864,7 +861,7 @@ update_submenu_strings (widget_value *first_wv)
         }
 
       if (STRINGP (wv->lkey))
-        wv->key = (char *) SDATA (wv->lkey);
+        wv->key = SSDATA (wv->lkey);
 
       if (wv->contents)
         update_submenu_strings (wv->contents);
@@ -1064,13 +1061,12 @@ keyboard input, then this normally results in a quit and
 `x-popup-menu' does not return.  But if POSITION is a mouse button
 event (indicating that the user invoked the menu with the mouse) then
 no quit occurs and `x-popup-menu' returns nil.  */)
-  (position, menu)
-     Lisp_Object position, menu;
+  (Lisp_Object position, Lisp_Object menu)
 {
   Lisp_Object keymap, tem;
   int xpos = 0, ypos = 0;
   Lisp_Object title;
-  char *error_name = NULL;
+  const char *error_name = NULL;
   Lisp_Object selection = Qnil;
   FRAME_PTR f = NULL;
   Lisp_Object x, y, window;
@@ -1358,6 +1354,3 @@ syms_of_menu (void)
 
   defsubr (&Sx_popup_menu);
 }
-
-/* arch-tag: 78bbc7cf-8025-4156-aa8a-6c7fd99bf51d
-   (do not change this comment) */