Commit 89f2614d authored by Kim F. Storm's avatar Kim F. Storm
Browse files

* composite.c (compose_chars_in_text):

* eval.c (do_autoload):
* macmenu.c (set_frame_menubar):
* process.c (read_process_output, exec_sentinel):
* xmenu.c (set_frame_menubar):
* xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar):
* w32menu.c (set_frame_menubar):
Use record_unwind_save_match_data.
Rename restore_match_data to restore_search_regs.
parent 5fe2b5a5
......@@ -628,7 +628,7 @@ compose_chars_in_text (start, end, string)
}
/* Preserve the match data. */
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
/* If none of ASCII characters have composition functions, we can
skip them quickly. */
......
......@@ -1971,7 +1971,7 @@ do_autoload (fundef, funname)
GCPRO3 (fun, funname, fundef);
/* Preserve the match data. */
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
/* Value saved here is to be restored into Vautoload_queue. */
record_unwind_protect (un_autoload, Vautoload_queue);
......
......@@ -1406,7 +1406,7 @@ install_menu_quit_handler (MenuHandle menu_handle)
EventTypeSpec typesList[] = { { kEventClassKeyboard, kEventRawKeyDown } };
int i = MIN_MENU_ID;
MenuHandle menu = menu_handle ? menu_handle : GetMenuHandle (i);
while (menu != NULL)
{
InstallMenuEventHandler (menu, handler, GetEventTypeCount (typesList),
......@@ -1475,7 +1475,7 @@ set_frame_menubar (f, first_time, deep_p)
because it is not reentrant. */
specbind (Qdebug_on_next_call, Qnil);
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
if (NILP (Voverriding_local_map_menu_flag))
{
specbind (Qoverriding_terminal_local_map, Qnil);
......@@ -1676,7 +1676,7 @@ pop_down_menu (arg)
{
struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg));
struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg));
FRAME_PTR f = p1->pointer;
MenuHandle *menu = p2->pointer;
......@@ -1955,7 +1955,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
/* Add event handler so we can detect C-g. */
install_menu_quit_handler (menu);
/* Display the menu. */
menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0);
menu_item_selection = LoWord (menu_item_choice);
......
......@@ -4887,10 +4887,10 @@ read_process_output (proc, channel)
{
Lisp_Object tem;
/* Don't clobber the CURRENT match data, either! */
tem = Fmatch_data (Qnil, Qnil);
restore_match_data ();
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
Fset_match_data (tem);
tem = Fmatch_data (Qnil, Qnil, Qnil);
restore_search_regs ();
record_unwind_save_match_data ();
Fset_match_data (tem, Qt);
}
/* For speed, if a search happens within this code,
......@@ -4944,7 +4944,7 @@ read_process_output (proc, channel)
read_process_output_error_handler);
/* If we saved the match data nonrecursively, restore it now. */
restore_match_data ();
restore_search_regs ();
running_asynch_code = outer_running_asynch_code;
/* Handling the process output should not deactivate the mark. */
......@@ -6348,10 +6348,10 @@ exec_sentinel (proc, reason)
if (outer_running_asynch_code)
{
Lisp_Object tem;
tem = Fmatch_data (Qnil, Qnil);
restore_match_data ();
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
Fset_match_data (tem);
tem = Fmatch_data (Qnil, Qnil, Qnil);
restore_search_regs ();
record_unwind_save_match_data ();
Fset_match_data (tem, Qt);
}
/* For speed, if a search happens within this code,
......@@ -6365,7 +6365,7 @@ exec_sentinel (proc, reason)
exec_sentinel_error_handler);
/* If we saved the match data nonrecursively, restore it now. */
restore_match_data ();
restore_search_regs ();
running_asynch_code = outer_running_asynch_code;
Vdeactivate_mark = odeactivate;
......
......@@ -1443,7 +1443,8 @@ set_frame_menubar (f, first_time, deep_p)
because it is not reentrant. */
specbind (Qdebug_on_next_call, Qnil);
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
if (NILP (Voverriding_local_map_menu_flag))
{
specbind (Qoverriding_terminal_local_map, Qnil);
......
......@@ -8489,7 +8489,7 @@ prepare_menu_bars ()
Lisp_Object tail, frame;
int count = SPECPDL_INDEX ();
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
FOR_EACH_FRAME (tail, frame)
{
......@@ -8612,7 +8612,7 @@ update_menu_bar (f, save_match_data)
set_buffer_internal_1 (XBUFFER (w->buffer));
if (save_match_data)
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
if (NILP (Voverriding_local_map_menu_flag))
{
specbind (Qoverriding_terminal_local_map, Qnil);
......@@ -8803,7 +8803,7 @@ update_tool_bar (f, save_match_data)
/* Save match data, if we must. */
if (save_match_data)
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
/* Make sure that we don't accidentally use bogus keymaps. */
if (NILP (Voverriding_local_map_menu_flag))
......
......@@ -2030,7 +2030,7 @@ set_frame_menubar (f, first_time, deep_p)
because it is not reentrant. */
specbind (Qdebug_on_next_call, Qnil);
record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil));
record_unwind_save_match_data ();
record_unwind_protect (unuse_menu_items, Qnil);
if (NILP (Voverriding_local_map_menu_flag))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment