forked from Distrotech/minicom
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTodo.emacskey.dif
More file actions
151 lines (138 loc) · 4.31 KB
/
Copy pathTodo.emacskey.dif
File metadata and controls
151 lines (138 loc) · 4.31 KB
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
--- window.c Wed May 22 23:40:36 1996
+++ ../../source/window.c Thu May 9 23:55:04 1996
@@ -38,6 +38,7 @@
#ifndef BBS
#include "config.h"
+#include "configsym.h"
#endif
#define BUFFERSIZE 2048
@@ -1589,6 +1590,9 @@
int direct = dirflush;
int delete = 1;
+ char *emacskeymap_from = "\001\002\004\005\006" /*"\013"*/ ;
+ int emacskeymap_to[] = { K_HOME, K_LT, K_DEL, K_END, K_RT } ;
+
x = w->curx;
y = w->cury;
@@ -1609,6 +1613,11 @@
once--;
} else {
c = getch();
+ /* maybe this stuff (below) should be #ifndef BBS?? */
+ if (P_EMACSKEYS[0] == 'Y' && strchr(emacskeymap_from,c))
+ c = emacskeymap_to[(int)strchr(emacskeymap_from,c) -
+ (int)emacskeymap_from];
+
if (c > 255 || c == K_BS || c == K_DEL) delete = 0;
}
switch(c) {
@@ -1677,7 +1686,18 @@
wlocate(w, x + idx - offs, y);
wflush();
break;
+ case 'K'-'@': /* CTRL-K */
+ /* Delete rest of line */
+ if(P_EMACSKEYS[0] == 'Y') {
+ buf[idx] = 0;
+ lredraw(w, x + idx - offs, y, buf + idx,
+ linelen - (idx - offs));
+ wlocate(w, x + idx - offs, y);
+ wflush();
+ }
+ break;
default:
+ if (c < 32 || c > 127) break;
/* If delete == 1, delete the buffer. */
if (delete) {
if ((i = strlen(buf)) > linelen)
@@ -1691,7 +1711,6 @@
}
/* Insert character at cursor position. */
- if (c < 32 || c > 127) break;
if (idx + 1 >= maxlen) break;
for(f = strlen(buf) + 1; f > idx; f--)
buf[f] = buf[f-1];
--- ./config.c Wed May 22 23:23:18 1996
+++ ../source/config.c Thu May 9 22:58:38 1996
@@ -593,13 +593,13 @@
int tmp_c; /* fmg - need it to color keep in sanity checks */
char buf[16];
int miny = 4,
- maxy = 17;
+ maxy = 18;
int old_stat = P_STATLINE[0];
#if _HAVE_MACROS
FILE *fp;
miny = 3;
- maxy = 19;
+ maxy = 20;
#endif
w = wopen(15, miny, 69, maxy, BDOUBLE, stdattr, mfcolor, mbcolor, 0, 0, 1);
@@ -621,11 +621,13 @@
/* MARK updated 02/17/95 - Configurable history buffer size */
wprintf(w, " K - History Buffer Size : %s\n", P_HISTSIZE);
+ wprintf(w, " L - Enable Emacs keys : %s\n", P_EMACSKEYS);
+
#if _HAVE_MACROS
/* fmg - macros support */
- wprintf(w, " L - Macros file : %s\n", P_MACROS);
- wprintf(w, " M - Edit Macros\n");
- wprintf(w, " N - Macros enabled : %s\n", P_MACENAB);
+ wprintf(w, " M - Macros file : %s\n", P_MACROS);
+ wprintf(w, " N - Edit Macros\n");
+ wprintf(w, " O - Macros enabled : %s\n", P_MACENAB);
#endif
wredraw(w, 1);
@@ -855,9 +857,14 @@
werror("This system does not support history");
#endif
break;
+ case 'L': /* enable emacs editing keys */
+ psets(P_EMACSKEYS, yesno(P_EMACSKEYS[0] == 'N'));
+ wlocate(w, 30, 12);
+ wprintf(w, "%s", P_EMACSKEYS);
+ break;
#if _HAVE_MACROS
- case 'L': /* fmg - get local macros storage file */
- pgets(w, 30, 12, P_MACROS, 64, 64);
+ case 'M': /* fmg - get local macros storage file */
+ pgets(w, 30, 13, P_MACROS, 64, 64);
/* Try to open the file to read it in. */
fp = sfopen(pfix_home(P_MACROS), "r+");
@@ -880,12 +887,12 @@
readmacs(fp, 0);
fclose(fp);
break;
- case 'M': /* fmg - Bring up macro editing window */
+ case 'N': /* fmg - Bring up macro editing window */
domacros();
break;
- case 'N':
+ case 'O':
psets(P_MACENAB, yesno(P_MACENAB[0] == 'N'));
- wlocate(w, 30, 14);
+ wlocate(w, 30, 15);
wprintf(w, "%s", P_MACENAB);
break;
#endif
--- orig_source/configsym.h Wed Mar 15 18:37:36 1995
+++ source/configsym.h Thu May 9 22:34:32 1996
@@ -117,7 +117,8 @@
#define P_SOUND mpars[75].value
#define P_HISTSIZE mpars[76].value /* History buffer size */
-
+#define P_EMACSKEYS mpars[77].value /* Enable emacs keys in line edits */
+
/* fmg - macros struct */
#define P_MAC1 mmacs[0].value
--- orig_source/rwconf.c Wed Mar 15 18:37:36 1995
+++ source/rwconf.c Thu May 9 22:35:56 1996
@@ -140,6 +140,9 @@
/* MARK updated 02/17/95 - History buffer size */
{ "256", PUBLIC, "histlines" },
+ /* Enable Emacs editing keys in line editings */
+ { "Yes", PUBLIC, "emacskeys" },
+
/* That's all folks */
{ "", 0, (char *)NULL },
};