From: Paul Eggert Date: Sat, 16 Apr 2011 15:11:41 +0000 (-0700) Subject: * menu.c (push_submenu_start, push_submenu_end): Do not define unless X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~268^2~33 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=60d9e1db81652a244a4f2f450a838637e9d75205;p=emacs.git * menu.c (push_submenu_start, push_submenu_end): Do not define unless USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI. (single_menu_item): Rename local to avoid shadowing. --- diff --git a/src/ChangeLog b/src/ChangeLog index 9c9e9218b6a..350e522f6b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2011-04-16 Paul Eggert + * menu.c (push_submenu_start, push_submenu_end): Do not define unless + USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI. + (single_menu_item): Rename local to avoid shadowing. + * keyboard.c (make_lispy_event): Remove unused local var. * frame.c, frame.h (x_get_resource_string): Bring this back, but diff --git a/src/menu.c b/src/menu.c index 3bfb74863ae..f637b92679a 100644 --- a/src/menu.c +++ b/src/menu.c @@ -180,6 +180,9 @@ grow_menu_items (void) menu_items = larger_vector (menu_items, menu_items_allocated, Qnil); } +#if (defined USE_X_TOOLKIT || defined USE_GTK || defined HAVE_NS \ + || defined HAVE_NTGUI) + /* Begin a submenu. */ static void @@ -204,6 +207,8 @@ push_submenu_end (void) menu_items_submenu_depth--; } +#endif /* USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI */ + /* Indicate boundary between left and right. */ static void @@ -368,34 +373,34 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk if (skp->notbuttons) /* The first button. Line up previous items in this menu. */ { - int index = skp->notbuttons; /* Index for first item this menu. */ + int idx = skp->notbuttons; /* Index for first item this menu. */ int submenu = 0; Lisp_Object tem; - while (index < menu_items_used) + while (idx < menu_items_used) { tem - = XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME]; + = XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME]; if (NILP (tem)) { - index++; + idx++; submenu++; /* Skip sub menu. */ } else if (EQ (tem, Qlambda)) { - index++; + idx++; submenu--; /* End sub menu. */ } else if (EQ (tem, Qt)) - index += 3; /* Skip new pane marker. */ + idx += 3; /* Skip new pane marker. */ else if (EQ (tem, Qquote)) - index++; /* Skip a left, right divider. */ + idx++; /* Skip a left, right divider. */ else { if (!submenu && SREF (tem, 0) != '\0' && SREF (tem, 0) != '-') - XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME] + XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME] = concat2 (build_string (" "), tem); - index += MENU_ITEMS_ITEM_LENGTH; + idx += MENU_ITEMS_ITEM_LENGTH; } } skp->notbuttons = 0;