unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Ryan Johnson <ryanjohn@ece.cmu.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Best way to intercept terminal escape sequences?
Date: Fri, 27 Aug 2010 18:40:44 +0300	[thread overview]
Message-ID: <834oegm5c3.fsf@gnu.org> (raw)
In-Reply-To: <4C77CF3C.6050406@ece.cmu.edu>

> Date: Fri, 27 Aug 2010 16:44:12 +0200
> From: Ryan Johnson <ryanjohn@ece.cmu.edu>
> 
> Is there really no other way to do this?

You could use the :post-read-conversion attribute of a coding-system.
That is, define a new coding-system that has this attribute specifying
a function you will write.  That function will first decode the mouse
stuff, and then decode the rest by the terminal-coding-system set by
the user.

You can see an example of this in ctext-with-extensions.  It is
defined on mule-conf.el and its post-read-conversion function is
defined on mule.el.

Other than that, it's no surprise that this is not easy: we ask Emacs
to read keyboard input that is encoded in two different encodings,
which is not how keyboard input was designed.

I think the only way that is easier and cleaner would be if Emacs
could read the mouse input from a separate file descriptor.  We could
then set that file descriptor to use a different encoding.  Of course,
that would need low-level changes in Emacs, even if it is possible in
xterm.



  reply	other threads:[~2010-08-27 15:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20100827142724.E1DD712F@hazard.ece.cmu.edu>
2010-08-27 14:44 ` Best way to intercept terminal escape sequences? Ryan Johnson
2010-08-27 15:40   ` Eli Zaretskii [this message]
2010-08-27 18:04     ` Ryan Johnson
2010-08-27 20:38       ` Eli Zaretskii
2010-08-27 23:54     ` Stefan Monnier
2010-08-28  7:54       ` Ryan Johnson
2010-08-28 14:47         ` Stefan Monnier
2010-08-28 20:34           ` Ryan Johnson
2010-08-31 23:12           ` Ryan Johnson
2010-09-02 10:53             ` Stefan Monnier
2010-09-02 12:33               ` Ryan Johnson
2010-09-04 13:01                 ` Improve input handling documentation (was Re: Best way to intercept terminal escape sequences?) Štěpán Němec
     [not found]               ` <jwvy6bfdp23.fsf-monnier+emacs@gnu.org>
2010-09-07  0:32                 ` Best way to intercept terminal escape sequences? Kenichi Handa
2010-09-08  9:05                   ` Stefan Monnier
     [not found] <20100827112348.5023B3D5@osgood.ece.cmu.edu>
2010-08-27 13:56 ` Ryan Johnson
2010-08-27 14:17   ` David Kastrup
2010-08-26 15:58 Ryan Johnson
2010-08-26 23:03 ` Stefan Monnier
2010-08-27  9:28   ` Ryan Johnson
2010-08-27 10:36     ` David Kastrup
2010-08-27 23:50       ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2010-08-26 13:22 Ryan Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834oegm5c3.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=ryanjohn@ece.cmu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).