Subject: bug#19416: 25.0.50; enhancement of xterm mouse tracking: draging the mouse now generates mouse-movement events

From: Olaf Rogalsky <[email-masked]>
Date: Wed, 07 Jan 2015 21:43:48 +0100

[email-masked] writes:
>> It would be nice, if the patch could find its way into Emacs.
>
> Agreed.  For that, we need you to sign some copyright paperwork.
Great

> If that's OK with you, then please fill the form below and send it to
> the FSF as instructed so they can send you the appropriate paperwork
> to sign.
Done

> While this process is going on, we can look at the actual code and see
> how we could improve it.  Let's start with read-utf8-char: the handling
> of "keyboard decoding" has seen some changes over the years, and I think
> with the latest code in Emacs's master (which is the same as in
> Emacs-24.4), something like read-utf8-char should be much simpler
> (i.e. just read a char while setting the keyboard-coding-system to
> utf-8 at the same time).
Yes, thats perfectly fine with me. I tried the following, but wasn't successfull:

(defun read-utf8-char (&optional prompt inherit-input-method seconds)
  "..."
  (let ((tmp (keyboard-coding-system)))
    (set-keyboard-coding-system 'utf-8)
    (prog1 (read-char prompt inherit-input-method seconds)
      (set-keyboard-coding-system tmp))))

(insert (read-utf8-char))

If I now enter AltGr-m (which gives in my xterm-configuration µ =
MICRO-SIGN U+00B5) followed by a space, then I get the following result:

=> "Â"      (after pressing AltGr-m)
=> "\265 "  (after pressing space)

Obviously I am doing something wrong.

Olaf

-- 
Olaf Rogalsky
Schwörhausgasse 5
89073 Ulm