-
Notifications
You must be signed in to change notification settings - Fork 0
/
keymap.c
executable file
·1837 lines (1747 loc) · 47.1 KB
/
keymap.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* $Id: keymap.c,v 1.9.2.1 2003/03/08 01:22:35 amura Exp $ */
/*
* Keyboard maps. This is character set dependent.
* The terminal specific parts of building the
* keymap has been moved to a better place.
*/
/*
* $Log: keymap.c,v $
* Revision 1.9.2.1 2003/03/08 01:22:35 amura
* NOTAB is always enabled
*
* Revision 1.9 2001/04/28 18:54:27 amura
* support line-number-mode (based on MATSUURA's patch )
*
* Revision 1.8 2001/03/02 08:49:04 amura
* now AUTOSAVE feature implemented almost all (except for WIN32
*
* Revision 1.7 2000/11/16 14:31:12 amura
* fix some typos which cause compile error when using
* strict ANSI-C compiler (ex ACK, gcc-1.x)
*
* Revision 1.6 2000/09/21 17:28:30 amura
* replace macro _WIN32 to WIN32 for Cygwin
*
* Revision 1.5 2000/09/01 19:45:16 amura
* add default keybind for "undo"
*
* Revision 1.4 2000/06/27 01:49:44 amura
* import to CVS
*
* Revision 1.3 2000/06/01 05:30:09 amura
* Undo support
*
* Revision 1.2 2000/03/10 21:29:32 amura
* some function added
*
* Revision 1.1 1999/05/19 03:59:01 amura
* Initial revision
*
*/
/* 90.01.29 Modified for Ng 1.0 by S.Yoshida */
#include "config.h" /* 90.12.20 by S.Yoshida */
#include "def.h"
#include "kbd.h"
#define _PF() pro((int, int))
/*
* Defined by "basic.c".
*/
extern int gotobol _PF(); /* Move to start of line */
extern int backchar _PF(); /* Move backward by characters */
extern int gotoeol _PF(); /* Move to end of line */
extern int forwchar _PF(); /* Move forward by characters */
extern int gotobob _PF(); /* Move to start of buffer */
extern int gotoeob _PF(); /* Move to end of buffer */
extern int forwline _PF(); /* Move forward by lines */
extern int backline _PF(); /* Move backward by lines */
extern int forwpage _PF(); /* Move forward by pages */
extern int backpage _PF(); /* Move backward by pages */
extern int pagenext _PF(); /* Page forward next window */
extern int setmark _PF(); /* Set mark */
extern int swapmark _PF(); /* Swap "." and mark */
extern int gotoline _PF(); /* Go to a specified line. */
#ifdef GOSMACS
extern int forw1page _PF(); /* move forward by lines */
extern int back1page _PF(); /* move back by lines */
#endif
#ifdef NEXTLINE
extern int nextline _PF(); /* next-line-noexpand */
#endif
#ifdef ADDFUNC
extern int linenumbermode _PF(); /* line-number-mode */
#endif
/*
* Defined by "buffer.c".
*/
extern int listbuffers _PF(); /* Display list of buffers */
extern int usebuffer _PF(); /* Switch a window to a buffer */
extern int poptobuffer _PF(); /* Other window to a buffer */
extern int killbuffer _PF(); /* Make a buffer go away. */
extern int savebuffers _PF(); /* Save unmodified buffers */
extern int bufferinsert _PF(); /* Insert buffer into another */
extern int notmodified _PF(); /* Reset modification flag */
#ifdef READONLY /* 91.01.05 by S.Yoshida */
extern int togglereadonly _PF(); /* Toggle read-only flag */
#endif /* READONLY */
#ifdef VARIABLE_TAB
extern int set_default_tabwidth _PF();/* set default tab width */
extern int set_tabwidth _PF(); /* set local tab width */
extern int set_cmode_tabwidth _PF();/* set c-mode tab width */
#endif /* VARIABLE_TAB */
#ifdef BUFFER_MODE
extern int b_del _PF(); /* buffer-mode mark for kill */
extern int b_undel _PF(); /* buffer-mode unmark */
extern int b_expunge _PF(); /* buffer-mode kill marked buff */
extern int b_thiswin _PF(); /* buffer-mode on this window */
#endif
/*
* Defined by "cmode.c".
*/
#ifdef C_MODE /* 90.07.24 by K.Takano */
extern int cm_use_c_mode _PF(); /* use-c-mode */
extern int cm_brace _PF(); /* c-mode electric-c-brace */
extern int cm_brace_blink _PF(); /* c-mode electric-c-brace-blink*/
extern int cm_semi _PF(); /* c-mode electric-c-semi */
extern int cm_term _PF(); /* c-mode electric-c-terminator */
extern int cm_indent _PF(); /* c-mode indent line */
extern int cm_lfindent _PF(); /* c-mode newline and indent */
extern int cm_set_indent _PF(); /* set-c-indent-level */
extern int cm_set_imagin _PF(); /* set-c-brace-imaginary-offset */
extern int cm_set_brace _PF(); /* set-c-brace-offset */
extern int cm_set_arg _PF(); /* set-c-argdecl-indent */
extern int cm_set_label _PF(); /* set-c-label-offset */
extern int cm_set_cstat _PF(); /* set-c-continued-statement-offset*/
extern int cm_set_cbrace _PF(); /* set-c-continued-brace-offset */
extern int cm_set_newl _PF(); /* set-c-auto-newline */
extern int cm_set_tab _PF(); /* set-c-tab-always-indent */
extern int cm_list_var _PF(); /* list-c-mode-variables */
extern int cm_indentregion _PF(); /* c-indent-region Y.Koyanagi */
#endif /* C_MODE */
#ifndef NO_DIR
/*
* Defined by "dir.c"
*/
extern int changedir _PF(); /* change current directory */
extern int showcwdir _PF(); /* show current directory */
#ifndef NO_DIRED
/*
* defined by "dired.c"
*/
extern int dired _PF(); /* dired */
extern int d_findfile _PF(); /* dired find file */
extern int d_del _PF(); /* dired mark for deletion */
extern int d_undel _PF(); /* dired unmark */
extern int d_undelbak _PF(); /* dired unmark backwards */
extern int d_expunge _PF(); /* dired expunge */
extern int d_copy _PF(); /* dired copy */
extern int d_rename _PF(); /* dired rename */
extern int d_otherwindow _PF(); /* dired other window */
extern int d_ffotherwindow _PF(); /* dired find file other window */
extern int d_flag _PF(); /* dired mark backup files */
extern int d_viewfile _PF(); /* dired find file read only */
extern int d_execute _PF(); /* dired execute command (win32)*/
#endif
#endif
/*
* Defined by "extend.c".
*/
extern int extend _PF(); /* Extended commands. */
extern int bindtokey _PF(); /* Modify global key bindings. */
extern int localbind _PF(); /* Modify mode key bindings. */
extern int define_key _PF(); /* modify any key map */
extern int unbindtokey _PF(); /* delete global binding */
extern int localunbind _PF(); /* delete local binding */
extern int insert _PF(); /* insert string */
#ifndef NO_STARTUP
extern int evalexpr _PF(); /* Extended commands (again) */
extern int evalbuffer _PF(); /* Evaluate current buffer */
extern int evalfile _PF(); /* Evaluate a file */
#endif
/*
* Defined by "file.c".
*/
extern int filevisit _PF(); /* Get a file, read write */
extern int poptofile _PF(); /* Get a file, other window */
#ifdef READONLY /* 91.01.05 by S.Yoshida */
extern int filereadonly _PF(); /* Get a file, read only */
#endif /* READONLY */
extern int filealternate _PF(); /* Get a file, in this buffer */
extern int filewrite _PF(); /* Write a file */
extern int filesave _PF(); /* Save current file */
extern int fileinsert _PF(); /* Insert file into buffer */
#ifndef NO_BACKUP
extern int makebkfile _PF(); /* Control backups on saves */
#endif
/*
* defined by help.c
*/
#ifndef NO_HELP
extern int desckey _PF(); /* describe key */
extern int wallchart _PF(); /* Make wall chart. */
extern int help_help _PF(); /* help help */
extern int apropos_command _PF(); /* apropos */
#endif
/*
* defined by "jump.c" Dec 1991. bsh
*/
#ifdef JUMPERR
extern int jumptoerror _PF(); /* parse current line as error message */
extern int nexterror _PF(); /* next-error Y.Koyanagi/amura */
extern int compile _PF(); /* compile Y.Koyanagi */
#endif
/*
* defined by "kanji.c"
*/
#ifdef KANJI /* 90.01.29 by S.Yoshida */
extern int k_rot_fio _PF(); /* Change global file I/O code. */
extern int k_set_fio _PF(); /* Set global file I/O code. */
extern int k_rot_buffio _PF(); /* Change buffer file I/O code. */
extern int k_set_buffio _PF(); /* Set buffer file I/O code. */
extern int k_set_expect _PF(); /* Set expected file input code. */
extern int k_rot_input _PF(); /* Change keyboard input code. */
extern int k_set_input _PF(); /* Set keyboard input code. */
extern int k_rot_display _PF(); /* Change KANJI display code. */
extern int k_set_display _PF(); /* Set KANJI display code. */
extern int k_list_code _PF(); /* List each KANJI code values. */
extern int k_show_code _PF(); /* Show each KANJI code values. */
extern int k_set_tokfio _PF(); /* Set file KANJI select char. */
extern int k_set_toafio _PF(); /* Set file ASCII select char. */
extern int k_set_tokdisplay _PF(); /* Set disp KANJI select char. */
extern int k_set_toadisplay _PF(); /* Set disp ASCII select char. */
#ifdef HANKANA /* 92.11.21 by S.Sasaki */
extern int k_set_tokanafio _PF(); /* Set file KANA select char. */
extern int k_set_tokanadisplay _PF();/* Set disp KANA select char. */
#endif /* HANKANA */
#endif /* KANJI */
/*
* defined by "kbd.c"
*/
#ifdef DO_METAKEY
extern int do_meta _PF(); /* interpret meta keys */
#endif
#ifdef BSMAP
extern int bsmap _PF(); /* backspace mapping */
#endif
extern int universal_argument _PF();/* Ctrl-U */
extern int digit_argument _PF(); /* M-1, etc. */
extern int negative_argument _PF();/* M-- */
extern int selfinsert _PF(); /* Insert character */
extern int rescan _PF(); /* internal try again function */
/*
* defined by "kinsoku.c"
*/
#ifdef KINSOKU /* 90.01.29 by S.Yoshida */
extern int kc_list_char _PF(); /* List BOL/EOL KINSOKU chars. */
extern int kc_add_bol _PF(); /* Add BOL KINSOKU chars. */
extern int kc_del_bol _PF(); /* Delete BOL KINSOKU chars. */
extern int kc_add_eol _PF(); /* Add EOL KINSOKU chars. */
extern int kc_del_eol _PF(); /* Delete EOL KINSOKU chars. */
#endif /* KINSOKU */
/*
* defined by "line.c"
*/
#ifdef UNDO
extern int do_undo _PF(); /* undo */
#endif
/*
* defined by "macro.c"
*/
#ifndef NO_MACRO
extern int definemacro _PF(); /* Begin macro */
extern int finishmacro _PF(); /* End macro */
extern int executemacro _PF(); /* Execute macro */
#endif
/*
* Defined by "main.c".
*/
extern int ctrlg _PF(); /* Abort out of things */
extern int quit _PF(); /* Quit */
/*
* Defined by "match.c"
*/
extern int showmatch _PF(); /* Hack to show matching paren */
#ifdef GOMATCH
extern int gotomatch _PF(); /* goto-matching-fence a la kemacs */
#endif
/* defined by "modes.c" */
extern int indentmode _PF(); /* set auto-indent mode */
extern int fillmode _PF(); /* set word-wrap mode */
extern int blinkparen _PF(); /* Fake blink-matching-paren var */
extern int notabmode _PF(); /* no tab mode */
extern int overwrite _PF(); /* overwrite mode */
#ifdef C_MODE /* 90.07.24 by K.Takano */
extern int cmode _PF(); /* set c-mode */
#endif /* C_MODE */
extern int set_default_mode _PF(); /* set default modes */
/*
* defined by "paragraph.c" - the paragraph justification code.
*/
extern int gotobop _PF(); /* Move to start of paragraph. */
extern int gotoeop _PF(); /* Move to end of paragraph. */
extern int fillpara _PF(); /* Justify a paragraph. */
extern int killpara _PF(); /* Delete a paragraph. */
extern int setfillcol _PF(); /* Set fill column for justify. */
extern int fillword _PF(); /* Insert char with word wrap. */
#ifdef FILLPREFIX /* 90.12.30 by S.Yoshida */
extern int setfillprefix _PF(); /* Set fill prefix strings. */
#endif /* FILLPREFIX */
/*
* Defined by "random.c".
*/
extern int showcpos _PF(); /* Show the cursor position */
extern int twiddle _PF(); /* Twiddle characters */
extern int quote _PF(); /* Insert literal */
extern int openline _PF(); /* Open up a blank line */
extern int newline _PF(); /* Insert newline */
extern int deblank _PF(); /* Delete blank lines */
extern int justone _PF(); /* Delete extra whitespace */
extern int delwhite _PF(); /* Delete all whitespace */
extern int indent _PF(); /* Insert newline, then indent */
extern int forwdel _PF(); /* Forward delete */
extern int backdel _PF(); /* Backward delete in */
extern int killline _PF(); /* Kill forward */
extern int killoneline _PF(); /* Kill current line */
extern int yank _PF(); /* Yank back from killbuffer. */
extern int space_to_tabstop _PF();
#ifdef ZAPTOC_A
# define ZAPTOCHAR
#endif
#ifdef ZAPTOCHAR
extern int zaptochar _PF(); /* Kill up to CHAR */
#endif
#ifdef ADDFUNC /* 90.02.15 by S.Yoshida */
extern int pagelines _PF(); /* Count lines in the page. */
extern int regionlines _PF(); /* Count lines in the region. */
#endif /* ADDFUNC */
#ifdef REGEX
/*
* Defined by "re_search.c"
*/
extern int re_forwsearch _PF(); /* Regex search forward */
extern int re_backsearch _PF(); /* Regex search backwards */
extern int re_searchagain _PF(); /* Repeat regex search command */
extern int re_queryrepl _PF(); /* Regex query replace */
extern int setcasefold _PF(); /* Set case fold in searches */
extern int delmatchlines _PF(); /* Delete all lines matching */
extern int delnonmatchlines _PF(); /* Delete all lines not matching */
extern int cntmatchlines _PF(); /* Count matching lines */
extern int cntnonmatchlines _PF(); /* Count nonmatching lines */
#endif
/*
* Defined by "region.c".
*/
extern int killregion _PF(); /* Kill region. */
extern int copyregion _PF(); /* Copy region to kill buffer. */
extern int lowerregion _PF(); /* Lower case region. */
extern int upperregion _PF(); /* Upper case region. */
extern int copybuffer _PF(); /* Copy buffer to kill buffer */
#ifdef PREFIXREGION
extern int prefixregion _PF(); /* Prefix all lines in region */
extern int setprefix _PF(); /* Set line prefix string */
#endif
/*
* Defined by "search.c".
*/
extern int forwsearch _PF(); /* Search forward */
extern int backsearch _PF(); /* Search backwards */
extern int searchagain _PF(); /* Repeat last search command */
extern int forwisearch _PF(); /* Incremental search forward */
extern int backisearch _PF(); /* Incremental search backwards */
extern int queryrepl _PF(); /* Query replace */
#ifndef NO_SHELL /* 91.01.10 by K.Maeda */
/*
* Defined by "shell.c"
*/
extern int shellcmnd _PF(); /* Get shell command result. */
#endif /* NO_SHELL */
/*
* Defined by "spawn.c".
*/
extern int spawncli _PF(); /* Run CLI in a subjob. */
#ifdef VMS
extern int attachtoparent _PF(); /* Attach to parent process */
#endif
/*
* Defined by "ttyio.c".
*/
#ifdef IBMPC /* 91.01.11 by S.Yoshida */
extern int j31_set_cursor _PF(); /* Set J-3100 cursor mode. */
#endif /* IBMPC */
#ifdef FEPCTRL /* 90.11.26 by K.Takano */
extern int fepmode_set _PF(); /* Set FEP control mode */
extern int fepmode_chg _PF(); /* Change FEP control mode */
extern int fepmode_toggle _PF(); /* Toggle FEP on/off */
#endif
/* defined by "version.c" */
extern int showversion(); /* Show version numbers, etc. */
#ifdef ADDFUNC /* 90.12.28 by S.Yoshida */
extern int showngversion(); /* Show Ng version, etc. */
#endif /* ADDFUNC */
/*
* Defined by "window.c".
*/
extern int reposition _PF(); /* Reposition window */
extern int refresh _PF(); /* Refresh the screen */
extern int nextwind _PF(); /* Move to the next window */
#ifdef GOSMACS
extern int prevwind _PF(); /* Move to the previous window */
#endif
extern int onlywind _PF(); /* Make current window only one */
extern int splitwind _PF(); /* Split current window */
extern int delwind _PF(); /* Delete current window */
extern int enlargewind _PF(); /* Enlarge display window. */
extern int shrinkwind _PF(); /* Shrink window. */
/*
* Defined by "word.c".
*/
extern int backword _PF(); /* Backup by words */
extern int forwword _PF(); /* Advance by words */
extern int upperword _PF(); /* Upper case word. */
extern int lowerword _PF(); /* Lower case word. */
extern int capword _PF(); /* Initial capitalize word. */
extern int delfword _PF(); /* Delete forward word. */
extern int delbword _PF(); /* Delete backward word. */
/*
* Defined by "version.c".
*/
extern int showversion _PF(); /* Show ng version breifry */
extern int showngversion _PF(); /* Show ng version verbose */
/*
* Defined by "skg.c".
*/
#ifdef INCLUDE_SKG
extern int skginput _PF(); /* Get Kanji strings. */
extern int skg_set_romanname _PF();/* Set Roman->Kana dict name */
extern int skg_set_dicname _PF(); /* Set Kana->Kanji dict name */
#endif
/*
* Defined by "autosave.c".
*/
#ifdef AUTOSAVE
extern int as_set_interval _PF(); /* Autosave interval time */
#endif
#ifdef WIN32
#ifndef NO_STARTUP
extern int ConfigStartupFilePath _PF();
#endif
extern int tticon _PF();
#endif
#ifdef AMIGA
#ifdef DO_ICONIFY
extern int tticon _PF();
#endif
#ifdef DO_MENU
extern int amigamenu _PF(); /* Menu function */
#endif
#ifdef MOUSE
extern int amigamouse _PF(); /* Amiga mouse functions */
extern int mgotobob _PF();
extern int mforwdel _PF();
extern int mdelwhite _PF();
extern int mdelwind _PF();
extern int mgotoeob _PF();
extern int menlargewind _PF();
extern int mkillline _PF();
extern int mkillregion _PF();
extern int mdelfword _PF();
extern int mreposition _PF();
extern int mbackpage _PF();
extern int mforwpage _PF();
extern int mshrinkwind _PF();
extern int msplitwind _PF();
extern int myank _PF();
#endif /* MOUSE */
extern int togglewindow _PF(); /* Defined by "ttyio.c" */
extern int togglezooms _PF(); /* "" "" */
#ifdef CHANGE_FONT
extern int setfont _PF(); /* Defined by "ttyio.c" */
#endif
#ifdef CHANGE_COLOR
/* functions to mess with the mode line rendition, window colors*/
extern int ttmode _PF(); /* Defined by "tty.c" */
extern int tttext _PF(); /* "" */
extern int textforeground _PF(); /* "" */
extern int textbackground _PF(); /* "" */
extern int modeforeground _PF(); /* "" */
extern int modebackground _PF(); /* "" */
#endif
/*
* This file contains map segment definitions for adding function keys to
* keymap declarations. Currently you can add things to the fundamental
* mode keymap and the dired mode keymap. See the declaration of
* diredmap and fundmap for details.
*/
#include "amiga_maps.c"
#endif /* AMIGA */
#ifdef CANNA
/*
* Defined by "canna.c".
*/
extern int canna_toggle();
#endif
/* initial keymap declarations, deepest first */
#ifndef NO_HELP
static PF cHcG[] = {
ctrlg, /* ^G */
help_help, /* ^H */
};
static PF cHa[] = {
apropos_command,/* a */
wallchart, /* b */
desckey, /* c */
};
static struct KEYMAPE(2+IMAPEXT) helpmap = {
2,
2+IMAPEXT,
rescan,
{
{CCHR('G'),CCHR('H'), cHcG, (KEYMAP *)NULL},
{'a', 'c', cHa, (KEYMAP *)NULL},
}
};
#endif
#ifdef KANJI /* 90.01.29 by S.Yoshida */
static PF cXcKcG[] = {
ctrlg, /* ^G */
};
static PF cXcKC[] = {
k_list_code, /* C */
rescan, /* D */
rescan, /* E */
k_rot_fio, /* F */
};
static PF cXcKc[] = {
k_show_code, /* c */
k_rot_display, /* d */
rescan, /* e */
k_rot_buffio, /* f */
rescan, /* g */
rescan, /* h */
k_rot_input, /* i */
};
static struct KEYMAPE(3+IMAPEXT) cXcKmap = {
3,
3+IMAPEXT,
rescan,
{
{CCHR('G'), CCHR('G'), cXcKcG, (KEYMAP *)NULL},
{'C', 'F', cXcKC, (KEYMAP *)NULL},
{'c', 'i', cXcKc, (KEYMAP *)NULL},
}
};
#endif /* KANJI */
static PF cX4cF[] = {
poptofile, /* ^f */
ctrlg, /* ^g */
};
static PF cX4b[] = {
poptobuffer, /* b */
rescan, /* c */
rescan, /* d */
rescan, /* e */
poptofile, /* f */
};
static struct KEYMAPE(2+IMAPEXT) cX4map = {
2,
2+IMAPEXT,
rescan,
{
{CCHR('F'),CCHR('G'), cX4cF, (KEYMAP *)NULL},
{'b', 'f', cX4b, (KEYMAP *)NULL},
}
};
static PF cXcB[] = {
listbuffers, /* ^B */
quit, /* ^C */
rescan, /* ^D */
rescan, /* ^E */
filevisit, /* ^F */
ctrlg, /* ^G */
};
#ifdef KANJI /* 90.01.29 by S.Yoshida */
static PF cXcK[] = {
prefix, /* ^K */
#else /* NOT KANJI */
static PF cXcL[] = {
#endif /* KANJI */
lowerregion, /* ^L */
rescan, /* ^M */
rescan, /* ^N */
deblank, /* ^O */
rescan, /* ^P */
#ifdef READONLY
togglereadonly, /* ^Q */
filereadonly, /* ^R */
#else /* NOT READONLY */
rescan, /* ^Q */
rescan, /* ^R */
#endif /* READONLY */
filesave, /* ^S */
rescan, /* ^T */
upperregion, /* ^U */
filealternate, /* ^V */
filewrite, /* ^W */
swapmark, /* ^X */
};
#ifndef NO_MACRO
static PF cXlp[] = {
definemacro, /* ( */
finishmacro, /* ) */
};
#endif
#ifdef FILLPREFIX /* 90.12.30 by S.Yoshida */
static PF cXdot[] = {
setfillprefix, /* . */
rescan, /* / */
#else /* NOT FILLPREFIX */
static PF cX0[] = {
#endif /* FILLPREFIX */
delwind, /* 0 */
onlywind, /* 1 */
splitwind, /* 2 */
rescan, /* 3 */
prefix, /* 4 */
};
static PF cXeq[] = {
showcpos, /* = */
};
static PF cXcar[] = {
enlargewind, /* ^ */
rescan, /* _ */
#ifdef JUMPERR
jumptoerror, /* ` */
#else
rescan, /* ` */
#endif
rescan, /* a */
usebuffer, /* b */
rescan, /* c */
#ifndef NO_DIRED
dired, /* d */
#else
rescan, /* d */
#endif
#ifndef NO_MACRO
executemacro, /* e */
#else
rescan, /* e */
#endif
setfillcol, /* f */
rescan, /* g */
rescan, /* h */
fileinsert, /* i */
rescan, /* j */
killbuffer, /* k */
#ifdef ADDFUNC /* 90.02.15 by S.Yoshida */
pagelines, /* l */
#else /* NOT ADDFUNC */
rescan, /* l */
#endif /* ADDFUNC */
rescan, /* m */
rescan, /* n */
nextwind, /* o */
rescan, /* p */
rescan, /* q */
rescan, /* r */
savebuffers, /* s */
#ifdef UNDO
rescan, /* t */
do_undo, /* u */
#endif
};
#ifndef NO_MACRO
static struct KEYMAPE(6+IMAPEXT) cXmap = {
6,
6+IMAPEXT,
#else
static struct KEYMAPE(5+IMAPEXT) cXmap = {
5,
5+IMAPEXT,
#endif
rescan,
{
{CCHR('B'),CCHR('G'), cXcB, (KEYMAP *)NULL},
#ifdef KANJI /* 90.01.29 by S.Yoshida */
{CCHR('K'),CCHR('X'), cXcK, (KEYMAP *)&cXcKmap},
#else /* NOT KANJI */
{CCHR('L'),CCHR('X'), cXcL, (KEYMAP *)NULL},
#endif /* KANJI */
#ifndef NO_MACRO
{'(', ')', cXlp, (KEYMAP *)NULL},
#endif
#ifdef FILLPREFIX /* 90.12.30 by S.Yoshida */
{'.', '4', cXdot, (KEYMAP *)&cX4map},
#else /* NOT FILLPREFIX */
{'0', '4', cX0, (KEYMAP *)&cX4map},
#endif /* FILLPREFIX */
{'=', '=', cXeq, (KEYMAP *)NULL},
#ifdef UNDO
{'^', 'u', cXcar, (KEYMAP *)NULL},
#else
{'^', 's', cXcar, (KEYMAP *)NULL},
#endif
}
};
static PF metacG[] = {
ctrlg, /* ^G */
};
static PF metacV[] = {
pagenext, /* ^V */
};
static PF metasp[] = {
justone, /* space */
#ifndef NO_SHELL /* 91.01.10 by K.Maeda */
shellcmnd, /* ! */
#endif /* NO_SHELL */
};
static PF metapct[] = {
queryrepl, /* % */
};
static PF metami[] = {
negative_argument, /* - */
rescan, /* . */
rescan, /* / */
digit_argument, /* 0 */
digit_argument, /* 1 */
digit_argument, /* 2 */
digit_argument, /* 3 */
digit_argument, /* 4 */
digit_argument, /* 5 */
digit_argument, /* 6 */
digit_argument, /* 7 */
digit_argument, /* 8 */
digit_argument, /* 9 */
rescan, /* : */
rescan, /* ; */
gotobob, /* < */
#ifdef ADDFUNC /* 90.02.15 by S.Yoshida */
regionlines, /* = */
#else /* NOT ADDFUNC */
rescan, /* = */
#endif /* ADDFUNC */
gotoeob, /* > */
};
static PF metalb[] = {
gotobop, /* [ */
delwhite, /* \ */
gotoeop, /* ] */
rescan, /* ^ */
rescan, /* _ */
rescan, /* ` */
rescan, /* a */
backword, /* b */
capword, /* c */
delfword, /* d */
rescan, /* e */
forwword, /* f */
};
static PF metal[] = {
lowerword, /* l */
rescan, /* m */
rescan, /* n */
rescan, /* o */
rescan, /* p */
fillpara, /* q */
backsearch, /* r */
forwsearch, /* s */
rescan, /* t */
upperword, /* u */
backpage, /* v */
copyregion, /* w */
extend, /* x */
#ifdef ZAPTOCHAR
rescan, /* y */
zaptochar, /* z */
#endif
};
static PF metatilde[] = {
notmodified, /* ~ */
delbword, /* DEL */
};
#ifdef INCLUDE_SKG
static PF metacK[] = {
skginput, /* ^K */
};
#define XSKGMAP 1
#else
#define XSKGMAP 0
#endif
static struct KEYMAPE(8+IMAPEXT+XSKGMAP) metamap = {
8+XSKGMAP,
8+IMAPEXT+XSKGMAP,
rescan,
{
{CCHR('G'),CCHR('G'), metacG, (KEYMAP *)NULL},
#ifdef INCLUDE_SKG
{CCHR('K'),CCHR('K'), metacK, (KEYMAP *)NULL},
#endif
{CCHR('V'),CCHR('V'), metacV, (KEYMAP *)NULL},
#ifndef NO_SHELL /* 91.01.10 by K.Maeda */
{' ', '!', metasp, (KEYMAP *)NULL},
#else /* NO_SHELL */
{' ', ' ', metasp, (KEYMAP *)NULL},
#endif /* NO_SHELL */
{'%', '%', metapct,(KEYMAP *)NULL},
{'-', '>', metami, (KEYMAP *)NULL},
{'[', 'f', metalb, (KEYMAP *)NULL},
#ifndef ZAPTOCHAR
{'l', 'x', metal, (KEYMAP *)NULL},
#else
{'l', 'z', metal, (KEYMAP *)NULL},
#endif
{'~', CCHR('?'), metatilde,(KEYMAP *)NULL},
}
};
static PF fund_at[] = {
setmark, /* ^@ */
gotobol, /* ^A */
backchar, /* ^B */
rescan, /* ^C */
forwdel, /* ^D */
gotoeol, /* ^E */
forwchar, /* ^F */
ctrlg, /* ^G */
#ifndef NO_HELP
prefix, /* ^H */
#else
rescan, /* ^H */
#endif
};
/* ^I is selfinsert */
static PF fund_CJ[] = {
indent, /* ^J */
killline, /* ^K */
reposition, /* ^L */
newline, /* ^M */
forwline, /* ^N */
#ifdef CANNA
canna_toggle, /* ^O */
#else
openline, /* ^O */
#endif
backline, /* ^P */
quote, /* ^Q */
backisearch, /* ^R */
forwisearch, /* ^S */
twiddle, /* ^T */
universal_argument, /* ^U */
forwpage, /* ^V */
killregion, /* ^W */
prefix, /* ^X */
yank, /* ^Y */
#ifndef VMS
spawncli, /* ^Z */
#else
attachtoparent, /* ^Z */
#endif
};
static PF fund_esc[] = {
prefix, /* esc */
#ifdef MSDOS /* 90.02.20 by S.Yoshida */
#ifdef PC9801 /* 97.09.11 by amura */
#ifdef FEPCTRL
fepmode_toggle, /* ^\ */ /* ^\ is fep-toggle */
#else
setmark, /* ^\ */ /* ^\ is also set-mark-command. */
#endif /* FEPCTRL */
#else /* NOT PC9801 */
#ifdef IBMPC
#ifdef FEPCTRL
fepmode_toggle, /* ^\ */ /* ^\ is fep-toggle */
#else
setmark, /* ^\ */ /* ^\ is also set-mark-command. */
#endif /* FEPCTRL */
#else /* NOT IBMPC and PC9801 */
setmark, /* ^\ */ /* ^\ is also set-mark-command. */
#endif /* IBMPC */
#endif /* PC9801 */
#else /* NOT MSDOS */
#ifdef HUMAN68K /* 90.11.09 Sawayanagi Yosirou */
#ifdef FEPCTRL
fepmode_toggle, /* ^\ */ /* ^\ is fep-toggle */
#else
setmark, /* ^\ */ /* ^\ is also set-mark-command. */
#endif /* FEPCTRL */
#else /* NOT HUMAN68K */
rescan, /* ^\ */ /* selfinsert is default on fundamental */
#endif /* HUMAN68K */
#endif /* MSDOS */
rescan, /* ^] */
rescan, /* ^^ */
#ifdef UNDO
do_undo, /* _ */
#else
rescan, /* ^_ */
#endif
};
static PF fund_del[] = {
backdel, /* DEL */
};
#ifndef FUND_XMAPS
#define NFUND_XMAPS 0 /* extra map sections after normal ones */
#endif
static struct KEYMAPE(4+NFUND_XMAPS+IMAPEXT) fundmap = {
4 + NFUND_XMAPS,
4 + NFUND_XMAPS + IMAPEXT,
selfinsert,
{
#ifndef NO_HELP
{CCHR('@'),CCHR('H'), fund_at, (KEYMAP *)&helpmap},
#else
{CCHR('@'),CCHR('H'), fund_at, (KEYMAP *)NULL},
#endif
{CCHR('J'),CCHR('Z'), fund_CJ, (KEYMAP *)&cXmap},
{CCHR('['),CCHR('_'), fund_esc,(KEYMAP *)&metamap},
{CCHR('?'),CCHR('?'), fund_del,(KEYMAP *)NULL},
#ifdef FUND_XMAPS
FUND_XMAPS,
#endif
}
};
static PF fill_sp[] = {
fillword, /* ' ' */
};
static struct KEYMAPE(1+IMAPEXT) fillmap = {
1,
1+IMAPEXT,
rescan,
{
{' ', ' ', fill_sp, (KEYMAP *)NULL},
}
};
static PF indent_lf[] = {
newline, /* ^J */
rescan, /* ^K */
rescan, /* ^L */
indent, /* ^M */
};
static struct KEYMAPE(1+IMAPEXT) indntmap = {
1,
1+IMAPEXT,
rescan,
{
{CCHR('J'), CCHR('M'), indent_lf, (KEYMAP *)NULL},
}
};
static PF blink_rp[] = {
showmatch, /* ) */
};
static struct KEYMAPE(1+IMAPEXT) blinkmap = {
1,
1+IMAPEXT,
rescan,
{
{')', ')', blink_rp, (KEYMAP *)NULL},
}
};
static PF notab_tab[] = {
space_to_tabstop, /* ^I */
};
static struct KEYMAPE(1+IMAPEXT) notabmap = {
1,
1+IMAPEXT,
rescan,