delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/05/29/17:59:39

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <416096c60905290538t1989ba8cq4987a0197c2b61cd@mail.gmail.com>
References: <4A168F2B DOT 4020805 AT cornell DOT edu> <4A1C9952 DOT 8040100 AT cornell DOT edu> <AECBDC9D8B31450CA07DD85A423AD033 AT dc DOT pp DOT rl DOT ac DOT uk> <4A1D9D05 DOT 40407 AT cornell DOT edu> <838wkhsm5e DOT fsf AT gnu DOT org> <4A1E7C50 DOT 8020505 AT cornell DOT edu> <416096c60905280702m6e4cb748ic305be3592d81c70 AT mail DOT gmail DOT com> <83ws8042o2 DOT fsf AT gnu DOT org> <4A1FD2B7 DOT 90506 AT cornell DOT edu> <416096c60905290538t1989ba8cq4987a0197c2b61cd AT mail DOT gmail DOT com>
Date: Fri, 29 May 2009 22:59:21 +0100
Message-ID: <416096c60905291459y37ac57a2le64d451d8c5e640a@mail.gmail.com>
Subject: Re: emacs -nw keypad, tpu-edt.el, and C-h
From: Andy Koppe <andy DOT koppe AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

>>> Actually, this holy war can be bypassed, without sacrificing Emacs
>>> correctly working on a console. =C2=A0What the console should send for =
that
>>> is the <Backspace> function key.
>>
>> Makes sense to me. =C2=A0Andy, is there any reason all cygwin terminals =
shouldn't
>> do this (including mintty)? =C2=A0This already happens under X, and user=
s would
>> then have consistent behavior.
>
> What is the "<Backspace> function key", i.e. what character sequence
> does that correspond to?

I've had a look at the emacs source. The Windows console variant of
emacs uses low-level console I/O, namely the ReadConsoleInput()
function. This delivers a stream of so-called input events, rather
than a stream of characters like the high-level console functions.
Also see here for the distinction:

http://msdn.microsoft.com/en-us/library/ms683497(VS.85).aspx

One type of input event is a key event, which tells you exactly what
key was pressed and which modifiers are down. Emacs translates that
directly into its internal keyboard representation such as
<Backspace>, thereby indeed bypassing the whole question of how keys
should be represented in a character stream.

Unix terminals are character devices though, sp terminal emulators
have to encode keyboard events as sequences of characters, as that's
what terminal applications expect to get. The terminal version of
emacs then translates those into its internal representation.

Now of course if emacs can translate low-level console I/O as it sees
fit, then the Cygwin DLL could also be able to translate Backspace
into ^? characters rather than ^H, in CYGWIN=3Dtty mode anyway. So I had
a look at fhandler_console.cc. It already uses ReadConsoleInput(), so
mapping from VK_BACK to ^? might be fairly straightforward actually.

I guess Cygwin 1.7 will be the last chance for quite a while to make
such a change, so is this something that should be considered?  A bit
of googling tells me that Redhat Linux actually decided to follow the
Debian guidelines many years ago and used ^? ever since, apart from a
little wobble in Fedora Core 3.

Andy

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019