diff options
Diffstat (limited to 'src/menu.c')
| -rw-r--r-- | src/menu.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/menu.c b/src/menu.c index 58558d5aedd..6b4a22d3052 100644 --- a/src/menu.c +++ b/src/menu.c | |||
| @@ -102,10 +102,10 @@ finish_menu_items (void) | |||
| 102 | { | 102 | { |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | Lisp_Object | 105 | void |
| 106 | unuse_menu_items (Lisp_Object dummy) | 106 | unuse_menu_items (void) |
| 107 | { | 107 | { |
| 108 | return menu_items_inuse = Qnil; | 108 | menu_items_inuse = Qnil; |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | /* Call when finished using the data for the current menu | 111 | /* Call when finished using the data for the current menu |
| @@ -124,19 +124,10 @@ discard_menu_items (void) | |||
| 124 | eassert (NILP (menu_items_inuse)); | 124 | eassert (NILP (menu_items_inuse)); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | #ifdef HAVE_NS | ||
| 128 | static Lisp_Object | ||
| 129 | cleanup_popup_menu (Lisp_Object arg) | ||
| 130 | { | ||
| 131 | discard_menu_items (); | ||
| 132 | return Qnil; | ||
| 133 | } | ||
| 134 | #endif | ||
| 135 | |||
| 136 | /* This undoes save_menu_items, and it is called by the specpdl unwind | 127 | /* This undoes save_menu_items, and it is called by the specpdl unwind |
| 137 | mechanism. */ | 128 | mechanism. */ |
| 138 | 129 | ||
| 139 | static Lisp_Object | 130 | static void |
| 140 | restore_menu_items (Lisp_Object saved) | 131 | restore_menu_items (Lisp_Object saved) |
| 141 | { | 132 | { |
| 142 | menu_items = XCAR (saved); | 133 | menu_items = XCAR (saved); |
| @@ -148,7 +139,6 @@ restore_menu_items (Lisp_Object saved) | |||
| 148 | menu_items_n_panes = XINT (XCAR (saved)); | 139 | menu_items_n_panes = XINT (XCAR (saved)); |
| 149 | saved = XCDR (saved); | 140 | saved = XCDR (saved); |
| 150 | menu_items_submenu_depth = XINT (XCAR (saved)); | 141 | menu_items_submenu_depth = XINT (XCAR (saved)); |
| 151 | return Qnil; | ||
| 152 | } | 142 | } |
| 153 | 143 | ||
| 154 | /* Push the whole state of menu_items processing onto the specpdl. | 144 | /* Push the whole state of menu_items processing onto the specpdl. |
| @@ -1004,7 +994,7 @@ find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data) | |||
| 1004 | { | 994 | { |
| 1005 | int j; | 995 | int j; |
| 1006 | 996 | ||
| 1007 | entry = Fcons (entry, Qnil); | 997 | entry = list1 (entry); |
| 1008 | if (!NILP (prefix)) | 998 | if (!NILP (prefix)) |
| 1009 | entry = Fcons (prefix, entry); | 999 | entry = Fcons (prefix, entry); |
| 1010 | for (j = submenu_depth - 1; j >= 0; j--) | 1000 | for (j = submenu_depth - 1; j >= 0; j--) |
| @@ -1213,7 +1203,7 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 1213 | #endif /* HAVE_MENUS */ | 1203 | #endif /* HAVE_MENUS */ |
| 1214 | 1204 | ||
| 1215 | /* Now parse the lisp menus. */ | 1205 | /* Now parse the lisp menus. */ |
| 1216 | record_unwind_protect (unuse_menu_items, Qnil); | 1206 | record_unwind_protect_void (unuse_menu_items); |
| 1217 | 1207 | ||
| 1218 | title = Qnil; | 1208 | title = Qnil; |
| 1219 | GCPRO1 (title); | 1209 | GCPRO1 (title); |
| @@ -1315,7 +1305,7 @@ no quit occurs and `x-popup-menu' returns nil. */) | |||
| 1315 | #endif | 1305 | #endif |
| 1316 | 1306 | ||
| 1317 | #ifdef HAVE_NS /* FIXME: ns-specific, why? --Stef */ | 1307 | #ifdef HAVE_NS /* FIXME: ns-specific, why? --Stef */ |
| 1318 | record_unwind_protect (cleanup_popup_menu, Qnil); | 1308 | record_unwind_protect_void (discard_menu_items); |
| 1319 | #endif | 1309 | #endif |
| 1320 | 1310 | ||
| 1321 | /* Display them in a menu. */ | 1311 | /* Display them in a menu. */ |