diff options
| author | Richard M. Stallman | 1992-09-25 23:23:17 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1992-09-25 23:23:17 +0000 |
| commit | ab6ee1a0bc38c62f88afca770598cd2ddc42042b (patch) | |
| tree | 54ca5b9108c03df823c54e8dcd86ac010e51c3f7 | |
| parent | 8cfb9d4630abc99aa39b448958cb530882e7a1da (diff) | |
| download | emacs-ab6ee1a0bc38c62f88afca770598cd2ddc42042b.tar.gz emacs-ab6ee1a0bc38c62f88afca770598cd2ddc42042b.zip | |
(single_keymap_panes): Handle vectors properly.
| -rw-r--r-- | src/xmenu.c | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index 592f8cc574a..a15907090e6 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -468,17 +468,10 @@ single_keymap_panes (keymap, panes, vector, names, items, | |||
| 468 | /* Get the length of the list level of the keymap. */ | 468 | /* Get the length of the list level of the keymap. */ |
| 469 | i = XFASTINT (Flength (keymap)); | 469 | i = XFASTINT (Flength (keymap)); |
| 470 | 470 | ||
| 471 | #if 0 | 471 | /* Add in lengths of any arrays. */ |
| 472 | /* If the keymap has a dense table, put it in TABLE, | 472 | for (tail = keymap; XTYPE (tail) == Lisp_Cons; tail = XCONS (tail)->cdr) |
| 473 | and leave only the list level in KEYMAP. | 473 | if (XTYPE (XCONS (tail)->car) == Lisp_Vector) |
| 474 | Include the length of the dense table in I. */ | 474 | i += XVECTOR (XCONS (tail)->car)->size; |
| 475 | table = keymap_table (keymap); | ||
| 476 | if (!NILP (table)) | ||
| 477 | { | ||
| 478 | i += XFASTINT (Flength (table)); | ||
| 479 | keymap = XCONS (XCONS (keymap)->cdr)->cdr; | ||
| 480 | } | ||
| 481 | #endif | ||
| 482 | 475 | ||
| 483 | /* Create vectors for the names and values of the items in the pane. | 476 | /* Create vectors for the names and values of the items in the pane. |
| 484 | I is an upper bound for the number of items. */ | 477 | I is an upper bound for the number of items. */ |
| @@ -515,6 +508,37 @@ single_keymap_panes (keymap, panes, vector, names, items, | |||
| 515 | } | 508 | } |
| 516 | } | 509 | } |
| 517 | } | 510 | } |
| 511 | else if (XTYPE (item) == Lisp_Vector) | ||
| 512 | { | ||
| 513 | /* Loop over the char values represented in the vector. */ | ||
| 514 | int len = XVECTOR (item)->size; | ||
| 515 | int c; | ||
| 516 | for (c = 0; c < len; c++) | ||
| 517 | { | ||
| 518 | Lisp_Object character; | ||
| 519 | XFASTINT (character) = c; | ||
| 520 | item1 = XVECTOR (item)->contents[c]; | ||
| 521 | if (XTYPE (item1) == Lisp_Cons) | ||
| 522 | { | ||
| 523 | item2 = XCONS (item1)->car; | ||
| 524 | if (XTYPE (item2) == Lisp_String) | ||
| 525 | { | ||
| 526 | Lisp_Object tem; | ||
| 527 | tem = Fkeymapp (Fcdr (item1)); | ||
| 528 | if (XSTRING (item2)->data[0] == '@' && !NILP (tem)) | ||
| 529 | pending_maps = Fcons (Fcons (Fcdr (item1), item2), | ||
| 530 | pending_maps); | ||
| 531 | else | ||
| 532 | { | ||
| 533 | (*names)[*p_ptr][i] = (char *) XSTRING (item2)->data; | ||
| 534 | /* The menu item "value" is the key bound here. */ | ||
| 535 | (*vector)[*p_ptr][i] = character; | ||
| 536 | i++; | ||
| 537 | } | ||
| 538 | } | ||
| 539 | } | ||
| 540 | } | ||
| 541 | } | ||
| 518 | } | 542 | } |
| 519 | /* Record the number of items in the pane. */ | 543 | /* Record the number of items in the pane. */ |
| 520 | (*items)[*p_ptr] = i; | 544 | (*items)[*p_ptr] = i; |