Subject: Re: bug#13793: 24.3.50; M-x broken in viper and X

From: Stefan Monnier <[email-masked]>
Date: Wed, 27 Feb 2013 14:08:31 -0500

>> Sounds good to me.  At least, I can't think of a problematic situation,
>> currently.  Let's how it works in practise.
> Ok, now I have problem. The keymap `input-decode-map` is
> keyboard-local (according to the documentation).

Indeed it is, but that shouldn't be too hard to handle.

> This means (and this makes sense because the ESC prefix map in
> `input-decode-map` is different for each keyboard) we have to 'patch'
> it for each new keyboard.

Yes.

> Unfortunately, I'm not sure how to do this right.
> Currently I use an `after-make-frame-functions` hook and a
> `delete-terminal-functions` hook (although the latter may not be
> required) to save the original prefix map in the terminal parameter
> `evil-esc-map` and change `input-decode-map` accordingly. I hope that
> this sets the correct values for each "keyboard".

> Is this the correct way to do? Or is it completely wrong ;)

That sounds fine.  It would be better to use make-terminal-functions, but
you'd have to invent that hook first ;-(
BTW, you can take advantage of this opportunity to only install this
hack on tty terminals.

        Stefan