diff options
| author | Jim Blandy | 1992-01-13 21:48:08 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-01-13 21:48:08 +0000 |
| commit | 265a9e559da4ac72d154ecd638c51801b3e97847 (patch) | |
| tree | 633e4dc50761c2cd5201a7874e23eee9e51aecea /src/keymap.c | |
| parent | d427b66a664c0e1ffc818dfa5b87b45b4857d2ae (diff) | |
| download | emacs-265a9e559da4ac72d154ecd638c51801b3e97847.tar.gz emacs-265a9e559da4ac72d154ecd638c51801b3e97847.zip | |
*** empty log message ***
Diffstat (limited to 'src/keymap.c')
| -rw-r--r-- | src/keymap.c | 152 |
1 files changed, 77 insertions, 75 deletions
diff --git a/src/keymap.c b/src/keymap.c index d55c369356d..ec45512837b 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -155,7 +155,7 @@ VECTOR is a 128-element vector of bindings for ASCII characters.") | |||
| 155 | (object) | 155 | (object) |
| 156 | Lisp_Object object; | 156 | Lisp_Object object; |
| 157 | { | 157 | { |
| 158 | return (NULL (get_keymap_1 (object, 0)) ? Qnil : Qt); | 158 | return (NILP (get_keymap_1 (object, 0)) ? Qnil : Qt); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | /* Check that OBJECT is a keymap (after dereferencing through any | 161 | /* Check that OBJECT is a keymap (after dereferencing through any |
| @@ -232,7 +232,7 @@ access_keymap (map, idx) | |||
| 232 | 232 | ||
| 233 | /* A dense keymap indexed by a character? */ | 233 | /* A dense keymap indexed by a character? */ |
| 234 | if (XTYPE (idx) == Lisp_Int | 234 | if (XTYPE (idx) == Lisp_Int |
| 235 | && ! NULL (table)) | 235 | && ! NILP (table)) |
| 236 | return XVECTOR (table)->contents[XFASTINT (idx)]; | 236 | return XVECTOR (table)->contents[XFASTINT (idx)]; |
| 237 | 237 | ||
| 238 | /* This lookup will not involve a vector reference. */ | 238 | /* This lookup will not involve a vector reference. */ |
| @@ -269,7 +269,7 @@ get_keyelt (object) | |||
| 269 | tem = Fkeymapp (map); | 269 | tem = Fkeymapp (map); |
| 270 | 270 | ||
| 271 | /* If the contents are (KEYMAP . ELEMENT), go indirect. */ | 271 | /* If the contents are (KEYMAP . ELEMENT), go indirect. */ |
| 272 | if (!NULL (tem)) | 272 | if (!NILP (tem)) |
| 273 | object = access_keymap (map, Fcdr (object)); | 273 | object = access_keymap (map, Fcdr (object)); |
| 274 | 274 | ||
| 275 | /* If the keymap contents looks like (STRING . DEFN), | 275 | /* If the keymap contents looks like (STRING . DEFN), |
| @@ -306,7 +306,7 @@ store_in_keymap (keymap, idx, def) | |||
| 306 | Lisp_Object table = keymap_table (keymap); | 306 | Lisp_Object table = keymap_table (keymap); |
| 307 | 307 | ||
| 308 | /* A dense keymap indexed by a character? */ | 308 | /* A dense keymap indexed by a character? */ |
| 309 | if (XTYPE (idx) == Lisp_Int && !NULL (table)) | 309 | if (XTYPE (idx) == Lisp_Int && !NILP (table)) |
| 310 | XVECTOR (table)->contents[XFASTINT (idx)] = def; | 310 | XVECTOR (table)->contents[XFASTINT (idx)] = def; |
| 311 | 311 | ||
| 312 | /* Must be a sparse keymap, or a dense keymap indexed by a symbol. */ | 312 | /* Must be a sparse keymap, or a dense keymap indexed by a symbol. */ |
| @@ -315,7 +315,7 @@ store_in_keymap (keymap, idx, def) | |||
| 315 | /* Point to the pointer to the start of the assoc-list part | 315 | /* Point to the pointer to the start of the assoc-list part |
| 316 | of the keymap. */ | 316 | of the keymap. */ |
| 317 | register Lisp_Object *assoc_head | 317 | register Lisp_Object *assoc_head |
| 318 | = (NULL (table) | 318 | = (NILP (table) |
| 319 | ? & XCONS (keymap)->cdr | 319 | ? & XCONS (keymap)->cdr |
| 320 | : & XCONS (XCONS (keymap)->cdr)->cdr); | 320 | : & XCONS (XCONS (keymap)->cdr)->cdr); |
| 321 | register Lisp_Object defining_pair; | 321 | register Lisp_Object defining_pair; |
| @@ -328,7 +328,7 @@ store_in_keymap (keymap, idx, def) | |||
| 328 | /* Point to the pair where idx is bound, if any. */ | 328 | /* Point to the pair where idx is bound, if any. */ |
| 329 | defining_pair = Fassq (idx, *assoc_head); | 329 | defining_pair = Fassq (idx, *assoc_head); |
| 330 | 330 | ||
| 331 | if (NULL (defining_pair)) | 331 | if (NILP (defining_pair)) |
| 332 | *assoc_head = Fcons (Fcons (idx, def), *assoc_head); | 332 | *assoc_head = Fcons (Fcons (idx, def), *assoc_head); |
| 333 | else | 333 | else |
| 334 | Fsetcdr (defining_pair, def); | 334 | Fsetcdr (defining_pair, def); |
| @@ -367,7 +367,7 @@ is not copied.") | |||
| 367 | 367 | ||
| 368 | for (i = 0; i < DENSE_TABLE_SIZE; i++) | 368 | for (i = 0; i < DENSE_TABLE_SIZE; i++) |
| 369 | if (XTYPE (XVECTOR (copy)->contents[i]) != Lisp_Symbol) | 369 | if (XTYPE (XVECTOR (copy)->contents[i]) != Lisp_Symbol) |
| 370 | if (! NULL (Fkeymapp (XVECTOR (table)->contents[i]))) | 370 | if (! NILP (Fkeymapp (XVECTOR (table)->contents[i]))) |
| 371 | XVECTOR (table)->contents[i] | 371 | XVECTOR (table)->contents[i] |
| 372 | = Fcopy_keymap (XVECTOR (table)->contents[i]); | 372 | = Fcopy_keymap (XVECTOR (table)->contents[i]); |
| 373 | XCONS (tail)->car = table; | 373 | XCONS (tail)->car = table; |
| @@ -384,7 +384,7 @@ is not copied.") | |||
| 384 | elt = XCONS (tail)->car; | 384 | elt = XCONS (tail)->car; |
| 385 | if (CONSP (elt) | 385 | if (CONSP (elt) |
| 386 | && XTYPE (XCONS (elt)->cdr) != Lisp_Symbol | 386 | && XTYPE (XCONS (elt)->cdr) != Lisp_Symbol |
| 387 | && ! NULL (Fkeymapp (XCONS (elt)->cdr))) | 387 | && ! NILP (Fkeymapp (XCONS (elt)->cdr))) |
| 388 | XCONS (elt)->cdr = Fcopy_keymap (XCONS (elt)->cdr); | 388 | XCONS (elt)->cdr = Fcopy_keymap (XCONS (elt)->cdr); |
| 389 | 389 | ||
| 390 | tail = XCONS (tail)->cdr; | 390 | tail = XCONS (tail)->cdr; |
| @@ -461,14 +461,14 @@ the front of KEYMAP.") | |||
| 461 | 461 | ||
| 462 | cmd = get_keyelt (access_keymap (keymap, c)); | 462 | cmd = get_keyelt (access_keymap (keymap, c)); |
| 463 | 463 | ||
| 464 | if (NULL (cmd)) | 464 | if (NILP (cmd)) |
| 465 | { | 465 | { |
| 466 | cmd = Fmake_sparse_keymap (); | 466 | cmd = Fmake_sparse_keymap (); |
| 467 | store_in_keymap (keymap, c, cmd); | 467 | store_in_keymap (keymap, c, cmd); |
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | tem = Fkeymapp (cmd); | 470 | tem = Fkeymapp (cmd); |
| 471 | if (NULL (tem)) | 471 | if (NILP (tem)) |
| 472 | error ("Key sequence %s uses invalid prefix characters", | 472 | error ("Key sequence %s uses invalid prefix characters", |
| 473 | XSTRING (key)->data); | 473 | XSTRING (key)->data); |
| 474 | 474 | ||
| @@ -533,7 +533,7 @@ it takes to reach a non-prefix command.") | |||
| 533 | return cmd; | 533 | return cmd; |
| 534 | 534 | ||
| 535 | tem = Fkeymapp (cmd); | 535 | tem = Fkeymapp (cmd); |
| 536 | if (NULL (tem)) | 536 | if (NILP (tem)) |
| 537 | return make_number (idx); | 537 | return make_number (idx); |
| 538 | 538 | ||
| 539 | keymap = get_keymap (cmd); | 539 | keymap = get_keymap (cmd); |
| @@ -568,6 +568,11 @@ append_key (key_sequence, key) | |||
| 568 | 568 | ||
| 569 | /* Global, local, and minor mode keymap stuff. */ | 569 | /* Global, local, and minor mode keymap stuff. */ |
| 570 | 570 | ||
| 571 | /* We can't put these variables inside current_minor_maps, since under | ||
| 572 | DGUX they dump as pure. Bleah. */ | ||
| 573 | static Lisp_Object *cmm_modes, *cmm_maps; | ||
| 574 | static int cmm_size; | ||
| 575 | |||
| 571 | /* Store a pointer to an array of the keymaps of the currently active | 576 | /* Store a pointer to an array of the keymaps of the currently active |
| 572 | minor modes in *buf, and return the number of maps it contains. | 577 | minor modes in *buf, and return the number of maps it contains. |
| 573 | 578 | ||
| @@ -588,9 +593,6 @@ int | |||
| 588 | current_minor_maps (modeptr, mapptr) | 593 | current_minor_maps (modeptr, mapptr) |
| 589 | Lisp_Object **modeptr, **mapptr; | 594 | Lisp_Object **modeptr, **mapptr; |
| 590 | { | 595 | { |
| 591 | static Lisp_Object *modes, *maps; | ||
| 592 | static int size; | ||
| 593 | |||
| 594 | int i = 0; | 596 | int i = 0; |
| 595 | Lisp_Object alist, assoc, var; | 597 | Lisp_Object alist, assoc, var; |
| 596 | 598 | ||
| @@ -599,39 +601,39 @@ current_minor_maps (modeptr, mapptr) | |||
| 599 | alist = XCONS (alist)->cdr) | 601 | alist = XCONS (alist)->cdr) |
| 600 | if (CONSP (assoc = XCONS (alist)->car) | 602 | if (CONSP (assoc = XCONS (alist)->car) |
| 601 | && XTYPE (var = XCONS (assoc)->car) == Lisp_Symbol | 603 | && XTYPE (var = XCONS (assoc)->car) == Lisp_Symbol |
| 602 | && ! NULL (Fboundp (var)) | 604 | && ! NILP (Fboundp (var)) |
| 603 | && ! NULL (Fsymbol_value (var))) | 605 | && ! NILP (Fsymbol_value (var))) |
| 604 | { | 606 | { |
| 605 | if (i >= size) | 607 | if (i >= cmm_size) |
| 606 | { | 608 | { |
| 607 | Lisp_Object *newmodes, *newmaps; | 609 | Lisp_Object *newmodes, *newmaps; |
| 608 | 610 | ||
| 609 | if (maps) | 611 | if (cmm_maps) |
| 610 | { | 612 | { |
| 611 | newmodes = (Lisp_Object *) realloc (modes, size *= 2); | 613 | newmodes = (Lisp_Object *) realloc (cmm_modes, cmm_size *= 2); |
| 612 | newmaps = (Lisp_Object *) realloc (maps, size); | 614 | newmaps = (Lisp_Object *) realloc (cmm_maps, cmm_size); |
| 613 | } | 615 | } |
| 614 | else | 616 | else |
| 615 | { | 617 | { |
| 616 | newmodes = (Lisp_Object *) malloc (size = 30); | 618 | newmodes = (Lisp_Object *) malloc (cmm_size = 30); |
| 617 | newmaps = (Lisp_Object *) malloc (size); | 619 | newmaps = (Lisp_Object *) malloc (cmm_size); |
| 618 | } | 620 | } |
| 619 | 621 | ||
| 620 | if (newmaps && newmodes) | 622 | if (newmaps && newmodes) |
| 621 | { | 623 | { |
| 622 | modes = newmodes; | 624 | cmm_modes = newmodes; |
| 623 | maps = newmaps; | 625 | cmm_maps = newmaps; |
| 624 | } | 626 | } |
| 625 | else | 627 | else |
| 626 | break; | 628 | break; |
| 627 | } | 629 | } |
| 628 | modes[i] = var; | 630 | cmm_modes[i] = var; |
| 629 | maps [i] = XCONS (assoc)->cdr; | 631 | cmm_maps [i] = XCONS (assoc)->cdr; |
| 630 | i++; | 632 | i++; |
| 631 | } | 633 | } |
| 632 | 634 | ||
| 633 | if (modeptr) *modeptr = modes; | 635 | if (modeptr) *modeptr = cmm_modes; |
| 634 | if (mapptr) *mapptr = maps; | 636 | if (mapptr) *mapptr = cmm_maps; |
| 635 | return i; | 637 | return i; |
| 636 | } | 638 | } |
| 637 | 639 | ||
| @@ -647,22 +649,22 @@ The binding is probably a symbol with a function definition.") | |||
| 647 | 649 | ||
| 648 | nmaps = current_minor_maps (0, &maps); | 650 | nmaps = current_minor_maps (0, &maps); |
| 649 | for (i = 0; i < nmaps; i++) | 651 | for (i = 0; i < nmaps; i++) |
| 650 | if (! NULL (maps[i])) | 652 | if (! NILP (maps[i])) |
| 651 | { | 653 | { |
| 652 | value = Flookup_key (maps[i], key); | 654 | value = Flookup_key (maps[i], key); |
| 653 | if (! NULL (value) && XTYPE (value) != Lisp_Int) | 655 | if (! NILP (value) && XTYPE (value) != Lisp_Int) |
| 654 | return value; | 656 | return value; |
| 655 | } | 657 | } |
| 656 | 658 | ||
| 657 | if (! NULL (current_buffer->keymap)) | 659 | if (! NILP (current_buffer->keymap)) |
| 658 | { | 660 | { |
| 659 | value = Flookup_key (current_buffer->keymap, key); | 661 | value = Flookup_key (current_buffer->keymap, key); |
| 660 | if (! NULL (value) && XTYPE (value) != Lisp_Int) | 662 | if (! NILP (value) && XTYPE (value) != Lisp_Int) |
| 661 | return value; | 663 | return value; |
| 662 | } | 664 | } |
| 663 | 665 | ||
| 664 | value = Flookup_key (current_global_map, key); | 666 | value = Flookup_key (current_global_map, key); |
| 665 | if (! NULL (value) && XTYPE (value) != Lisp_Int) | 667 | if (! NILP (value) && XTYPE (value) != Lisp_Int) |
| 666 | return value; | 668 | return value; |
| 667 | 669 | ||
| 668 | return Qnil; | 670 | return Qnil; |
| @@ -677,7 +679,7 @@ The binding is probably a symbol with a function definition.") | |||
| 677 | { | 679 | { |
| 678 | register Lisp_Object map; | 680 | register Lisp_Object map; |
| 679 | map = current_buffer->keymap; | 681 | map = current_buffer->keymap; |
| 680 | if (NULL (map)) | 682 | if (NILP (map)) |
| 681 | return Qnil; | 683 | return Qnil; |
| 682 | return Flookup_key (map, keys); | 684 | return Flookup_key (map, keys); |
| 683 | } | 685 | } |
| @@ -711,11 +713,11 @@ that come after prefix bindings.") | |||
| 711 | nmaps = current_minor_maps (&modes, &maps); | 713 | nmaps = current_minor_maps (&modes, &maps); |
| 712 | 714 | ||
| 713 | for (i = j = 0; i < nmaps; i++) | 715 | for (i = j = 0; i < nmaps; i++) |
| 714 | if (! NULL (maps[i]) | 716 | if (! NILP (maps[i]) |
| 715 | && ! NULL (binding = Flookup_key (maps[i], key)) | 717 | && ! NILP (binding = Flookup_key (maps[i], key)) |
| 716 | && XTYPE (binding) != Lisp_Int) | 718 | && XTYPE (binding) != Lisp_Int) |
| 717 | { | 719 | { |
| 718 | if (! NULL (get_keymap_1 (binding, 0))) | 720 | if (! NILP (get_keymap_1 (binding, 0))) |
| 719 | maps[j++] = Fcons (modes[i], binding); | 721 | maps[j++] = Fcons (modes[i], binding); |
| 720 | else if (j == 0) | 722 | else if (j == 0) |
| 721 | return Fcons (Fcons (modes[i], binding), Qnil); | 723 | return Fcons (Fcons (modes[i], binding), Qnil); |
| @@ -754,7 +756,7 @@ which is shared with other buffers in the same major mode.") | |||
| 754 | { | 756 | { |
| 755 | register Lisp_Object map; | 757 | register Lisp_Object map; |
| 756 | map = current_buffer->keymap; | 758 | map = current_buffer->keymap; |
| 757 | if (NULL (map)) | 759 | if (NILP (map)) |
| 758 | { | 760 | { |
| 759 | map = Fmake_sparse_keymap (); | 761 | map = Fmake_sparse_keymap (); |
| 760 | current_buffer->keymap = map; | 762 | current_buffer->keymap = map; |
| @@ -785,7 +787,7 @@ KEY is a string representing a sequence of keystrokes.") | |||
| 785 | (keys) | 787 | (keys) |
| 786 | Lisp_Object keys; | 788 | Lisp_Object keys; |
| 787 | { | 789 | { |
| 788 | if (!NULL (current_buffer->keymap)) | 790 | if (!NILP (current_buffer->keymap)) |
| 789 | Flocal_set_key (keys, Qnil); | 791 | Flocal_set_key (keys, Qnil); |
| 790 | return Qnil; | 792 | return Qnil; |
| 791 | } | 793 | } |
| @@ -802,7 +804,7 @@ as a function.") | |||
| 802 | Lisp_Object map; | 804 | Lisp_Object map; |
| 803 | map = Fmake_sparse_keymap (); | 805 | map = Fmake_sparse_keymap (); |
| 804 | Ffset (name, map); | 806 | Ffset (name, map); |
| 805 | if (!NULL (mapvar)) | 807 | if (!NILP (mapvar)) |
| 806 | Fset (mapvar, map); | 808 | Fset (mapvar, map); |
| 807 | else | 809 | else |
| 808 | Fset (name, map); | 810 | Fset (name, map); |
| @@ -825,7 +827,7 @@ If KEYMAP is nil, that means no local keymap.") | |||
| 825 | (keymap) | 827 | (keymap) |
| 826 | Lisp_Object keymap; | 828 | Lisp_Object keymap; |
| 827 | { | 829 | { |
| 828 | if (!NULL (keymap)) | 830 | if (!NILP (keymap)) |
| 829 | keymap = get_keymap (keymap); | 831 | keymap = get_keymap (keymap); |
| 830 | 832 | ||
| 831 | current_buffer->keymap = keymap; | 833 | current_buffer->keymap = keymap; |
| @@ -880,7 +882,7 @@ so that the KEYS increase in length. The first element is (\"\" . KEYMAP).") | |||
| 880 | This is a breadth-first traversal, where tail is the queue of | 882 | This is a breadth-first traversal, where tail is the queue of |
| 881 | nodes, and maps accumulates a list of all nodes visited. */ | 883 | nodes, and maps accumulates a list of all nodes visited. */ |
| 882 | 884 | ||
| 883 | while (!NULL (tail)) | 885 | while (!NILP (tail)) |
| 884 | { | 886 | { |
| 885 | register Lisp_Object thisseq = Fcar (Fcar (tail)); | 887 | register Lisp_Object thisseq = Fcar (Fcar (tail)); |
| 886 | register Lisp_Object thismap = Fcdr (Fcar (tail)); | 888 | register Lisp_Object thismap = Fcdr (Fcar (tail)); |
| @@ -908,14 +910,14 @@ so that the KEYS increase in length. The first element is (\"\" . KEYMAP).") | |||
| 908 | register Lisp_Object cmd; | 910 | register Lisp_Object cmd; |
| 909 | 911 | ||
| 910 | cmd = get_keyelt (XVECTOR (table)->contents[i]); | 912 | cmd = get_keyelt (XVECTOR (table)->contents[i]); |
| 911 | if (NULL (cmd)) continue; | 913 | if (NILP (cmd)) continue; |
| 912 | tem = Fkeymapp (cmd); | 914 | tem = Fkeymapp (cmd); |
| 913 | if (!NULL (tem)) | 915 | if (!NILP (tem)) |
| 914 | { | 916 | { |
| 915 | cmd = get_keymap (cmd); | 917 | cmd = get_keymap (cmd); |
| 916 | /* Ignore keymaps that are already added to maps. */ | 918 | /* Ignore keymaps that are already added to maps. */ |
| 917 | tem = Frassq (cmd, maps); | 919 | tem = Frassq (cmd, maps); |
| 918 | if (NULL (tem)) | 920 | if (NILP (tem)) |
| 919 | { | 921 | { |
| 920 | /* If the last key in thisseq is meta-prefix-char, | 922 | /* If the last key in thisseq is meta-prefix-char, |
| 921 | turn it into a meta-ized keystroke. We know | 923 | turn it into a meta-ized keystroke. We know |
| @@ -960,12 +962,12 @@ so that the KEYS increase in length. The first element is (\"\" . KEYMAP).") | |||
| 960 | 962 | ||
| 961 | /* Ignore definitions that aren't keymaps themselves. */ | 963 | /* Ignore definitions that aren't keymaps themselves. */ |
| 962 | tem = Fkeymapp (cmd); | 964 | tem = Fkeymapp (cmd); |
| 963 | if (!NULL (tem)) | 965 | if (!NILP (tem)) |
| 964 | { | 966 | { |
| 965 | /* Ignore keymaps that have been seen already. */ | 967 | /* Ignore keymaps that have been seen already. */ |
| 966 | cmd = get_keymap (cmd); | 968 | cmd = get_keymap (cmd); |
| 967 | tem = Frassq (cmd, maps); | 969 | tem = Frassq (cmd, maps); |
| 968 | if (NULL (tem)) | 970 | if (NILP (tem)) |
| 969 | { | 971 | { |
| 970 | /* let elt be the event defined by this map entry. */ | 972 | /* let elt be the event defined by this map entry. */ |
| 971 | elt = XCONS (elt)->car; | 973 | elt = XCONS (elt)->car; |
| @@ -1171,10 +1173,10 @@ indirect definition itself.") | |||
| 1171 | register Lisp_Object maps; | 1173 | register Lisp_Object maps; |
| 1172 | Lisp_Object found; | 1174 | Lisp_Object found; |
| 1173 | 1175 | ||
| 1174 | if (NULL (global_keymap)) | 1176 | if (NILP (global_keymap)) |
| 1175 | global_keymap = current_global_map; | 1177 | global_keymap = current_global_map; |
| 1176 | 1178 | ||
| 1177 | if (!NULL (local_keymap)) | 1179 | if (!NILP (local_keymap)) |
| 1178 | maps = nconc2 (Faccessible_keymaps (get_keymap (local_keymap)), | 1180 | maps = nconc2 (Faccessible_keymaps (get_keymap (local_keymap)), |
| 1179 | Faccessible_keymaps (get_keymap (global_keymap))); | 1181 | Faccessible_keymaps (get_keymap (global_keymap))); |
| 1180 | else | 1182 | else |
| @@ -1182,7 +1184,7 @@ indirect definition itself.") | |||
| 1182 | 1184 | ||
| 1183 | found = Qnil; | 1185 | found = Qnil; |
| 1184 | 1186 | ||
| 1185 | for (; !NULL (maps); maps = Fcdr (maps)) | 1187 | for (; !NILP (maps); maps = Fcdr (maps)) |
| 1186 | { | 1188 | { |
| 1187 | register this = Fcar (Fcar (maps)); /* Key sequence to reach map */ | 1189 | register this = Fcar (Fcar (maps)); /* Key sequence to reach map */ |
| 1188 | register map = Fcdr (Fcar (maps)); /* The map that it reaches */ | 1190 | register map = Fcdr (Fcar (maps)); /* The map that it reaches */ |
| @@ -1245,7 +1247,7 @@ indirect definition itself.") | |||
| 1245 | break; | 1247 | break; |
| 1246 | 1248 | ||
| 1247 | /* Search through indirections unless that's not wanted. */ | 1249 | /* Search through indirections unless that's not wanted. */ |
| 1248 | if (NULL (noindirect)) | 1250 | if (NILP (noindirect)) |
| 1249 | binding = get_keyelt (binding); | 1251 | binding = get_keyelt (binding); |
| 1250 | 1252 | ||
| 1251 | /* End this iteration if this element does not match | 1253 | /* End this iteration if this element does not match |
| @@ -1255,7 +1257,7 @@ indirect definition itself.") | |||
| 1255 | { | 1257 | { |
| 1256 | Lisp_Object tem; | 1258 | Lisp_Object tem; |
| 1257 | tem = Fequal (binding, definition); | 1259 | tem = Fequal (binding, definition); |
| 1258 | if (NULL (tem)) | 1260 | if (NILP (tem)) |
| 1259 | continue; | 1261 | continue; |
| 1260 | } | 1262 | } |
| 1261 | else | 1263 | else |
| @@ -1281,16 +1283,16 @@ indirect definition itself.") | |||
| 1281 | 1283 | ||
| 1282 | Either nil or number as value from Flookup_key | 1284 | Either nil or number as value from Flookup_key |
| 1283 | means undefined. */ | 1285 | means undefined. */ |
| 1284 | if (!NULL (local_keymap)) | 1286 | if (!NILP (local_keymap)) |
| 1285 | { | 1287 | { |
| 1286 | binding = Flookup_key (local_keymap, sequence); | 1288 | binding = Flookup_key (local_keymap, sequence); |
| 1287 | if (!NULL (binding) && XTYPE (binding) != Lisp_Int) | 1289 | if (!NILP (binding) && XTYPE (binding) != Lisp_Int) |
| 1288 | { | 1290 | { |
| 1289 | if (XTYPE (definition) == Lisp_Cons) | 1291 | if (XTYPE (definition) == Lisp_Cons) |
| 1290 | { | 1292 | { |
| 1291 | Lisp_Object tem; | 1293 | Lisp_Object tem; |
| 1292 | tem = Fequal (binding, definition); | 1294 | tem = Fequal (binding, definition); |
| 1293 | if (NULL (tem)) | 1295 | if (NILP (tem)) |
| 1294 | continue; | 1296 | continue; |
| 1295 | } | 1297 | } |
| 1296 | else | 1298 | else |
| @@ -1301,7 +1303,7 @@ indirect definition itself.") | |||
| 1301 | 1303 | ||
| 1302 | /* It is a true unshadowed match. Record it. */ | 1304 | /* It is a true unshadowed match. Record it. */ |
| 1303 | 1305 | ||
| 1304 | if (!NULL (firstonly)) | 1306 | if (!NILP (firstonly)) |
| 1305 | return sequence; | 1307 | return sequence; |
| 1306 | found = Fcons (sequence, found); | 1308 | found = Fcons (sequence, found); |
| 1307 | } | 1309 | } |
| @@ -1392,7 +1394,7 @@ describe_buffer_bindings (descbuf) | |||
| 1392 | } | 1394 | } |
| 1393 | 1395 | ||
| 1394 | start1 = XBUFFER (descbuf)->keymap; | 1396 | start1 = XBUFFER (descbuf)->keymap; |
| 1395 | if (!NULL (start1)) | 1397 | if (!NILP (start1)) |
| 1396 | { | 1398 | { |
| 1397 | insert_string ("Local Bindings:\n"); | 1399 | insert_string ("Local Bindings:\n"); |
| 1398 | insert_string (heading); | 1400 | insert_string (heading); |
| @@ -1428,13 +1430,13 @@ describe_map_tree (startmap, partial, shadow) | |||
| 1428 | maps = Faccessible_keymaps (startmap); | 1430 | maps = Faccessible_keymaps (startmap); |
| 1429 | GCPRO1 (maps); | 1431 | GCPRO1 (maps); |
| 1430 | 1432 | ||
| 1431 | for (; !NULL (maps); maps = Fcdr (maps)) | 1433 | for (; !NILP (maps); maps = Fcdr (maps)) |
| 1432 | { | 1434 | { |
| 1433 | elt = Fcar (maps); | 1435 | elt = Fcar (maps); |
| 1434 | sh = Fcar (elt); | 1436 | sh = Fcar (elt); |
| 1435 | 1437 | ||
| 1436 | /* If there is no shadow keymap given, don't shadow. */ | 1438 | /* If there is no shadow keymap given, don't shadow. */ |
| 1437 | if (NULL (shadow)) | 1439 | if (NILP (shadow)) |
| 1438 | sh = Qnil; | 1440 | sh = Qnil; |
| 1439 | 1441 | ||
| 1440 | /* If the sequence by which we reach this keymap is zero-length, | 1442 | /* If the sequence by which we reach this keymap is zero-length, |
| @@ -1460,7 +1462,7 @@ describe_map_tree (startmap, partial, shadow) | |||
| 1460 | show through), describe the map. Otherwise, sh is a command | 1462 | show through), describe the map. Otherwise, sh is a command |
| 1461 | that completely shadows the current map, and we shouldn't | 1463 | that completely shadows the current map, and we shouldn't |
| 1462 | bother. */ | 1464 | bother. */ |
| 1463 | if (NULL (sh) || !NULL (Fkeymapp (sh))) | 1465 | if (NILP (sh) || !NILP (Fkeymapp (sh))) |
| 1464 | describe_map (Fcdr (elt), Fcar (elt), partial, sh); | 1466 | describe_map (Fcdr (elt), Fcar (elt), partial, sh); |
| 1465 | } | 1467 | } |
| 1466 | 1468 | ||
| @@ -1484,7 +1486,7 @@ describe_command (definition) | |||
| 1484 | else | 1486 | else |
| 1485 | { | 1487 | { |
| 1486 | tem1 = Fkeymapp (definition); | 1488 | tem1 = Fkeymapp (definition); |
| 1487 | if (!NULL (tem1)) | 1489 | if (!NILP (tem1)) |
| 1488 | insert_string ("Prefix Command\n"); | 1490 | insert_string ("Prefix Command\n"); |
| 1489 | else | 1491 | else |
| 1490 | insert_string ("??\n"); | 1492 | insert_string ("??\n"); |
| @@ -1503,7 +1505,7 @@ describe_map (map, keys, partial, shadow) | |||
| 1503 | { | 1505 | { |
| 1504 | register Lisp_Object keysdesc; | 1506 | register Lisp_Object keysdesc; |
| 1505 | 1507 | ||
| 1506 | if (!NULL (keys) && Flength (keys) > 0) | 1508 | if (!NILP (keys) && Flength (keys) > 0) |
| 1507 | keysdesc = concat2 (Fkey_description (keys), | 1509 | keysdesc = concat2 (Fkey_description (keys), |
| 1508 | build_string (" ")); | 1510 | build_string (" ")); |
| 1509 | else | 1511 | else |
| @@ -1560,24 +1562,24 @@ describe_alist (alist, elt_prefix, elt_describer, partial, shadow) | |||
| 1560 | tem2 = get_keyelt (Fcdr_safe (Fcar (alist))); | 1562 | tem2 = get_keyelt (Fcdr_safe (Fcar (alist))); |
| 1561 | 1563 | ||
| 1562 | /* Don't show undefined commands or suppressed commands. */ | 1564 | /* Don't show undefined commands or suppressed commands. */ |
| 1563 | if (NULL (tem2)) continue; | 1565 | if (NILP (tem2)) continue; |
| 1564 | if (XTYPE (tem2) == Lisp_Symbol && partial) | 1566 | if (XTYPE (tem2) == Lisp_Symbol && partial) |
| 1565 | { | 1567 | { |
| 1566 | this = Fget (tem2, suppress); | 1568 | this = Fget (tem2, suppress); |
| 1567 | if (!NULL (this)) | 1569 | if (!NILP (this)) |
| 1568 | continue; | 1570 | continue; |
| 1569 | } | 1571 | } |
| 1570 | 1572 | ||
| 1571 | /* Don't show a command that isn't really visible | 1573 | /* Don't show a command that isn't really visible |
| 1572 | because a local definition of the same key shadows it. */ | 1574 | because a local definition of the same key shadows it. */ |
| 1573 | 1575 | ||
| 1574 | if (!NULL (shadow)) | 1576 | if (!NILP (shadow)) |
| 1575 | { | 1577 | { |
| 1576 | Lisp_Object tem; | 1578 | Lisp_Object tem; |
| 1577 | 1579 | ||
| 1578 | XVECTOR (kludge)->contents[0] = tem1; | 1580 | XVECTOR (kludge)->contents[0] = tem1; |
| 1579 | tem = Flookup_key (shadow, kludge); | 1581 | tem = Flookup_key (shadow, kludge); |
| 1580 | if (!NULL (tem)) continue; | 1582 | if (!NILP (tem)) continue; |
| 1581 | } | 1583 | } |
| 1582 | 1584 | ||
| 1583 | if (first) | 1585 | if (first) |
| @@ -1586,7 +1588,7 @@ describe_alist (alist, elt_prefix, elt_describer, partial, shadow) | |||
| 1586 | first = 0; | 1588 | first = 0; |
| 1587 | } | 1589 | } |
| 1588 | 1590 | ||
| 1589 | if (!NULL (elt_prefix)) | 1591 | if (!NILP (elt_prefix)) |
| 1590 | insert1 (elt_prefix); | 1592 | insert1 (elt_prefix); |
| 1591 | 1593 | ||
| 1592 | /* THIS gets the string to describe the character TEM1. */ | 1594 | /* THIS gets the string to describe the character TEM1. */ |
| @@ -1651,26 +1653,26 @@ describe_vector (vector, elt_prefix, elt_describer, partial, shadow) | |||
| 1651 | QUIT; | 1653 | QUIT; |
| 1652 | tem1 = get_keyelt (XVECTOR (vector)->contents[i]); | 1654 | tem1 = get_keyelt (XVECTOR (vector)->contents[i]); |
| 1653 | 1655 | ||
| 1654 | if (NULL (tem1)) continue; | 1656 | if (NILP (tem1)) continue; |
| 1655 | 1657 | ||
| 1656 | /* Don't mention suppressed commands. */ | 1658 | /* Don't mention suppressed commands. */ |
| 1657 | if (XTYPE (tem1) == Lisp_Symbol && partial) | 1659 | if (XTYPE (tem1) == Lisp_Symbol && partial) |
| 1658 | { | 1660 | { |
| 1659 | this = Fget (tem1, suppress); | 1661 | this = Fget (tem1, suppress); |
| 1660 | if (!NULL (this)) | 1662 | if (!NILP (this)) |
| 1661 | continue; | 1663 | continue; |
| 1662 | } | 1664 | } |
| 1663 | 1665 | ||
| 1664 | /* If this command in this map is shadowed by some other map, | 1666 | /* If this command in this map is shadowed by some other map, |
| 1665 | ignore it. */ | 1667 | ignore it. */ |
| 1666 | if (!NULL (shadow)) | 1668 | if (!NILP (shadow)) |
| 1667 | { | 1669 | { |
| 1668 | Lisp_Object tem; | 1670 | Lisp_Object tem; |
| 1669 | 1671 | ||
| 1670 | XVECTOR (kludge)->contents[0] = make_number (i); | 1672 | XVECTOR (kludge)->contents[0] = make_number (i); |
| 1671 | tem = Flookup_key (shadow, kludge); | 1673 | tem = Flookup_key (shadow, kludge); |
| 1672 | 1674 | ||
| 1673 | if (!NULL (tem)) continue; | 1675 | if (!NILP (tem)) continue; |
| 1674 | } | 1676 | } |
| 1675 | 1677 | ||
| 1676 | if (first) | 1678 | if (first) |
| @@ -1680,7 +1682,7 @@ describe_vector (vector, elt_prefix, elt_describer, partial, shadow) | |||
| 1680 | } | 1682 | } |
| 1681 | 1683 | ||
| 1682 | /* Output the prefix that applies to every entry in this map. */ | 1684 | /* Output the prefix that applies to every entry in this map. */ |
| 1683 | if (!NULL (elt_prefix)) | 1685 | if (!NILP (elt_prefix)) |
| 1684 | insert1 (elt_prefix); | 1686 | insert1 (elt_prefix); |
| 1685 | 1687 | ||
| 1686 | /* Get the string to describe the character I, and print it. */ | 1688 | /* Get the string to describe the character I, and print it. */ |
| @@ -1702,7 +1704,7 @@ describe_vector (vector, elt_prefix, elt_describer, partial, shadow) | |||
| 1702 | if (i != XINT (dummy)) | 1704 | if (i != XINT (dummy)) |
| 1703 | { | 1705 | { |
| 1704 | insert (" .. ", 4); | 1706 | insert (" .. ", 4); |
| 1705 | if (!NULL (elt_prefix)) | 1707 | if (!NILP (elt_prefix)) |
| 1706 | insert1 (elt_prefix); | 1708 | insert1 (elt_prefix); |
| 1707 | 1709 | ||
| 1708 | XFASTINT (dummy) = i; | 1710 | XFASTINT (dummy) = i; |
| @@ -1729,9 +1731,9 @@ apropos_accum (symbol, string) | |||
| 1729 | register Lisp_Object tem; | 1731 | register Lisp_Object tem; |
| 1730 | 1732 | ||
| 1731 | tem = Fstring_match (string, Fsymbol_name (symbol), Qnil); | 1733 | tem = Fstring_match (string, Fsymbol_name (symbol), Qnil); |
| 1732 | if (!NULL (tem) && !NULL (apropos_predicate)) | 1734 | if (!NILP (tem) && !NILP (apropos_predicate)) |
| 1733 | tem = call1 (apropos_predicate, symbol); | 1735 | tem = call1 (apropos_predicate, symbol); |
| 1734 | if (!NULL (tem)) | 1736 | if (!NILP (tem)) |
| 1735 | apropos_accumulate = Fcons (symbol, apropos_accumulate); | 1737 | apropos_accumulate = Fcons (symbol, apropos_accumulate); |
| 1736 | } | 1738 | } |
| 1737 | 1739 | ||