]> code.delx.au - gnu-emacs/blobdiff - src/xmenu.c
* src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extraction
[gnu-emacs] / src / xmenu.c
index 01d932cf8d85452507034a24aaaed76c269659c4..56a3783127eec84a3a4dbd6e6282551bb980c06e 100644 (file)
@@ -1,7 +1,7 @@
 /* X Communication module for terminals which understand the X protocol.
 
-Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2012
-  Free Software Foundation, Inc.
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2013 Free Software
+Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -132,11 +132,8 @@ menubar_id_to_frame (LWLIB_ID id)
   Lisp_Object tail, frame;
   FRAME_PTR f;
 
-  for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
+  FOR_EACH_FRAME (tail, frame)
     {
-      frame = XCAR (tail);
-      if (!FRAMEP (frame))
-        continue;
       f = XFRAME (frame);
       if (!FRAME_WINDOW_P (f))
        continue;
@@ -1414,11 +1411,9 @@ popup_selection_callback (GtkWidget *widget, gpointer client_data)
 static Lisp_Object
 pop_down_menu (Lisp_Object arg)
 {
-  struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
-
   popup_activated_flag = 0;
   block_input ();
-  gtk_widget_destroy (GTK_WIDGET (p->pointer));
+  gtk_widget_destroy (GTK_WIDGET (XSAVE_POINTER (arg, 0)));
   unblock_input ();
   return Qnil;
 }
@@ -1615,11 +1610,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
 static Lisp_Object
 cleanup_widget_value_tree (Lisp_Object arg)
 {
-  struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
-  widget_value *wv = p->pointer;
-
-  free_menubar_widget_value_tree (wv);
-
+  free_menubar_widget_value_tree (XSAVE_POINTER (arg, 0));
   return Qnil;
 }
 
@@ -2245,11 +2236,8 @@ menu_help_callback (char const *help_string, int pane, int item)
 static Lisp_Object
 pop_down_menu (Lisp_Object arg)
 {
-  struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg));
-  struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg));
-
-  FRAME_PTR f = p1->pointer;
-  XMenu *menu = p2->pointer;
+  FRAME_PTR f = XSAVE_POINTER (Fcar (arg), 0);
+  XMenu *menu = XSAVE_POINTER (Fcdr (arg), 0);
 
   block_input ();
 #ifndef MSDOS