aboutsummaryrefslogtreecommitdiffstats
path: root/src/term.c
diff options
context:
space:
mode:
authorStefan Monnier2007-10-09 05:05:39 +0000
committerStefan Monnier2007-10-09 05:05:39 +0000
commit4f4a84ec801ea0d62d32a1b5679def1e16d3f813 (patch)
tree86e671367bcef6d2b42e0a3ae0e1a83c32659f50 /src/term.c
parentbeb9f7453ae9a4473cf43a16c186a090d77c4b3b (diff)
downloademacs-4f4a84ec801ea0d62d32a1b5679def1e16d3f813.tar.gz
emacs-4f4a84ec801ea0d62d32a1b5679def1e16d3f813.zip
Add new `input-decode-map' keymap and use it for temrinal
escape sequences. * keyboard.h (struct kboard): Add Vinput_decode_map. Remove Vlocal_key_translation_map. * keyboard.c (read_key_sequence): Add support for input-decode-map. (init_kboard): Init input-decode-map. Replace local-key-translation-map back with key-translation-map. (syms_of_keyboard): Declare input-decode-map. Remove local-key-translation-map. Update docstrings. (mark_kboards): Mark Vinput_decode_map. Don't mark Vlocal_key_translation_map. * keymap.c (Fdescribe_buffer_bindings): Describe input-decode-map. Replace local-key-translation-map back with key-translation-map. * term.c (term_get_fkeys_1, CONDITIONAL_REASSIGN): Bind in input-decode-map rather than function-key-map.
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/term.c b/src/term.c
index a6c69c71bef..b97e77b2320 100644
--- a/src/term.c
+++ b/src/term.c
@@ -1274,9 +1274,9 @@ static char **term_get_fkeys_address;
1274static KBOARD *term_get_fkeys_kboard; 1274static KBOARD *term_get_fkeys_kboard;
1275static Lisp_Object term_get_fkeys_1 (); 1275static Lisp_Object term_get_fkeys_1 ();
1276 1276
1277/* Find the escape codes sent by the function keys for Vfunction_key_map. 1277/* Find the escape codes sent by the function keys for Vinput_decode_map.
1278 This function scans the termcap function key sequence entries, and 1278 This function scans the termcap function key sequence entries, and
1279 adds entries to Vfunction_key_map for each function key it finds. */ 1279 adds entries to Vinput_decode_map for each function key it finds. */
1280 1280
1281static void 1281static void
1282term_get_fkeys (address, kboard) 1282term_get_fkeys (address, kboard)
@@ -1306,14 +1306,14 @@ term_get_fkeys_1 ()
1306 KBOARD *kboard = term_get_fkeys_kboard; 1306 KBOARD *kboard = term_get_fkeys_kboard;
1307 1307
1308 /* This can happen if CANNOT_DUMP or with strange options. */ 1308 /* This can happen if CANNOT_DUMP or with strange options. */
1309 if (!initialized) 1309 if (!KEYMAPP (kboard->Vinput_decode_map))
1310 kboard->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil); 1310 kboard->Vinput_decode_map = Fmake_sparse_keymap (Qnil);
1311 1311
1312 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++) 1312 for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
1313 { 1313 {
1314 char *sequence = tgetstr (keys[i].cap, address); 1314 char *sequence = tgetstr (keys[i].cap, address);
1315 if (sequence) 1315 if (sequence)
1316 Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence), 1316 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
1317 Fmake_vector (make_number (1), 1317 Fmake_vector (make_number (1),
1318 intern (keys[i].name))); 1318 intern (keys[i].name)));
1319 } 1319 }
@@ -1333,13 +1333,13 @@ term_get_fkeys_1 ()
1333 if (k0) 1333 if (k0)
1334 /* Define f0 first, so that f10 takes precedence in case the 1334 /* Define f0 first, so that f10 takes precedence in case the
1335 key sequences happens to be the same. */ 1335 key sequences happens to be the same. */
1336 Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0), 1336 Fdefine_key (kboard->Vinput_decode_map, build_string (k0),
1337 Fmake_vector (make_number (1), intern ("f0"))); 1337 Fmake_vector (make_number (1), intern ("f0")));
1338 Fdefine_key (kboard->Vlocal_function_key_map, build_string (k_semi), 1338 Fdefine_key (kboard->Vinput_decode_map, build_string (k_semi),
1339 Fmake_vector (make_number (1), intern ("f10"))); 1339 Fmake_vector (make_number (1), intern ("f10")));
1340 } 1340 }
1341 else if (k0) 1341 else if (k0)
1342 Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0), 1342 Fdefine_key (kboard->Vinput_decode_map, build_string (k0),
1343 Fmake_vector (make_number (1), intern (k0_name))); 1343 Fmake_vector (make_number (1), intern (k0_name)));
1344 } 1344 }
1345 1345
@@ -1362,7 +1362,7 @@ term_get_fkeys_1 ()
1362 if (sequence) 1362 if (sequence)
1363 { 1363 {
1364 sprintf (fkey, "f%d", i); 1364 sprintf (fkey, "f%d", i);
1365 Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence), 1365 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence),
1366 Fmake_vector (make_number (1), 1366 Fmake_vector (make_number (1),
1367 intern (fkey))); 1367 intern (fkey)));
1368 } 1368 }
@@ -1379,7 +1379,7 @@ term_get_fkeys_1 ()
1379 { \ 1379 { \
1380 char *sequence = tgetstr (cap2, address); \ 1380 char *sequence = tgetstr (cap2, address); \
1381 if (sequence) \ 1381 if (sequence) \
1382 Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence), \ 1382 Fdefine_key (kboard->Vinput_decode_map, build_string (sequence), \
1383 Fmake_vector (make_number (1), \ 1383 Fmake_vector (make_number (1), \
1384 intern (sym))); \ 1384 intern (sym))); \
1385 } 1385 }