1 /* $Header: /p/tcsh/cvsroot/tcsh/ed.defns.c,v 3.46 2006/03/02 18:46:44 christos Exp $ */
3 * ed.defns.c: Editor function definitions and initialization
6 * Copyright (c) 1980, 1991 The Regents of the University of California.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 RCSID("$tcsh: ed.defns.c,v 3.46 2006/03/02 18:46:44 christos Exp $")
39 static void ed_InitMetaBindings (void);
41 PFCmd CcFuncTbl
[] = { /* table of available commands */
43 /* no #define here -- this is a dummy to detect initing of the key map */
45 #define F_UNASSIGNED 1
65 #define F_STARTOVER 11
75 #define F_CLEARDISP 16
83 #define F_DOWN_HIST 20
85 #define F_UP_SEARCH_HIST 21
87 #define F_DOWN_SEARCH_HIST 22
91 #define F_LIST_CHOICES 24
93 #define F_DELWORDPREV 25
95 #define F_DELWORDNEXT 26
103 #define F_METANEXT 30
105 #define F_SEND_EOF 31
107 #define F_CHARSWITCH 32
111 #define F_YANK_KILL 34
113 #define F_TTY_DSUSP 35
115 #define F_TTY_FLUSHO 36
117 #define F_TTY_QUIT 37
119 #define F_TTY_TSUSP 38
121 #define F_TTY_STOPO 39
123 #define F_TTY_STARTO 40
127 #define F_SET_MARK 42
129 #define F_EXCHANGE_MARK 43
131 #define F_LAST_ITEM 44
133 #define F_DELNEXT_LIST_EOF 45
135 #define V_CMD_MODE 46
139 #define F_ARGDIGIT 48
141 #define F_KILLREGION 49
143 #define F_COPYREGION 50
145 #define F_GCHARSWITCH 51
147 #define F_RUN_FG_EDITOR 52
148 e_unassigned
, /* place holder for sequence lead in character */
151 #define F_CASEUPPER 54
153 #define F_CASELOWER 55
155 #define F_CASECAPITAL 56
163 #define V_WORDBEGNEXT 60
167 /* F_EXTENDNEXT removed */
171 #define V_REPLMODE 64
175 #define V_SUBSTLINE 66
177 #define V_SUBSTCHAR 67
179 #define V_CHGTOEND 68
181 #define F_LIST_EOF 69
183 #define F_LIST_GLOB 70
185 #define F_EXPAND_HISTORY 71
187 #define F_MAGIC_SPACE 72
191 #define V_CM_COMPLETE 74
193 #define F_COPYPREV 75
195 #define F_CORRECT_L 76
197 #define F_EXPAND_GLOB 77
199 #define F_EXPAND_VARS 78
201 #define F_TOGGLE_HIST 79
207 #define F_LOAD_AVERAGE 82
215 #define V_WORDBACK 86
223 #define V_USH_META 90
225 #define V_DSH_META 91
227 #define V_RSRCH_FWD 92
229 #define V_RSRCH_BACK 93
231 #define V_CHAR_FWD 94
233 #define V_CHAR_BACK 95
239 #define F_INC_BACK 98
241 #define V_RCHAR_FWD 99
243 #define V_RCHAR_BACK 100
245 #define V_CHARTO_FWD 101
247 #define V_CHARTO_BACK 102
249 #define F_PATH_NORM 103
250 e_delnext_eof
, /* added by mtk@ari.ncl.omron.co.jp (920818) */
251 #define F_DELNEXT_EOF 104
253 #define F_STUFF_CHAR 105
255 #define F_COMPLETE_ALL 106
257 #define F_LIST_ALL 107
259 #define F_COMPLETE_FWD 108
261 #define F_COMPLETE_BACK 109
263 #define F_DELNEXT_LIST 110
265 #define F_COMMAND_NORM 111
267 #define F_DABBREV_EXPAND 112
269 #define F_COPY_CLIP 113
270 e_paste_from_clipboard
,
271 #define F_PASTE_CLIP 114
273 #define F_DOSIFY_NEXT 115
275 #define F_DOSIFY_PREV 116
277 #define F_PAGE_UP 117
279 #define F_PAGE_DOWN 118
281 #define F_YANK_POP 119
283 #define F_NEWLINE_HOLD 120
285 #define F_NEWLINE_DOWN_HIST 121
287 #define F_NUM_FNS 122
291 KEYCMD NumFuns
= F_NUM_FNS
;
293 KEYCMD CcKeyMap
[NT_NUM_KEYS
]; /* the real key map */
294 KEYCMD CcAltMap
[NT_NUM_KEYS
]; /* the alternative key map */
295 #define F_NUM_FUNCNAMES (F_NUM_FNS + 2)
296 struct KeyFuncs FuncNames
[F_NUM_FUNCNAMES
];
299 extern KEYCMD CcEmacsMap
[];
300 extern KEYCMD CcViMap
[];
301 extern KEYCMD CcViCmdMap
[];
302 #else /* !WINNT_NATIVE*/
303 KEYCMD CcEmacsMap
[] = {
304 /* keymap table, each index into above tbl; should be 256*sizeof(KEYCMD)
311 F_DELNEXT_LIST_EOF
, /* ^D */
314 F_UNASSIGNED
, /* ^G */
319 F_CLEARDISP
, /* ^L */
321 F_DOWN_HIST
, /* ^N */
322 F_TTY_FLUSHO
, /* ^O */
324 F_TTY_STARTO
, /* ^Q */
326 F_TTY_STOPO
, /* ^S */
327 F_CHARSWITCH
, /* ^T */
330 F_KILLREGION
, /* ^W */
332 F_YANK_KILL
, /* ^Y */
333 F_TTY_TSUSP
, /* ^Z */
336 F_TTY_DSUSP
, /* ^] */
337 F_UNASSIGNED
, /* ^^ */
338 F_UNASSIGNED
, /* ^_ */
339 F_INSERT
, /* SPACE */
435 F_UNASSIGNED
, /* M-^@ */
436 F_UNASSIGNED
, /* M-^A */
437 F_UNASSIGNED
, /* M-^B */
438 F_UNASSIGNED
, /* M-^C */
439 F_LIST_CHOICES
, /* M-^D */
440 F_UNASSIGNED
, /* M-^E */
441 F_UNASSIGNED
, /* M-^F */
442 F_UNASSIGNED
, /* M-^G */
443 F_DELWORDPREV
, /* M-^H */
444 F_COMPLETE
, /* M-^I */
445 F_UNASSIGNED
, /* M-^J */
446 F_UNASSIGNED
, /* M-^K */
447 F_CLEARDISP
, /* M-^L */
448 F_UNASSIGNED
, /* M-^M */
449 F_UNASSIGNED
, /* M-^N */
450 F_UNASSIGNED
, /* M-^O */
451 F_UNASSIGNED
, /* M-^P */
452 F_UNASSIGNED
, /* M-^Q */
453 F_UNASSIGNED
, /* M-^R */
454 F_UNASSIGNED
, /* M-^S */
455 F_UNASSIGNED
, /* M-^T */
456 F_UNASSIGNED
, /* M-^U */
457 F_UNASSIGNED
, /* M-^V */
458 F_UNASSIGNED
, /* M-^W */
459 F_UNASSIGNED
, /* M-^X */
460 F_UNASSIGNED
, /* M-^Y */
461 F_RUN_FG_EDITOR
, /* M-^Z */
462 F_COMPLETE
, /* M-^[ */
463 F_UNASSIGNED
, /* M-^\ */
464 F_UNASSIGNED
, /* M-^] */
465 F_UNASSIGNED
, /* M-^^ */
466 F_COPYPREV
, /* M-^_ */
467 F_EXPAND_HISTORY
, /* M-SPACE */
468 F_EXPAND_HISTORY
, /* M-! */
469 F_UNASSIGNED
, /* M-" */
470 F_UNASSIGNED
, /* M-# */
471 F_CORRECT_L
, /* M-$ */
472 F_UNASSIGNED
, /* M-% */
473 F_UNASSIGNED
, /* M-& */
474 F_UNASSIGNED
, /* M-' */
475 F_UNASSIGNED
, /* M-( */
476 F_UNASSIGNED
, /* M-) */
477 F_UNASSIGNED
, /* M-* */
478 F_UNASSIGNED
, /* M-+ */
479 F_UNASSIGNED
, /* M-, */
480 F_UNASSIGNED
, /* M-- */
481 F_UNASSIGNED
, /* M-. */
482 F_DABBREV_EXPAND
, /* M-/ */
483 F_ARGDIGIT
, /* M-0 */
484 F_ARGDIGIT
, /* M-1 */
485 F_ARGDIGIT
, /* M-2 */
486 F_ARGDIGIT
, /* M-3 */
487 F_ARGDIGIT
, /* M-4 */
488 F_ARGDIGIT
, /* M-5 */
489 F_ARGDIGIT
, /* M-6 */
490 F_ARGDIGIT
, /* M-7 */
491 F_ARGDIGIT
, /* M-8 */
492 F_ARGDIGIT
, /* M-9 */
493 F_UNASSIGNED
, /* M-: */
494 F_UNASSIGNED
, /* M-; */
495 F_UNASSIGNED
, /* M-< */
496 F_UNASSIGNED
, /* M-= */
497 F_UNASSIGNED
, /* M-> */
499 F_UNASSIGNED
, /* M-@ */
500 F_NEWLINE_HOLD
, /* M-A */
501 F_WORDBACK
, /* M-B */
502 F_CASECAPITAL
, /* M-C */
503 F_DELWORDNEXT
, /* M-D */
504 F_UNASSIGNED
, /* M-E */
506 F_UNASSIGNED
, /* M-G */
508 F_UNASSIGNED
, /* M-I */
509 F_UNASSIGNED
, /* M-J */
510 F_UNASSIGNED
, /* M-K */
511 F_CASELOWER
, /* M-L */
512 F_UNASSIGNED
, /* M-M */
513 F_DOWN_SEARCH_HIST
, /* M-N */
514 F_XKEY
, /* M-O *//* extended key esc PWP Mar 88 */
515 F_UP_SEARCH_HIST
, /* M-P */
516 F_UNASSIGNED
, /* M-Q */
517 F_TOGGLE_HIST
, /* M-R */
519 F_UNASSIGNED
, /* M-T */
520 F_CASEUPPER
, /* M-U */
521 F_UNASSIGNED
, /* M-V */
522 F_COPYREGION
, /* M-W */
523 F_UNASSIGNED
, /* M-X */
524 F_YANK_POP
, /* M-Y */
525 F_UNASSIGNED
, /* M-Z */
526 F_XKEY
, /* M-[ *//* extended key esc -mf Oct 87 */
527 F_UNASSIGNED
, /* M-\ */
528 F_UNASSIGNED
, /* M-] */
529 F_UNASSIGNED
, /* M-^ */
530 F_LAST_ITEM
, /* M-_ */
531 F_UNASSIGNED
, /* M-` */
532 F_NEWLINE_HOLD
, /* M-a */
533 F_WORDBACK
, /* M-b */
534 F_CASECAPITAL
, /* M-c */
535 F_DELWORDNEXT
, /* M-d */
536 F_UNASSIGNED
, /* M-e */
538 F_UNASSIGNED
, /* M-g */
540 F_UNASSIGNED
, /* M-i */
541 F_UNASSIGNED
, /* M-j */
542 F_UNASSIGNED
, /* M-k */
543 F_CASELOWER
, /* M-l */
544 F_UNASSIGNED
, /* M-m */
545 F_DOWN_SEARCH_HIST
, /* M-n */
546 F_UNASSIGNED
, /* M-o */
547 F_UP_SEARCH_HIST
, /* M-p */
548 F_UNASSIGNED
, /* M-q */
549 F_TOGGLE_HIST
, /* M-r */
551 F_UNASSIGNED
, /* M-t */
552 F_CASEUPPER
, /* M-u */
553 F_UNASSIGNED
, /* M-v */
554 F_COPYREGION
, /* M-w */
555 F_UNASSIGNED
, /* M-x */
556 F_YANK_POP
, /* M-y */
557 F_UNASSIGNED
, /* M-z */
558 F_UNASSIGNED
, /* M-{ */
559 F_UNASSIGNED
, /* M-| */
560 F_UNASSIGNED
, /* M-} */
561 F_UNASSIGNED
, /* M-~ */
562 F_DELWORDPREV
/* M-^? */
566 * keymap table for vi. Each index into above tbl; should be
567 * 256 entries long. Vi mode uses a sticky-extend to do command mode:
568 * insert mode characters are in the normal keymap, and command mode
569 * in the extended keymap.
571 static KEYCMD CcViMap
[] = {
573 F_UNASSIGNED
, /* ^@ */
581 V_DELPREV
, /* ^H */ /* BackSpace key */
582 F_COMPLETE
, /* ^I */ /* Tab Key */
590 F_TTY_STARTO
, /* ^Q */
596 F_DELWORDPREV
, /* ^W */ /* Only until start edit pos */
600 V_CMD_MODE
, /* ^[ */ /* [ Esc ] key */
606 F_UNASSIGNED
, /* ^@ */ /* NOTE: These mapping do NOT */
607 F_TOBEG
, /* ^A */ /* Correspond well to the KSH */
608 F_CHARBACK
, /* ^B */ /* VI editting assignments */
609 F_TTY_INT
, /* ^C */ /* On the other hand they are */
610 F_LIST_EOF
, /* ^D */ /* convenient any many people */
611 F_TOEND
, /* ^E */ /* have gotten used to them */
613 F_LIST_GLOB
, /* ^G */
614 F_DELPREV
, /* ^H */ /* BackSpace key */
615 F_COMPLETE
, /* ^I */ /* Tab Key */
618 F_CLEARDISP
, /* ^L */
620 F_DOWN_HIST
, /* ^N */
621 F_TTY_FLUSHO
, /* ^O */
623 F_TTY_STARTO
, /* ^Q */
625 F_TTY_STOPO
, /* ^S */
626 F_CHARSWITCH
, /* ^T */
629 F_DELWORDPREV
, /* ^W */
631 F_TTY_DSUSP
, /* ^Y */
632 F_TTY_TSUSP
, /* ^Z */
635 F_UNASSIGNED
, /* ^] */
636 F_UNASSIGNED
, /* ^^ */
637 F_UNASSIGNED
, /* ^_ */
639 F_INSERT
, /* SPACE */
735 F_UNASSIGNED
, /* M-^@ */
736 F_UNASSIGNED
, /* M-^A */
737 F_UNASSIGNED
, /* M-^B */
738 F_UNASSIGNED
, /* M-^C */
739 F_UNASSIGNED
, /* M-^D */
740 F_UNASSIGNED
, /* M-^E */
741 F_UNASSIGNED
, /* M-^F */
742 F_UNASSIGNED
, /* M-^G */
743 F_UNASSIGNED
, /* M-^H */
744 F_UNASSIGNED
, /* M-^I */
745 F_UNASSIGNED
, /* M-^J */
746 F_UNASSIGNED
, /* M-^K */
747 F_UNASSIGNED
, /* M-^L */
748 F_UNASSIGNED
, /* M-^M */
749 F_UNASSIGNED
, /* M-^N */
750 F_UNASSIGNED
, /* M-^O */
751 F_UNASSIGNED
, /* M-^P */
752 F_UNASSIGNED
, /* M-^Q */
753 F_UNASSIGNED
, /* M-^R */
754 F_UNASSIGNED
, /* M-^S */
755 F_UNASSIGNED
, /* M-^T */
756 F_UNASSIGNED
, /* M-^U */
757 F_UNASSIGNED
, /* M-^V */
758 F_UNASSIGNED
, /* M-^W */
759 F_UNASSIGNED
, /* M-^X */
760 F_UNASSIGNED
, /* M-^Y */
761 F_UNASSIGNED
, /* M-^Z */
762 F_UNASSIGNED
, /* M-^[ */
763 F_UNASSIGNED
, /* M-^\ */
764 F_UNASSIGNED
, /* M-^] */
765 F_UNASSIGNED
, /* M-^^ */
766 F_UNASSIGNED
, /* M-^_ */
767 F_UNASSIGNED
, /* M-SPACE */
768 F_UNASSIGNED
, /* M-! */
769 F_UNASSIGNED
, /* M-" */
770 F_UNASSIGNED
, /* M-# */
771 F_UNASSIGNED
, /* M-$ */
772 F_UNASSIGNED
, /* M-% */
773 F_UNASSIGNED
, /* M-& */
774 F_UNASSIGNED
, /* M-' */
775 F_UNASSIGNED
, /* M-( */
776 F_UNASSIGNED
, /* M-) */
777 F_UNASSIGNED
, /* M-* */
778 F_UNASSIGNED
, /* M-+ */
779 F_UNASSIGNED
, /* M-, */
780 F_UNASSIGNED
, /* M-- */
781 F_UNASSIGNED
, /* M-. */
782 F_UNASSIGNED
, /* M-/ */
783 F_UNASSIGNED
, /* M-0 */
784 F_UNASSIGNED
, /* M-1 */
785 F_UNASSIGNED
, /* M-2 */
786 F_UNASSIGNED
, /* M-3 */
787 F_UNASSIGNED
, /* M-4 */
788 F_UNASSIGNED
, /* M-5 */
789 F_UNASSIGNED
, /* M-6 */
790 F_UNASSIGNED
, /* M-7 */
791 F_UNASSIGNED
, /* M-8 */
792 F_UNASSIGNED
, /* M-9 */
793 F_UNASSIGNED
, /* M-: */
794 F_UNASSIGNED
, /* M-; */
795 F_UNASSIGNED
, /* M-< */
796 F_UNASSIGNED
, /* M-= */
797 F_UNASSIGNED
, /* M-> */
798 F_UNASSIGNED
, /* M-? */
799 F_UNASSIGNED
, /* M-@ */
800 F_UNASSIGNED
, /* M-A */
801 F_UNASSIGNED
, /* M-B */
802 F_UNASSIGNED
, /* M-C */
803 F_UNASSIGNED
, /* M-D */
804 F_UNASSIGNED
, /* M-E */
805 F_UNASSIGNED
, /* M-F */
806 F_UNASSIGNED
, /* M-G */
807 F_UNASSIGNED
, /* M-H */
808 F_UNASSIGNED
, /* M-I */
809 F_UNASSIGNED
, /* M-J */
810 F_UNASSIGNED
, /* M-K */
811 F_UNASSIGNED
, /* M-L */
812 F_UNASSIGNED
, /* M-M */
813 F_UNASSIGNED
, /* M-N */
814 F_UNASSIGNED
, /* M-O */
815 F_UNASSIGNED
, /* M-P */
816 F_UNASSIGNED
, /* M-Q */
817 F_UNASSIGNED
, /* M-R */
818 F_UNASSIGNED
, /* M-S */
819 F_UNASSIGNED
, /* M-T */
820 F_UNASSIGNED
, /* M-U */
821 F_UNASSIGNED
, /* M-V */
822 F_UNASSIGNED
, /* M-W */
823 F_UNASSIGNED
, /* M-X */
824 F_UNASSIGNED
, /* M-Y */
825 F_UNASSIGNED
, /* M-Z */
826 F_UNASSIGNED
, /* M-[ */
827 F_UNASSIGNED
, /* M-\ */
828 F_UNASSIGNED
, /* M-] */
829 F_UNASSIGNED
, /* M-^ */
830 F_UNASSIGNED
, /* M-_ */
831 F_UNASSIGNED
, /* M-` */
832 F_UNASSIGNED
, /* M-a */
833 F_UNASSIGNED
, /* M-b */
834 F_UNASSIGNED
, /* M-c */
835 F_UNASSIGNED
, /* M-d */
836 F_UNASSIGNED
, /* M-e */
837 F_UNASSIGNED
, /* M-f */
838 F_UNASSIGNED
, /* M-g */
839 F_UNASSIGNED
, /* M-h */
840 F_UNASSIGNED
, /* M-i */
841 F_UNASSIGNED
, /* M-j */
842 F_UNASSIGNED
, /* M-k */
843 F_UNASSIGNED
, /* M-l */
844 F_UNASSIGNED
, /* M-m */
845 F_UNASSIGNED
, /* M-n */
846 F_UNASSIGNED
, /* M-o */
847 F_UNASSIGNED
, /* M-p */
848 F_UNASSIGNED
, /* M-q */
849 F_UNASSIGNED
, /* M-r */
850 F_UNASSIGNED
, /* M-s */
851 F_UNASSIGNED
, /* M-t */
852 F_UNASSIGNED
, /* M-u */
853 F_UNASSIGNED
, /* M-v */
854 F_UNASSIGNED
, /* M-w */
855 F_UNASSIGNED
, /* M-x */
856 F_UNASSIGNED
, /* M-y */
857 F_UNASSIGNED
, /* M-z */
858 F_UNASSIGNED
, /* M-{ */
859 F_UNASSIGNED
, /* M-| */
860 F_UNASSIGNED
, /* M-} */
861 F_UNASSIGNED
, /* M-~ */
862 F_UNASSIGNED
/* M-^? */
865 KEYCMD CcViCmdMap
[] = {
866 F_UNASSIGNED
, /* ^@ */
868 F_UNASSIGNED
, /* ^B */
870 F_LIST_CHOICES
, /* ^D */
872 F_UNASSIGNED
, /* ^F */
873 F_LIST_GLOB
, /* ^G */
875 V_CM_COMPLETE
, /* ^I */
878 F_CLEARDISP
, /* ^L */
880 F_DOWN_HIST
, /* ^N */
881 F_TTY_FLUSHO
, /* ^O */
883 F_TTY_STARTO
, /* ^Q */
885 F_TTY_STOPO
, /* ^S */
886 F_UNASSIGNED
, /* ^T */
888 F_UNASSIGNED
, /* ^V */
889 F_DELWORDPREV
, /* ^W */
891 F_UNASSIGNED
, /* ^Y */
892 F_UNASSIGNED
, /* ^Z */
895 F_UNASSIGNED
, /* ^] */
896 F_UNASSIGNED
, /* ^^ */
897 F_UNASSIGNED
, /* ^_ */
898 F_CHARFWD
, /* SPACE */
899 F_EXPAND_HISTORY
, /* ! */
900 F_UNASSIGNED
, /* " */
901 F_UNASSIGNED
, /* # */
903 F_UNASSIGNED
, /* % */
904 F_UNASSIGNED
, /* & */
905 F_UNASSIGNED
, /* ' */
906 F_UNASSIGNED
, /* ( */
907 F_UNASSIGNED
, /* ) */
908 F_EXPAND_GLOB
, /* * */
910 V_RCHAR_BACK
, /* , */
912 F_UNASSIGNED
, /* . */
924 F_UNASSIGNED
, /* : */
926 F_UNASSIGNED
, /* < */
927 F_UNASSIGNED
, /* = */
928 F_UNASSIGNED
, /* > */
930 F_UNASSIGNED
, /* @ */
937 F_UNASSIGNED
, /* G */
938 F_UNASSIGNED
, /* H */
940 F_DOWN_SEARCH_HIST
, /* J */
941 F_UP_SEARCH_HIST
, /* K */
942 F_UNASSIGNED
, /* L */
943 F_UNASSIGNED
, /* M */
944 V_RSRCH_BACK
, /* N */
946 F_UNASSIGNED
, /* P */
947 F_UNASSIGNED
, /* Q */
950 V_CHARTO_BACK
, /* T */
951 F_UNASSIGNED
, /* U */
952 F_EXPAND_VARS
, /* V */
955 F_UNASSIGNED
, /* Y */
956 F_UNASSIGNED
, /* Z */
958 F_UNASSIGNED
, /* \ */
959 F_UNASSIGNED
, /* ] */
961 F_UNASSIGNED
, /* _ */
962 F_UNASSIGNED
, /* ` */
969 F_UNASSIGNED
, /* g */
975 F_UNASSIGNED
, /* m */
977 F_UNASSIGNED
, /* o */
978 F_UNASSIGNED
, /* p */
979 F_UNASSIGNED
, /* q */
982 V_CHARTO_FWD
, /* t */
984 F_EXPAND_VARS
, /* v */
985 V_WORDBEGNEXT
, /* w */
986 F_DELNEXT_EOF
, /* x */
987 F_UNASSIGNED
, /* y */
988 F_UNASSIGNED
, /* z */
989 F_UNASSIGNED
, /* { */
990 F_UNASSIGNED
, /* | */
991 F_UNASSIGNED
, /* } */
994 F_UNASSIGNED
, /* M-^@ */
995 F_UNASSIGNED
, /* M-^A */
996 F_UNASSIGNED
, /* M-^B */
997 F_UNASSIGNED
, /* M-^C */
998 F_UNASSIGNED
, /* M-^D */
999 F_UNASSIGNED
, /* M-^E */
1000 F_UNASSIGNED
, /* M-^F */
1001 F_UNASSIGNED
, /* M-^G */
1002 F_UNASSIGNED
, /* M-^H */
1003 F_UNASSIGNED
, /* M-^I */
1004 F_UNASSIGNED
, /* M-^J */
1005 F_UNASSIGNED
, /* M-^K */
1006 F_UNASSIGNED
, /* M-^L */
1007 F_UNASSIGNED
, /* M-^M */
1008 F_UNASSIGNED
, /* M-^N */
1009 F_UNASSIGNED
, /* M-^O */
1010 F_UNASSIGNED
, /* M-^P */
1011 F_UNASSIGNED
, /* M-^Q */
1012 F_UNASSIGNED
, /* M-^R */
1013 F_UNASSIGNED
, /* M-^S */
1014 F_UNASSIGNED
, /* M-^T */
1015 F_UNASSIGNED
, /* M-^U */
1016 F_UNASSIGNED
, /* M-^V */
1017 F_UNASSIGNED
, /* M-^W */
1018 F_UNASSIGNED
, /* M-^X */
1019 F_UNASSIGNED
, /* M-^Y */
1020 F_UNASSIGNED
, /* M-^Z */
1021 F_UNASSIGNED
, /* M-^[ */
1022 F_UNASSIGNED
, /* M-^\ */
1023 F_UNASSIGNED
, /* M-^] */
1024 F_UNASSIGNED
, /* M-^^ */
1025 F_UNASSIGNED
, /* M-^_ */
1026 F_UNASSIGNED
, /* M-SPACE */
1027 F_UNASSIGNED
, /* M-! */
1028 F_UNASSIGNED
, /* M-" */
1029 F_UNASSIGNED
, /* M-# */
1030 F_UNASSIGNED
, /* M-$ */
1031 F_UNASSIGNED
, /* M-% */
1032 F_UNASSIGNED
, /* M-& */
1033 F_UNASSIGNED
, /* M-' */
1034 F_UNASSIGNED
, /* M-( */
1035 F_UNASSIGNED
, /* M-) */
1036 F_UNASSIGNED
, /* M-* */
1037 F_UNASSIGNED
, /* M-+ */
1038 F_UNASSIGNED
, /* M-, */
1039 F_UNASSIGNED
, /* M-- */
1040 F_UNASSIGNED
, /* M-. */
1041 F_UNASSIGNED
, /* M-/ */
1042 F_UNASSIGNED
, /* M-0 */
1043 F_UNASSIGNED
, /* M-1 */
1044 F_UNASSIGNED
, /* M-2 */
1045 F_UNASSIGNED
, /* M-3 */
1046 F_UNASSIGNED
, /* M-4 */
1047 F_UNASSIGNED
, /* M-5 */
1048 F_UNASSIGNED
, /* M-6 */
1049 F_UNASSIGNED
, /* M-7 */
1050 F_UNASSIGNED
, /* M-8 */
1051 F_UNASSIGNED
, /* M-9 */
1052 F_UNASSIGNED
, /* M-: */
1053 F_UNASSIGNED
, /* M-; */
1054 F_UNASSIGNED
, /* M-< */
1055 F_UNASSIGNED
, /* M-= */
1056 F_UNASSIGNED
, /* M-> */
1058 F_UNASSIGNED
, /* M-@ */
1059 F_UNASSIGNED
, /* M-A */
1060 F_UNASSIGNED
, /* M-B */
1061 F_UNASSIGNED
, /* M-C */
1062 F_UNASSIGNED
, /* M-D */
1063 F_UNASSIGNED
, /* M-E */
1064 F_UNASSIGNED
, /* M-F */
1065 F_UNASSIGNED
, /* M-G */
1066 F_UNASSIGNED
, /* M-H */
1067 F_UNASSIGNED
, /* M-I */
1068 F_UNASSIGNED
, /* M-J */
1069 F_UNASSIGNED
, /* M-K */
1070 F_UNASSIGNED
, /* M-L */
1071 F_UNASSIGNED
, /* M-M */
1072 F_UNASSIGNED
, /* M-N */
1073 F_XKEY
, /* M-O *//* extended key esc PWP Mar 88 */
1074 F_UNASSIGNED
, /* M-P */
1075 F_UNASSIGNED
, /* M-Q */
1076 F_UNASSIGNED
, /* M-R */
1077 F_UNASSIGNED
, /* M-S */
1078 F_UNASSIGNED
, /* M-T */
1079 F_UNASSIGNED
, /* M-U */
1080 F_UNASSIGNED
, /* M-V */
1081 F_UNASSIGNED
, /* M-W */
1082 F_UNASSIGNED
, /* M-X */
1083 F_UNASSIGNED
, /* M-Y */
1084 F_UNASSIGNED
, /* M-Z */
1085 F_XKEY
, /* M-[ *//* extended key esc -mf Oct 87 */
1086 F_UNASSIGNED
, /* M-\ */
1087 F_UNASSIGNED
, /* M-] */
1088 F_UNASSIGNED
, /* M-^ */
1089 F_UNASSIGNED
, /* M-_ */
1090 F_UNASSIGNED
, /* M-` */
1091 F_UNASSIGNED
, /* M-a */
1092 F_UNASSIGNED
, /* M-b */
1093 F_UNASSIGNED
, /* M-c */
1094 F_UNASSIGNED
, /* M-d */
1095 F_UNASSIGNED
, /* M-e */
1096 F_UNASSIGNED
, /* M-f */
1097 F_UNASSIGNED
, /* M-g */
1098 F_UNASSIGNED
, /* M-h */
1099 F_UNASSIGNED
, /* M-i */
1100 F_UNASSIGNED
, /* M-j */
1101 F_UNASSIGNED
, /* M-k */
1102 F_UNASSIGNED
, /* M-l */
1103 F_UNASSIGNED
, /* M-m */
1104 F_UNASSIGNED
, /* M-n */
1105 F_UNASSIGNED
, /* M-o */
1106 F_UNASSIGNED
, /* M-p */
1107 F_UNASSIGNED
, /* M-q */
1108 F_UNASSIGNED
, /* M-r */
1109 F_UNASSIGNED
, /* M-s */
1110 F_UNASSIGNED
, /* M-t */
1111 F_UNASSIGNED
, /* M-u */
1112 F_UNASSIGNED
, /* M-v */
1113 F_UNASSIGNED
, /* M-w */
1114 F_UNASSIGNED
, /* M-x */
1115 F_UNASSIGNED
, /* M-y */
1116 F_UNASSIGNED
, /* M-z */
1117 F_UNASSIGNED
, /* M-{ */
1118 F_UNASSIGNED
, /* M-| */
1119 F_UNASSIGNED
, /* M-} */
1120 F_UNASSIGNED
, /* M-~ */
1121 F_UNASSIGNED
/* M-^? */
1123 #endif /* WINNT_NATIVE */
1131 #if defined(NLS_CATALOGS) || defined(WINNT_NATIVE)
1134 for (i
= 0; i
< F_NUM_FUNCNAMES
; i
++)
1135 xfree((ptr_t
)(intptr_t)FuncNames
[i
].desc
);
1139 f
->name
= "backward-char";
1140 f
->func
= F_CHARBACK
;
1141 f
->desc
= CSAVS(3, 1, "Move back a character");
1144 f
->name
= "backward-delete-char";
1145 f
->func
= F_DELPREV
;
1146 f
->desc
= CSAVS(3, 2, "Delete the character behind cursor");
1149 f
->name
= "backward-delete-word";
1150 f
->func
= F_DELWORDPREV
;
1151 f
->desc
= CSAVS(3, 3,
1152 "Cut from beginning of current word to cursor - saved in cut buffer");
1155 f
->name
= "backward-kill-line";
1156 f
->func
= F_KILLBEG
;
1157 f
->desc
= CSAVS(3, 4,
1158 "Cut from beginning of line to cursor - save in cut buffer");
1161 f
->name
= "backward-word";
1162 f
->func
= F_WORDBACK
;
1163 f
->desc
= CSAVS(3, 5, "Move to beginning of current word");
1166 f
->name
= "beginning-of-line";
1168 f
->desc
= CSAVS(3, 6, "Move to beginning of line");
1171 f
->name
= "capitalize-word";
1172 f
->func
= F_CASECAPITAL
;
1173 f
->desc
= CSAVS(3, 7,
1174 "Capitalize the characters from cursor to end of current word");
1177 f
->name
= "change-case";
1178 f
->func
= V_CHGCASE
;
1179 f
->desc
= CSAVS(3, 8,
1180 "Vi change case of character under cursor and advance one character");
1183 f
->name
= "change-till-end-of-line";
1184 f
->func
= V_CHGTOEND
; /* backward compat. */
1185 f
->desc
= CSAVS(3, 9, "Vi change to end of line");
1188 f
->name
= "clear-screen";
1189 f
->func
= F_CLEARDISP
;
1190 f
->desc
= CSAVS(3, 10, "Clear screen leaving current line on top");
1193 f
->name
= "complete-word";
1194 f
->func
= F_COMPLETE
;
1195 f
->desc
= CSAVS(3, 11, "Complete current word");
1198 f
->name
= "complete-word-fwd";
1199 f
->func
= F_COMPLETE_FWD
;
1200 f
->desc
= CSAVS(3, 12, "Tab forward through files");
1203 f
->name
= "complete-word-back";
1204 f
->func
= F_COMPLETE_BACK
;
1205 f
->desc
= CSAVS(3, 13, "Tab backward through files");
1208 f
->name
= "complete-word-raw";
1209 f
->func
= F_COMPLETE_ALL
;
1210 f
->desc
= CSAVS(3, 14,
1211 "Complete current word ignoring programmable completions");
1214 f
->name
= "copy-prev-word";
1215 f
->func
= F_COPYPREV
;
1216 f
->desc
= CSAVS(3, 15, "Copy current word to cursor");
1219 f
->name
= "copy-region-as-kill";
1220 f
->func
= F_COPYREGION
;
1221 f
->desc
= CSAVS(3, 16, "Copy area between mark and cursor to cut buffer");
1224 f
->name
= "dabbrev-expand";
1225 f
->func
= F_DABBREV_EXPAND
;
1226 f
->desc
= CSAVS(3, 17,
1227 "Expand to preceding word for which this is a prefix");
1230 f
->name
= "delete-char";
1231 f
->func
= F_DELNEXT
;
1232 f
->desc
= CSAVS(3, 18, "Delete character under cursor");
1235 f
->name
= "delete-char-or-eof";
1236 f
->func
= F_DELNEXT_EOF
;
1237 f
->desc
= CSAVS(3, 19,
1238 "Delete character under cursor or signal end of file on an empty line");
1241 f
->name
= "delete-char-or-list";
1242 f
->func
= F_DELNEXT_LIST
;
1243 f
->desc
= CSAVS(3, 20,
1244 "Delete character under cursor or list completions if at end of line");
1247 f
->name
= "delete-char-or-list-or-eof";
1248 f
->func
= F_DELNEXT_LIST_EOF
;
1249 f
->desc
= CSAVS(3, 21,
1250 "Delete character under cursor, list completions or signal end of file");
1253 f
->name
= "delete-word";
1254 f
->func
= F_DELWORDNEXT
;
1255 f
->desc
= CSAVS(3, 22,
1256 "Cut from cursor to end of current word - save in cut buffer");
1261 f
->desc
= CSAVS(3, 23, "Adds to argument if started or enters digit");
1264 f
->name
= "digit-argument";
1265 f
->func
= F_ARGDIGIT
;
1266 f
->desc
= CSAVS(3, 24, "Digit that starts argument");
1269 f
->name
= "down-history";
1270 f
->func
= F_DOWN_HIST
;
1271 f
->desc
= CSAVS(3, 25, "Move to next history line");
1274 f
->name
= "downcase-word";
1275 f
->func
= F_CASELOWER
;
1276 f
->desc
= CSAVS(3, 26,
1277 "Lowercase the characters from cursor to end of current word");
1280 f
->name
= "end-of-file";
1281 f
->func
= F_SEND_EOF
;
1282 f
->desc
= CSAVS(3, 27, "Indicate end of file");
1285 f
->name
= "end-of-line";
1287 f
->desc
= CSAVS(3, 28, "Move cursor to end of line");
1290 f
->name
= "exchange-point-and-mark";
1291 f
->func
= F_EXCHANGE_MARK
;
1292 f
->desc
= CSAVS(3, 29, "Exchange the cursor and mark");
1295 f
->name
= "expand-glob";
1296 f
->func
= F_EXPAND_GLOB
;
1297 f
->desc
= CSAVS(3, 30, "Expand file name wildcards");
1300 f
->name
= "expand-history";
1301 f
->func
= F_EXPAND_HISTORY
;
1302 f
->desc
= CSAVS(3, 31, "Expand history escapes");
1305 f
->name
= "expand-line";
1307 f
->desc
= CSAVS(3, 32, "Expand the history escapes in a line");
1310 f
->name
= "expand-variables";
1311 f
->func
= F_EXPAND_VARS
;
1312 f
->desc
= CSAVS(3, 33, "Expand variables");
1315 f
->name
= "forward-char";
1316 f
->func
= F_CHARFWD
;
1317 f
->desc
= CSAVS(3, 34, "Move forward one character");
1320 f
->name
= "forward-word";
1321 f
->func
= F_WORDFWD
;
1322 f
->desc
= CSAVS(3, 35, "Move forward to end of current word");
1325 f
->name
= "gosmacs-transpose-chars";
1326 f
->func
= F_GCHARSWITCH
;
1327 f
->desc
= CSAVS(3, 36, "Exchange the two characters before the cursor");
1330 f
->name
= "history-search-backward";
1331 f
->func
= F_UP_SEARCH_HIST
;
1332 f
->desc
= CSAVS(3, 37,
1333 "Search in history backward for line beginning as current");
1336 f
->name
= "history-search-forward";
1337 f
->func
= F_DOWN_SEARCH_HIST
;
1338 f
->desc
= CSAVS(3, 38,
1339 "Search in history forward for line beginning as current");
1342 f
->name
= "insert-last-word";
1343 f
->func
= F_LAST_ITEM
;
1344 f
->desc
= CSAVS(3, 39, "Insert last item of previous command");
1347 f
->name
= "i-search-fwd";
1348 f
->func
= F_INC_FWD
;
1349 f
->desc
= CSAVS(3, 40, "Incremental search forward");
1352 f
->name
= "i-search-back";
1353 f
->func
= F_INC_BACK
;
1354 f
->desc
= CSAVS(3, 41, "Incremental search backward");
1357 f
->name
= "keyboard-quit";
1358 f
->func
= F_STARTOVER
;
1359 f
->desc
= CSAVS(3, 42, "Clear line");
1362 f
->name
= "kill-line";
1363 f
->func
= F_KILLEND
;
1364 f
->desc
= CSAVS(3, 43, "Cut to end of line and save in cut buffer");
1367 f
->name
= "kill-region";
1368 f
->func
= F_KILLREGION
;
1369 f
->desc
= CSAVS(3, 44,
1370 "Cut area between mark and cursor and save in cut buffer");
1373 f
->name
= "kill-whole-line";
1374 f
->func
= F_KILLALL
;
1375 f
->desc
= CSAVS(3, 45, "Cut the entire line and save in cut buffer");
1378 f
->name
= "list-choices";
1379 f
->func
= F_LIST_CHOICES
;
1380 f
->desc
= CSAVS(3, 46, "List choices for completion");
1383 f
->name
= "list-choices-raw";
1384 f
->func
= F_LIST_ALL
;
1385 f
->desc
= CSAVS(3, 47,
1386 "List choices for completion overriding programmable completion");
1389 f
->name
= "list-glob";
1390 f
->func
= F_LIST_GLOB
;
1391 f
->desc
= CSAVS(3, 48, "List file name wildcard matches");
1394 f
->name
= "list-or-eof";
1395 f
->func
= F_LIST_EOF
;
1396 f
->desc
= CSAVS(3, 49,
1397 "List choices for completion or indicate end of file if empty line");
1400 f
->name
= "load-average";
1401 f
->func
= F_LOAD_AVERAGE
;
1402 f
->desc
= CSAVS(3, 50, "Display load average and current process status");
1405 f
->name
= "magic-space";
1406 f
->func
= F_MAGIC_SPACE
;
1407 f
->desc
= CSAVS(3, 51, "Expand history escapes and insert a space");
1410 f
->name
= "newline";
1411 f
->func
= F_NEWLINE
;
1412 f
->desc
= CSAVS(3, 52, "Execute command");
1415 f
->name
= "newline-and-hold";
1416 f
->func
= F_NEWLINE_HOLD
;
1417 f
->desc
= CSAVS(3, 122, "Execute command and keep current line");
1420 f
->name
= "newline-and-down-history";
1421 f
->func
= F_NEWLINE_DOWN_HIST
;
1422 f
->desc
= CSAVS(3, 123, "Execute command and move to next history line");
1425 f
->name
= "normalize-path";
1426 f
->func
= F_PATH_NORM
;
1427 f
->desc
= CSAVS(3, 53,
1428 "Expand pathnames, eliminating leading .'s and ..'s");
1431 f
->name
= "normalize-command";
1432 f
->func
= F_COMMAND_NORM
;
1433 f
->desc
= CSAVS(3, 54,
1434 "Expand commands to the resulting pathname or alias");
1437 f
->name
= "overwrite-mode";
1439 f
->desc
= CSAVS(3, 55,
1440 "Switch from insert to overwrite mode or vice versa");
1443 f
->name
= "prefix-meta";
1444 f
->func
= F_METANEXT
;
1445 f
->desc
= CSAVS(3, 56, "Add 8th bit to next character typed");
1448 f
->name
= "quoted-insert";
1450 f
->desc
= CSAVS(3, 57, "Add the next character typed to the line verbatim");
1453 f
->name
= "redisplay";
1455 f
->desc
= CSAVS(3, 58, "Redisplay everything");
1458 f
->name
= "run-fg-editor";
1459 f
->func
= F_RUN_FG_EDITOR
;
1460 f
->desc
= CSAVS(3, 59, "Restart stopped editor");
1463 f
->name
= "run-help";
1465 f
->desc
= CSAVS(3, 60, "Look for help on current command");
1468 f
->name
= "self-insert-command";
1470 f
->desc
= CSAVS(3, 61, "This character is added to the line");
1473 f
->name
= "sequence-lead-in";
1475 f
->desc
= CSAVS(3, 62,
1476 "This character is the first in a character sequence");
1479 f
->name
= "set-mark-command";
1480 f
->func
= F_SET_MARK
;
1481 f
->desc
= CSAVS(3, 63, "Set the mark at cursor");
1484 f
->name
= "spell-word";
1485 f
->func
= F_CORRECT
;
1486 f
->desc
= CSAVS(3, 64, "Correct the spelling of current word");
1489 f
->name
= "spell-line";
1490 f
->func
= F_CORRECT_L
;
1491 f
->desc
= CSAVS(3, 65, "Correct the spelling of entire line");
1494 f
->name
= "stuff-char";
1495 f
->func
= F_STUFF_CHAR
;
1496 f
->desc
= CSAVS(3, 66, "Send character to tty in cooked mode");
1499 f
->name
= "toggle-literal-history";
1500 f
->func
= F_TOGGLE_HIST
;
1501 f
->desc
= CSAVS(3, 67,
1502 "Toggle between literal and lexical current history line");
1505 f
->name
= "transpose-chars";
1506 f
->func
= F_CHARSWITCH
;
1507 f
->desc
= CSAVS(3, 68,
1508 "Exchange the character to the left of the cursor with the one under");
1511 f
->name
= "transpose-gosling";
1512 f
->func
= F_GCHARSWITCH
;
1513 f
->desc
= CSAVS(3, 69, "Exchange the two characters before the cursor");
1516 f
->name
= "tty-dsusp";
1517 f
->func
= F_TTY_DSUSP
;
1518 f
->desc
= CSAVS(3, 70, "Tty delayed suspend character");
1521 f
->name
= "tty-flush-output";
1522 f
->func
= F_TTY_FLUSHO
;
1523 f
->desc
= CSAVS(3, 71, "Tty flush output character");
1526 f
->name
= "tty-sigintr";
1527 f
->func
= F_TTY_INT
;
1528 f
->desc
= CSAVS(3, 72, "Tty interrupt character");
1531 f
->name
= "tty-sigquit";
1532 f
->func
= F_TTY_QUIT
;
1533 f
->desc
= CSAVS(3, 73, "Tty quit character");
1536 f
->name
= "tty-sigtsusp";
1537 f
->func
= F_TTY_TSUSP
;
1538 f
->desc
= CSAVS(3, 74, "Tty suspend character");
1541 f
->name
= "tty-start-output";
1542 f
->func
= F_TTY_STARTO
;
1543 f
->desc
= CSAVS(3, 75, "Tty allow output character");
1546 f
->name
= "tty-stop-output";
1547 f
->func
= F_TTY_STOPO
;
1548 f
->desc
= CSAVS(3, 76, "Tty disallow output character");
1551 f
->name
= "undefined-key";
1552 f
->func
= F_UNASSIGNED
;
1553 f
->desc
= CSAVS(3, 77, "Indicates unbound character");
1556 f
->name
= "universal-argument";
1557 f
->func
= F_ARGFOUR
;
1558 f
->desc
= CSAVS(3, 78, "Emacs universal argument (argument times 4)");
1561 f
->name
= "up-history";
1562 f
->func
= F_UP_HIST
;
1563 f
->desc
= CSAVS(3, 79, "Move to previous history line");
1566 f
->name
= "upcase-word";
1567 f
->func
= F_CASEUPPER
;
1568 f
->desc
= CSAVS(3, 80,
1569 "Uppercase the characters from cursor to end of current word");
1572 f
->name
= "vi-beginning-of-next-word";
1573 f
->func
= V_WORDBEGNEXT
;
1574 f
->desc
= CSAVS(3, 81, "Vi goto the beginning of next word");
1579 f
->desc
= CSAVS(3, 82, "Vi enter insert mode after the cursor");
1582 f
->name
= "vi-add-at-eol";
1584 f
->desc
= CSAVS(3, 83, "Vi enter insert mode at end of line");
1587 f
->name
= "vi-chg-case";
1588 f
->func
= V_CHGCASE
;
1589 f
->desc
= CSAVS(3, 84,
1590 "Vi change case of character under cursor and advance one character");
1593 f
->name
= "vi-chg-meta";
1594 f
->func
= V_CHGMETA
;
1595 f
->desc
= CSAVS(3, 85, "Vi change prefix command");
1598 f
->name
= "vi-chg-to-eol";
1599 f
->func
= V_CHGTOEND
;
1600 f
->desc
= CSAVS(3, 86, "Vi change to end of line");
1603 f
->name
= "vi-cmd-mode";
1604 f
->func
= V_CMD_MODE
;
1605 f
->desc
= CSAVS(3, 87,
1606 "Enter vi command mode (use alternative key bindings)");
1609 f
->name
= "vi-cmd-mode-complete";
1610 f
->func
= V_CM_COMPLETE
;
1611 f
->desc
= CSAVS(3, 88, "Vi command mode complete current word");
1614 f
->name
= "vi-delprev";
1615 f
->func
= V_DELPREV
;
1616 f
->desc
= CSAVS(3, 89, "Vi move to previous character (backspace)");
1619 f
->name
= "vi-delmeta";
1620 f
->func
= V_DELMETA
;
1621 f
->desc
= CSAVS(3, 90, "Vi delete prefix command");
1624 f
->name
= "vi-endword";
1625 f
->func
= V_ENDWORD
;
1626 f
->desc
= CSAVS(3, 91,
1627 "Vi move to the end of the current space delimited word");
1630 f
->name
= "vi-eword";
1632 f
->desc
= CSAVS(3, 92, "Vi move to the end of the current word");
1635 f
->name
= "vi-char-back";
1636 f
->func
= V_CHAR_BACK
;
1637 f
->desc
= CSAVS(3, 93, "Vi move to the character specified backward");
1640 f
->name
= "vi-char-fwd";
1641 f
->func
= V_CHAR_FWD
;
1642 f
->desc
= CSAVS(3, 94, "Vi move to the character specified forward");
1645 f
->name
= "vi-charto-back";
1646 f
->func
= V_CHARTO_BACK
;
1647 f
->desc
= CSAVS(3, 95, "Vi move up to the character specified backward");
1650 f
->name
= "vi-charto-fwd";
1651 f
->func
= V_CHARTO_FWD
;
1652 f
->desc
= CSAVS(3, 96, "Vi move up to the character specified forward");
1655 f
->name
= "vi-insert";
1657 f
->desc
= CSAVS(3, 97, "Enter vi insert mode");
1660 f
->name
= "vi-insert-at-bol";
1662 f
->desc
= CSAVS(3, 98, "Enter vi insert mode at beginning of line");
1665 f
->name
= "vi-repeat-char-fwd";
1666 f
->func
= V_RCHAR_FWD
;
1667 f
->desc
= CSAVS(3, 99,
1668 "Vi repeat current character search in the same search direction");
1671 f
->name
= "vi-repeat-char-back";
1672 f
->func
= V_RCHAR_BACK
;
1673 f
->desc
= CSAVS(3, 100,
1674 "Vi repeat current character search in the opposite search direction");
1677 f
->name
= "vi-repeat-search-fwd";
1678 f
->func
= V_RSRCH_FWD
;
1679 f
->desc
= CSAVS(3, 101,
1680 "Vi repeat current search in the same search direction");
1683 f
->name
= "vi-repeat-search-back";
1684 f
->func
= V_RSRCH_BACK
;
1685 f
->desc
= CSAVS(3, 102,
1686 "Vi repeat current search in the opposite search direction");
1689 f
->name
= "vi-replace-char";
1690 f
->func
= V_REPLONE
;
1691 f
->desc
= CSAVS(3, 103,
1692 "Vi replace character under the cursor with the next character typed");
1695 f
->name
= "vi-replace-mode";
1696 f
->func
= V_REPLMODE
;
1697 f
->desc
= CSAVS(3, 104, "Vi replace mode");
1700 f
->name
= "vi-search-back";
1701 f
->func
= V_USH_META
;
1702 f
->desc
= CSAVS(3, 105, "Vi search history backward");
1705 f
->name
= "vi-search-fwd";
1706 f
->func
= V_DSH_META
;
1707 f
->desc
= CSAVS(3, 106, "Vi search history forward");
1710 f
->name
= "vi-substitute-char";
1711 f
->func
= V_SUBSTCHAR
;
1712 f
->desc
= CSAVS(3, 107,
1713 "Vi replace character under the cursor and enter insert mode");
1716 f
->name
= "vi-substitute-line";
1717 f
->func
= V_SUBSTLINE
;
1718 f
->desc
= CSAVS(3, 108, "Vi replace entire line");
1721 f
->name
= "vi-word-back";
1722 f
->func
= V_WORDBACK
;
1723 f
->desc
= CSAVS(3, 109, "Vi move to the previous word");
1726 f
->name
= "vi-word-fwd";
1727 f
->func
= V_WORDFWD
;
1728 f
->desc
= CSAVS(3, 110, "Vi move to the next word");
1731 f
->name
= "vi-undo";
1733 f
->desc
= CSAVS(3, 111, "Vi undo last change");
1736 f
->name
= "vi-zero";
1738 f
->desc
= CSAVS(3, 112, "Vi goto the beginning of line");
1741 f
->name
= "which-command";
1743 f
->desc
= CSAVS(3, 113, "Perform which of current command");
1747 f
->func
= F_YANK_KILL
;
1748 f
->desc
= CSAVS(3, 114, "Paste cut buffer at cursor position");
1751 f
->name
= "yank-pop";
1752 f
->func
= F_YANK_POP
;
1753 f
->desc
= CSAVS(3, 115,
1754 "Replace just-yanked text with yank from earlier kill");
1757 f
->name
= "e_copy_to_clipboard";
1758 f
->func
= F_COPY_CLIP
;
1759 f
->desc
= CSAVS(3, 116,
1760 "(WIN32 only) Copy cut buffer to system clipboard");
1763 f
->name
= "e_paste_from_clipboard";
1764 f
->func
= F_PASTE_CLIP
;
1765 f
->desc
= CSAVS(3, 117,
1766 "(WIN32 only) Paste clipboard buffer at cursor position");
1769 f
->name
= "e_dosify_next";
1770 f
->func
= F_DOSIFY_NEXT
;
1771 f
->desc
= CSAVS(3, 118,
1772 "(WIN32 only) Convert each '/' in next word to '\\\\'");
1775 f
->name
= "e_dosify_prev";
1776 f
->func
= F_DOSIFY_PREV
;
1777 f
->desc
= CSAVS(3, 119,
1778 "(WIN32 only) Convert each '/' in previous word to '\\\\'");
1781 f
->name
= "e_page_up";
1782 f
->func
= F_PAGE_UP
;
1783 f
->desc
= CSAVS(3, 120, "(WIN32 only) Page visible console window up");
1786 f
->name
= "e_page_down";
1787 f
->func
= F_PAGE_DOWN
;
1788 f
->desc
= CSAVS(3, 121, "(WIN32 only) Page visible console window down");
1796 if (f
- FuncNames
!= F_NUM_FUNCNAMES
)
1803 { /* check the size of the key maps */
1804 int c1
= (NT_NUM_KEYS
* sizeof(KEYCMD
));
1806 if ((sizeof(CcKeyMap
)) != c1
)
1807 xprintf("CcKeyMap should be %d entries, but is %d.\r\n",
1808 NT_NUM_KEYS
, sizeof(CcKeyMap
) / sizeof(KEYCMD
)));
1810 if ((sizeof(CcAltMap
)) != c1
)
1811 xprintf("CcAltMap should be %d entries, but is %d.\r\n",
1812 NT_NUM_KEYS
, (sizeof(CcAltMap
) / sizeof(KEYCMD
)));
1814 if ((sizeof(CcEmacsMap
)) != c1
)
1815 xprintf("CcEmacsMap should be %d entries, but is %d.\r\n",
1816 NT_NUM_KEYS
, (sizeof(CcEmacsMap
) / sizeof(KEYCMD
)));
1818 if ((sizeof(CcViMap
)) != c1
)
1819 xprintf("CcViMap should be %d entries, but is %d.\r\n",
1820 NT_NUM_KEYS
, (sizeof(CcViMap
) / sizeof(KEYCMD
)));
1822 if ((sizeof(CcViCmdMap
)) != c1
)
1823 xprintf("CcViCmdMap should be %d entries, but is %d.\r\n",
1824 NT_NUM_KEYS
, (sizeof(CcViCmdMap
) / sizeof(KEYCMD
)));
1829 int MapsAreInited
= 0;
1830 int NLSMapsAreInited
= 0;
1834 ed_InitNLSMaps(void)
1842 for (i
= 0200; i
<= 0377; i
++) {
1843 if (Isprint(CTL_ESC(i
))) {
1844 CcKeyMap
[CTL_ESC(i
)] = F_INSERT
;
1847 NLSMapsAreInited
= 1;
1851 ed_InitMetaBindings(void)
1859 for (i
= 0; i
<= 0377 && CcKeyMap
[CTL_ESC(i
)] != F_METANEXT
; i
++)
1862 for (i
= 0; i
<= 0377 && CcAltMap
[CTL_ESC(i
)] != F_METANEXT
; i
++)
1873 buf
[0] = (Char
)CTL_ESC(i
);
1877 for (i
= 0200; i
<= 0377; i
++) {
1878 if (map
[CTL_ESC(i
)] != F_INSERT
&& map
[CTL_ESC(i
)] != F_UNASSIGNED
&& map
[CTL_ESC(i
)] != F_XKEY
) {
1879 buf
[1] = CTL_ESC(i
& ASCII
);
1880 AddXkey(&cstr
, XmapCmd((int) map
[CTL_ESC(i
)]), XK_CMD
);
1883 map
[buf
[0]] = F_XKEY
;
1893 for (i
= 0; i
< NT_NUM_KEYS
; i
++) {
1894 CcKeyMap
[i
] = CcViMap
[i
];
1895 CcAltMap
[i
] = CcViCmdMap
[i
];
1897 ed_InitMetaBindings();
1904 ed_InitEmacsMaps(void)
1914 for (i
= 0; i
< NT_NUM_KEYS
; i
++) {
1915 CcKeyMap
[i
] = CcEmacsMap
[i
];
1916 CcAltMap
[i
] = F_UNASSIGNED
;
1918 ed_InitMetaBindings();
1920 buf
[0] = CTL_ESC('\030');
1922 buf
[1] = CTL_ESC('\030');
1923 AddXkey(&cstr
, XmapCmd(F_EXCHANGE_MARK
), XK_CMD
);
1925 AddXkey(&cstr
, XmapCmd(F_EXPAND_GLOB
), XK_CMD
);
1927 AddXkey(&cstr
, XmapCmd(F_EXPAND_VARS
), XK_CMD
);
1929 AddXkey(&cstr
, XmapCmd(F_LIST_GLOB
), XK_CMD
);
1931 AddXkey(&cstr
, XmapCmd(F_LIST_GLOB
), XK_CMD
);
1933 AddXkey(&cstr
, XmapCmd(F_PATH_NORM
), XK_CMD
);
1935 AddXkey(&cstr
, XmapCmd(F_PATH_NORM
), XK_CMD
);
1937 AddXkey(&cstr
, XmapCmd(F_COMMAND_NORM
), XK_CMD
);
1939 AddXkey(&cstr
, XmapCmd(F_COMPLETE_ALL
), XK_CMD
);
1940 buf
[1] = CTL_ESC('\004'); /* ^D */
1941 AddXkey(&cstr
, XmapCmd(F_LIST_ALL
), XK_CMD
);
1952 /* This machine has an EBCDIC charset. The assumptions made for the
1953 * initialized keymaps therefore don't hold, since they are based on
1954 * ASCII (or ISO8859-1).
1955 * Here, we do a one-time transformation to EBCDIC environment
1956 * for the key initializations.
1959 KEYCMD temp
[NT_NUM_KEYS
];
1960 static KEYCMD
*const list
[3] = { CcEmacsMap
, CcViMap
, CcViCmdMap
};
1963 for (table
=0; table
<3; ++table
)
1965 /* copy ASCII ordered map to temp table */
1966 for (i
= 0; i
< NT_NUM_KEYS
; i
++) {
1967 temp
[i
] = list
[table
][i
];
1969 /* write back as EBCDIC ordered map */
1970 for (i
= 0; i
< NT_NUM_KEYS
; i
++) {
1971 list
[table
][_toebcdic
[i
]] = temp
[i
];
1975 #endif /* !IS_ASCII */