diff options
| author | Richard M. Stallman | 1993-06-05 07:56:46 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-05 07:56:46 +0000 |
| commit | fc4f24da5c464976f2d4be1370ee1121a86bd5c4 (patch) | |
| tree | d70adc63726c1141249242fb37debffe98f3d23f | |
| parent | 14869f462178bad94f1f6ddc0f1a49b14c1f2252 (diff) | |
| download | emacs-fc4f24da5c464976f2d4be1370ee1121a86bd5c4.tar.gz emacs-fc4f24da5c464976f2d4be1370ee1121a86bd5c4.zip | |
(term_get_fkeys): Use correct names for F10 and up.
Use the key sequence, not the termcap cap name, in Fdefine_key.
| -rw-r--r-- | src/term.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/src/term.c b/src/term.c index 6d4cba2a10d..911f9f1feee 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1281,7 +1281,7 @@ term_get_fkeys (address) | |||
| 1281 | { | 1281 | { |
| 1282 | char fcap[3], fkey[4]; | 1282 | char fcap[3], fkey[4]; |
| 1283 | 1283 | ||
| 1284 | fcap[0] = 'k'; fcap[2] = '\0'; | 1284 | fcap[0] = 'F'; fcap[2] = '\0'; |
| 1285 | for (i = 11; i < 64; i++) | 1285 | for (i = 11; i < 64; i++) |
| 1286 | { | 1286 | { |
| 1287 | if (i <= 19) | 1287 | if (i <= 19) |
| @@ -1291,13 +1291,16 @@ term_get_fkeys (address) | |||
| 1291 | else | 1291 | else |
| 1292 | fcap[1] = 'a' + i - 11; | 1292 | fcap[1] = 'a' + i - 11; |
| 1293 | 1293 | ||
| 1294 | if (tgetstr (fcap, address)) | 1294 | { |
| 1295 | { | 1295 | char *sequence = tgetstr (fcap, address); |
| 1296 | (void) sprintf (fkey, "f%d", i); | 1296 | if (sequence) |
| 1297 | Fdefine_key (Vfunction_key_map, | 1297 | { |
| 1298 | build_string (fcap), | 1298 | (void) sprintf (fkey, "f%d", i); |
| 1299 | Fmake_vector (make_number (1), intern (fkey))); | 1299 | Fdefine_key (Vfunction_key_map, |
| 1300 | } | 1300 | build_string (sequence), |
| 1301 | Fmake_vector (make_number (1), intern (fkey))); | ||
| 1302 | } | ||
| 1303 | } | ||
| 1301 | } | 1304 | } |
| 1302 | } | 1305 | } |
| 1303 | 1306 | ||
| @@ -1305,11 +1308,15 @@ term_get_fkeys (address) | |||
| 1305 | * Various mappings to try and get a better fit. | 1308 | * Various mappings to try and get a better fit. |
| 1306 | */ | 1309 | */ |
| 1307 | { | 1310 | { |
| 1308 | #define CONDITIONAL_REASSIGN(cap1, cap2, sym) \ | 1311 | #define CONDITIONAL_REASSIGN(cap1, cap2, sym) \ |
| 1309 | if (!tgetstr (cap1, address) && tgetstr (cap2, address)) \ | 1312 | if (!tgetstr (cap1, address)) \ |
| 1310 | Fdefine_key (Vfunction_key_map, \ | 1313 | { \ |
| 1311 | build_string (cap2), \ | 1314 | char *sequence = tgetstr (cap2, address); \ |
| 1312 | Fmake_vector (make_number (1), intern (sym))) | 1315 | if (sequence) \ |
| 1316 | Fdefine_key (Vfunction_key_map, \ | ||
| 1317 | build_string (sequence), \ | ||
| 1318 | Fmake_vector (make_number (1), intern (sym))); \ | ||
| 1319 | } | ||
| 1313 | 1320 | ||
| 1314 | /* if there's no key_next keycap, map key_npage to `next' keysym */ | 1321 | /* if there's no key_next keycap, map key_npage to `next' keysym */ |
| 1315 | CONDITIONAL_REASSIGN ("%5", "kN", "next"); | 1322 | CONDITIONAL_REASSIGN ("%5", "kN", "next"); |