emacs-devel
[Top][All Lists]
Advanced

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

Re: Best way to intercept terminal escape sequences?


From: Stefan Monnier
Subject: Re: Best way to intercept terminal escape sequences?
Date: Thu, 02 Sep 2010 12:53:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

> As mentioned, read-event did not do obey keyboard-coding-system in
> earlier Emacsen, so any affected package is more likely to be fixed than
> broken by making a change that reverts to this previous behavior.

Handa, could you take a look at the feasibility of moving the
decode_keyboard_code to a later stage such that read-event still returns
raw bytes for ttys?

There is a tension here, because raw events in GUIs are already decoded,
whereas raw events in ttys are just bytes.  You "fixed it" by decoding
tty input in directly in tty_read_avail_input, so that read-event now
always returns decoded input, but that in turns means that read-event
doesn't return raw events any more.  The decoding is desirable for
read-key-sequence (and maybe also for read-char, tho I don't care much
about this case since read-key is generally a better replacement) but
not for read-event, since access to raw events is important for things
like xt-mouse.el.

> Hmm... here's a twist: The elisp docs under keymaps -> translation keymaps
> explain that:

> If you have enabled keyboard character set decoding using
> `set-keyboard-coding-system', decoding is done after the translations
> listed above.  See Terminal I/O Encoding.  However, in future Emacs
> versions, character set decoding may be done at an earlier stage.

This doc is out of date, indeed.


        Stefan



reply via email to

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