aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-04-16 08:11:41 -0700
committerPaul Eggert2011-04-16 08:11:41 -0700
commit60d9e1db81652a244a4f2f450a838637e9d75205 (patch)
treefa45759d570b91fe3c61fa561a89e1640e734db4 /src
parent39261c266b1b1f6de2d0541b0c96d980d317c558 (diff)
downloademacs-60d9e1db81652a244a4f2f450a838637e9d75205.tar.gz
emacs-60d9e1db81652a244a4f2f450a838637e9d75205.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/menu.c23
2 files changed, 18 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9c9e9218b6a..350e522f6b1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
12011-04-16 Paul Eggert <eggert@cs.ucla.edu> 12011-04-16 Paul Eggert <eggert@cs.ucla.edu>
2 2
3 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
4 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
5 (single_menu_item): Rename local to avoid shadowing.
6
3 * keyboard.c (make_lispy_event): Remove unused local var. 7 * keyboard.c (make_lispy_event): Remove unused local var.
4 8
5 * frame.c, frame.h (x_get_resource_string): Bring this back, but 9 * 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)
180 menu_items = larger_vector (menu_items, menu_items_allocated, Qnil); 180 menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
181} 181}
182 182
183#if (defined USE_X_TOOLKIT || defined USE_GTK || defined HAVE_NS \
184 || defined HAVE_NTGUI)
185
183/* Begin a submenu. */ 186/* Begin a submenu. */
184 187
185static void 188static void
@@ -204,6 +207,8 @@ push_submenu_end (void)
204 menu_items_submenu_depth--; 207 menu_items_submenu_depth--;
205} 208}
206 209
210#endif /* USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI */
211
207/* Indicate boundary between left and right. */ 212/* Indicate boundary between left and right. */
208 213
209static void 214static void
@@ -368,34 +373,34 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
368 if (skp->notbuttons) 373 if (skp->notbuttons)
369 /* The first button. Line up previous items in this menu. */ 374 /* The first button. Line up previous items in this menu. */
370 { 375 {
371 int index = skp->notbuttons; /* Index for first item this menu. */ 376 int idx = skp->notbuttons; /* Index for first item this menu. */
372 int submenu = 0; 377 int submenu = 0;
373 Lisp_Object tem; 378 Lisp_Object tem;
374 while (index < menu_items_used) 379 while (idx < menu_items_used)
375 { 380 {
376 tem 381 tem
377 = XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME]; 382 = XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME];
378 if (NILP (tem)) 383 if (NILP (tem))
379 { 384 {
380 index++; 385 idx++;
381 submenu++; /* Skip sub menu. */ 386 submenu++; /* Skip sub menu. */
382 } 387 }
383 else if (EQ (tem, Qlambda)) 388 else if (EQ (tem, Qlambda))
384 { 389 {
385 index++; 390 idx++;
386 submenu--; /* End sub menu. */ 391 submenu--; /* End sub menu. */
387 } 392 }
388 else if (EQ (tem, Qt)) 393 else if (EQ (tem, Qt))
389 index += 3; /* Skip new pane marker. */ 394 idx += 3; /* Skip new pane marker. */
390 else if (EQ (tem, Qquote)) 395 else if (EQ (tem, Qquote))
391 index++; /* Skip a left, right divider. */ 396 idx++; /* Skip a left, right divider. */
392 else 397 else
393 { 398 {
394 if (!submenu && SREF (tem, 0) != '\0' 399 if (!submenu && SREF (tem, 0) != '\0'
395 && SREF (tem, 0) != '-') 400 && SREF (tem, 0) != '-')
396 XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME] 401 XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME]
397 = concat2 (build_string (" "), tem); 402 = concat2 (build_string (" "), tem);
398 index += MENU_ITEMS_ITEM_LENGTH; 403 idx += MENU_ITEMS_ITEM_LENGTH;
399 } 404 }
400 } 405 }
401 skp->notbuttons = 0; 406 skp->notbuttons = 0;