emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

uppercase->lowercase and function-key-map


From: Stefan Monnier
Subject: uppercase->lowercase and function-key-map
Date: Tue, 21 May 2002 22:11:07 -0400

When ESC O H fails to be found in function-key-map and the `H' is
turned into `h' should `ESC O h' be looked up in function-key-map again ?

My gut feeling says no and a comment in read_key_sequence agrees:

      /* If the sequence is unbound, see if we can hang a function key
         off the end of it.  We only want to scan real keyboard input
         for function key sequences, so if mock_input says that we're
         re-reading old events, don't examine it.  */

but further down in the same function, when we downcase the `H'
the code does:

          /* We have to do this unconditionally, regardless of whether
             the lower-case char is defined in the keymaps, because they
             might get translated through function-key-map.  */
          keybuf[t - 1] = new_key;
          mock_input = max (t, mock_input);

          fkey_map = prev_fkey_map;
          fkey_start = prev_fkey_start;
          fkey_end = prev_fkey_end;

          keytran_map = prev_keytran_map;
          keytran_start = prev_keytran_start;
          keytran_end = prev_keytran_end;

          goto replay_sequence;

where the `fkey_start = prev_fkey_start' implies that we might rescan
the new key sequence for function-key-map bindings (whether and
when this rescan actually happen, I don't really know because the
code is not the clearest ever).

Further more the above few lines come from the following two changes:

revision 1.357
date: 1995/08/08 05:12:31;  author: rms;  state: Exp;  lines: +61 -43
(read_key_sequence): Undo previous change.
Instead, put back the orig_uppercase event if key is not defined.
When downcasing, back up one step in key-translation processing.
----------------------------
revision 1.356
date: 1995/08/03 00:02:07;  author: rms;  state: Exp;  lines: +64 -20
(read_key_sequence): Don't downshift an event
if that fails to make it bound.
(follow_key): Don't alter contents of NEXT until the end.
----------------------------

which seem to indicate that Richard went through some amount of trouble
in order to make sure that the key-translation would be (at least
partly) redone.

Does anybody know why one would want to redo the key-translation ?


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]