HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix obscure porting bug with varargs functions.
[bpt/emacs.git]
/
src
/
xmenu.c
diff --git
a/src/xmenu.c
b/src/xmenu.c
index
958cd22
..
6c0e3dd
100644
(file)
--- a/
src/xmenu.c
+++ b/
src/xmenu.c
@@
-223,8
+223,6
@@
for instance using the window manager, then this produces a quit and
FRAME_PTR f = NULL;
Lisp_Object window;
FRAME_PTR f = NULL;
Lisp_Object window;
- check_x ();
-
/* Decode the first argument: find the window or frame to use. */
if (EQ (position, Qt)
|| (CONSP (position) && (EQ (XCAR (position), Qmenu_bar)
/* Decode the first argument: find the window or frame to use. */
if (EQ (position, Qt)
|| (CONSP (position) && (EQ (XCAR (position), Qmenu_bar)
@@
-277,8
+275,7
@@
for instance using the window manager, then this produces a quit and
but I don't want to make one now. */
CHECK_WINDOW (window);
but I don't want to make one now. */
CHECK_WINDOW (window);
- if (! FRAME_X_P (f) && ! FRAME_MSDOS_P (f))
- error ("Can not put X dialog on this terminal");
+ check_window_system (f);
/* Force a redisplay before showing the dialog. If a frame is created
just before showing the dialog, its contents may not have been fully
/* Force a redisplay before showing the dialog. If a frame is created
just before showing the dialog, its contents may not have been fully
@@
-299,10
+296,10
@@
for instance using the window manager, then this produces a quit and
XSETFRAME (frame, f);
XSETINT (x, x_pixel_width (f) / 2);
XSETINT (y, x_pixel_height (f) / 2);
XSETFRAME (frame, f);
XSETINT (x, x_pixel_width (f) / 2);
XSETINT (y, x_pixel_height (f) / 2);
- newpos =
Fcons (Fcons (x, Fcons (y, Qnil)), Fcons (frame, Qnil)
);
+ newpos =
list2 (list2 (x, y), frame
);
return Fx_popup_menu (newpos,
return Fx_popup_menu (newpos,
-
Fcons (Fcar (contents), Fcons (contents, Qnil)
));
+
list2 (Fcar (contents), contents
));
}
#else
{
}
#else
{
@@
-314,15
+311,15
@@
for instance using the window manager, then this produces a quit and
/* Decode the dialog items from what was specified. */
title = Fcar (contents);
CHECK_STRING (title);
/* Decode the dialog items from what was specified. */
title = Fcar (contents);
CHECK_STRING (title);
- record_unwind_protect
(unuse_menu_items, Qnil
);
+ record_unwind_protect
_void (unuse_menu_items
);
if (NILP (Fcar (Fcdr (contents))))
/* No buttons specified, add an "Ok" button so users can pop down
the dialog. Also, the lesstif/motif version crashes if there are
no buttons. */
if (NILP (Fcar (Fcdr (contents))))
/* No buttons specified, add an "Ok" button so users can pop down
the dialog. Also, the lesstif/motif version crashes if there are
no buttons. */
- contents =
Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil
));
+ contents =
list2 (title, Fcons (build_string ("Ok"), Qt
));
- list_of_panes (
Fcons (contents, Qnil
));
+ list_of_panes (
list1 (contents
));
/* Display them in a dialog box. */
block_input ();
/* Display them in a dialog box. */
block_input ();
@@
-400,7
+397,7
@@
x_menu_wait_for_event (void *data)
else
ntp = &next_time;
else
ntp = &next_time;
-#if
def
HAVE_GTK3
+#if
defined USE_GTK && defined
HAVE_GTK3
/* Gtk3 have arrows on menus when they don't fit. When the
pointer is over an arrow, a timeout scrolls it a bit. Use
xg_select so that timeout gets triggered. */
/* Gtk3 have arrows on menus when they don't fit. When the
pointer is over an arrow, a timeout scrolls it a bit. Use
xg_select so that timeout gets triggered. */
@@
-485,7
+482,7
@@
If FRAME is nil or not given, use the selected frame. */)
(Lisp_Object frame)
{
XEvent ev;
(Lisp_Object frame)
{
XEvent ev;
- FRAME_PTR f =
check_x
_frame (frame);
+ FRAME_PTR f =
decode_window_system
_frame (frame);
Widget menubar;
block_input ();
Widget menubar;
block_input ();
@@
-569,7
+566,7
@@
If FRAME is nil or not given, use the selected frame. */)
block_input (). */
block_input ();
block_input (). */
block_input ();
- f =
check_x
_frame (frame);
+ f =
decode_window_system
_frame (frame);
if (FRAME_EXTERNAL_MENU_BAR (f))
set_frame_menubar (f, 0, 1);
if (FRAME_EXTERNAL_MENU_BAR (f))
set_frame_menubar (f, 0, 1);
@@
-976,7
+973,7
@@
set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
if (! menubar_widget)
previous_menu_items_used = 0;
if (! menubar_widget)
previous_menu_items_used = 0;
- buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->
buffer
;
+ buffer = XWINDOW (FRAME_SELECTED_WINDOW (f))->
contents
;
specbind (Qinhibit_quit, Qt);
/* Don't let the debugger step into this code
because it is not reentrant. */
specbind (Qinhibit_quit, Qt);
/* Don't let the debugger step into this code
because it is not reentrant. */
@@
-1055,7
+1052,7
@@
set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
wv->help = Qnil;
first_wv = wv;
wv->help = Qnil;
first_wv = wv;
- for (i = 0;
0 <= submenu_start[i]
; i++)
+ for (i = 0;
submenu_start[i] >= 0
; i++)
{
menu_items_n_panes = submenu_n_panes[i];
wv = digest_single_submenu (submenu_start[i], submenu_end[i],
{
menu_items_n_panes = submenu_n_panes[i];
wv = digest_single_submenu (submenu_start[i], submenu_end[i],
@@
-1408,14
+1405,13
@@
popup_selection_callback (GtkWidget *widget, gpointer client_data)
if (cb_data) menu_item_selection = (Lisp_Object *) cb_data->call_data;
}
if (cb_data) menu_item_selection = (Lisp_Object *) cb_data->call_data;
}
-static
Lisp_Object
-pop_down_menu (
Lisp_Object
arg)
+static
void
+pop_down_menu (
void *
arg)
{
popup_activated_flag = 0;
block_input ();
{
popup_activated_flag = 0;
block_input ();
- gtk_widget_destroy (GTK_WIDGET (
XSAVE_POINTER (arg, 0)
));
+ gtk_widget_destroy (GTK_WIDGET (
arg
));
unblock_input ();
unblock_input ();
- return Qnil;
}
/* Pop up the menu for frame F defined by FIRST_WV at X/Y and loop until the
}
/* Pop up the menu for frame F defined by FIRST_WV at X/Y and loop until the
@@
-1477,7
+1473,7
@@
create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, int x, int y,
gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i,
timestamp ? timestamp : gtk_get_current_event_time ());
gtk_menu_popup (GTK_MENU (menu), 0, 0, pos_func, &popup_x_y, i,
timestamp ? timestamp : gtk_get_current_event_time ());
- record_unwind_protect
(pop_down_menu, make_save_pointer (menu)
);
+ record_unwind_protect
_ptr (pop_down_menu, menu
);
if (gtk_widget_get_mapped (menu))
{
if (gtk_widget_get_mapped (menu))
{
@@
-1516,7
+1512,7
@@
popup_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
/* ARG is the LWLIB ID of the dialog box, represented
as a Lisp object as (HIGHPART . LOWPART). */
/* ARG is the LWLIB ID of the dialog box, represented
as a Lisp object as (HIGHPART . LOWPART). */
-static
Lisp_Object
+static
void
pop_down_menu (Lisp_Object arg)
{
LWLIB_ID id = (XINT (XCAR (arg)) << 4 * sizeof (LWLIB_ID)
pop_down_menu (Lisp_Object arg)
{
LWLIB_ID id = (XINT (XCAR (arg)) << 4 * sizeof (LWLIB_ID)
@@
-1526,8
+1522,6
@@
pop_down_menu (Lisp_Object arg)
lw_destroy_all_widgets (id);
unblock_input ();
popup_activated_flag = 0;
lw_destroy_all_widgets (id);
unblock_input ();
popup_activated_flag = 0;
-
- return Qnil;
}
/* Pop up the menu for frame F defined by FIRST_WV at X/Y and loop until the
}
/* Pop up the menu for frame F defined by FIRST_WV at X/Y and loop until the
@@
-1607,11
+1601,10
@@
create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
#endif /* not USE_GTK */
#endif /* not USE_GTK */
-static
Lisp_Object
-cleanup_widget_value_tree (
Lisp_Object
arg)
+static
void
+cleanup_widget_value_tree (
void *
arg)
{
{
- free_menubar_widget_value_tree (XSAVE_POINTER (arg, 0));
- return Qnil;
+ free_menubar_widget_value_tree (arg);
}
Lisp_Object
}
Lisp_Object
@@
-1825,8
+1818,7
@@
xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
/* Make sure to free the widget_value objects we used to specify the
contents even with longjmp. */
/* Make sure to free the widget_value objects we used to specify the
contents even with longjmp. */
- record_unwind_protect (cleanup_widget_value_tree,
- make_save_pointer (first_wv));
+ record_unwind_protect_ptr (cleanup_widget_value_tree, first_wv);
/* Actually create and show the menu until popped down. */
create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp);
/* Actually create and show the menu until popped down. */
create_and_show_popup_menu (f, first_wv, x, y, for_click, timestamp);
@@
-1874,7
+1866,7
@@
xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
{
int j;
{
int j;
- entry =
Fcons (entry, Qnil
);
+ entry =
list1 (entry
);
if (!NILP (prefix))
entry = Fcons (prefix, entry);
for (j = submenu_depth - 1; j >= 0; j--)
if (!NILP (prefix))
entry = Fcons (prefix, entry);
for (j = submenu_depth - 1; j >= 0; j--)
@@
-1925,7
+1917,7
@@
create_and_show_dialog (FRAME_PTR f, widget_value *first_wv)
if (menu)
{
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
if (menu)
{
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
- record_unwind_protect
(pop_down_menu, make_save_pointer (menu)
);
+ record_unwind_protect
_ptr (pop_down_menu, menu
);
/* Display the menu. */
gtk_widget_show_all (menu);
/* Display the menu. */
gtk_widget_show_all (menu);
@@
-2135,8
+2127,7
@@
xdialog_show (FRAME_PTR f,
/* Make sure to free the widget_value objects we used to specify the
contents even with longjmp. */
/* Make sure to free the widget_value objects we used to specify the
contents even with longjmp. */
- record_unwind_protect (cleanup_widget_value_tree,
- make_save_pointer (first_wv));
+ record_unwind_protect_ptr (cleanup_widget_value_tree, first_wv);
/* Actually create and show the dialog. */
create_and_show_dialog (f, first_wv);
/* Actually create and show the dialog. */
create_and_show_dialog (f, first_wv);
@@
-2175,7
+2166,7
@@
xdialog_show (FRAME_PTR f,
{
if (keymaps != 0)
{
{
if (keymaps != 0)
{
- entry =
Fcons (entry, Qnil
);
+ entry =
list1 (entry
);
if (!NILP (prefix))
entry = Fcons (prefix, entry);
}
if (!NILP (prefix))
entry = Fcons (prefix, entry);
}
@@
-2226,14
+2217,12
@@
menu_help_callback (char const *help_string, int pane, int item)
pane_name = first_item[MENU_ITEMS_ITEM_NAME];
/* (menu-item MENU-NAME PANE-NUMBER) */
pane_name = first_item[MENU_ITEMS_ITEM_NAME];
/* (menu-item MENU-NAME PANE-NUMBER) */
- menu_object = Fcons (Qmenu_item,
- Fcons (pane_name,
- Fcons (make_number (pane), Qnil)));
+ menu_object = list3 (Qmenu_item, pane_name, make_number (pane));
show_help_echo (help_string ? build_string (help_string) : Qnil,
Qnil, menu_object, make_number (item));
}
show_help_echo (help_string ? build_string (help_string) : Qnil,
Qnil, menu_object, make_number (item));
}
-static
Lisp_Object
+static
void
pop_down_menu (Lisp_Object arg)
{
FRAME_PTR f = XSAVE_POINTER (arg, 0);
pop_down_menu (Lisp_Object arg)
{
FRAME_PTR f = XSAVE_POINTER (arg, 0);
@@
-2260,8
+2249,6
@@
pop_down_menu (Lisp_Object arg)
#endif /* HAVE_X_WINDOWS */
unblock_input ();
#endif /* HAVE_X_WINDOWS */
unblock_input ();
-
- return Qnil;
}
}
@@
-2478,8
+2465,7
@@
xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
XMenuActivateSetWaitFunction (x_menu_wait_for_event, FRAME_X_DISPLAY (f));
#endif
XMenuActivateSetWaitFunction (x_menu_wait_for_event, FRAME_X_DISPLAY (f));
#endif
- record_unwind_protect (pop_down_menu,
- make_save_value ("pp", f, menu));
+ record_unwind_protect (pop_down_menu, make_save_ptr_ptr (f, menu));
/* Help display under X won't work because XMenuActivate contains
a loop that doesn't give Emacs a chance to process it. */
/* Help display under X won't work because XMenuActivate contains
a loop that doesn't give Emacs a chance to process it. */
@@
-2518,7
+2504,7
@@
xmenu_show (FRAME_PTR f, int x, int y, bool for_click, bool keymaps,
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
if (keymaps)
{
= AREF (menu_items, i + MENU_ITEMS_ITEM_VALUE);
if (keymaps)
{
- entry =
Fcons (entry, Qnil
);
+ entry =
list1 (entry
);
if (!NILP (pane_prefix))
entry = Fcons (pane_prefix, entry);
}
if (!NILP (pane_prefix))
entry = Fcons (pane_prefix, entry);
}