From xemacs-m  Mon Jun  2 23:25:15 1997
Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id XAA14507
	for <xemacs-beta@xemacs.org>; Mon, 2 Jun 1997 23:25:14 -0500 (CDT)
Received: (from hniksic@localhost)
          by jagor.srce.hr (8.8.5/8.8.4)
	  id GAA20930; Tue, 3 Jun 1997 06:24:55 +0200 (MET DST)
To: Jamie Zawinski <jwz@netscape.com>
Cc: Martin Buchholz <mrb@Eng.Sun.COM>,
        XEmacs Developers <xemacs-beta@xemacs.org>, wing@666.com
Subject: Re: backspace-or-delete feedback
References: <199706030016.RAA03741@xemacs.eng.sun.com> 	<m267vwjzry.fsf@altair.xemacs.org> 	<kig4tbgsefm.fsf@jagor.srce.hr> <199706030122.SAA03777@xemacs.eng.sun.com> <kigwwocqwh3.fsf@jagor.srce.hr> <33937E67.26E11F89@netscape.com> <kign2p8qrg6.fsf@jagor.srce.hr> <339399C7.8A531729@netscape.com>
X-Attribution: Hrv
X-Face: Mie8:rOV<\c/~z{s.X4A{!?vY7{drJ([U]0O=W/<W*SMo/Mv:58:*_y~ki>xDi&N7XG
        KV^$k0m3Oe/)'e%3=$PCR&3ITUXH,cK>]bci&<qQ>Ff%x_>1`T(+M2Gg/fgndU%k*ft
        [(7._6e0n-V%|%'[c|q:;}td$#INd+;?!-V=c8Pqf}3J
X-Kibo-Says: Touch Kibology, and be someone!
From: Hrvoje Niksic <hniksic@srce.hr>
Date: 03 Jun 1997 06:24:54 +0200
In-Reply-To: Jamie Zawinski's message of Mon, 02 Jun 1997 21:12:55 -0700
Message-ID: <kigenakqpnt.fsf@jagor.srce.hr>
Lines: 114
X-Mailer: Gnus v5.4.52/XEmacs 20.2

Jamie Zawinski <jwz@netscape.com> writes:

> Hrvoje Niksic wrote:
> > 
> > > What do you mean by "hardcoded"?  All of this is a matter of what is in
> > > function-key-map, right?
> > 
> > NO.  That's a part of the problem.  These two lines are from events.c:
> > 
> >   else if (c == 127)
> >     k = QKdelete;
> 
> Ok, I think that's bogus.  (If it does the same thing for 8/backspace,
> that's also bogus.)

# if 0
	  /* This is probably too controversial... */
	case 'H': k = QKbackspace; m &= ~MOD_CONTROL; break;
# endif

:-)

In fact, it was supposed to be no less bogus than:

      switch (c)
	{
	case 'I': k = QKtab;	  m &= ~MOD_CONTROL; break;
	case 'J': k = QKlinefeed; m &= ~MOD_CONTROL; break;
	case 'M': k = QKreturn;	  m &= ~MOD_CONTROL; break;
	case '[': k = QKescape;	  m &= ~MOD_CONTROL; break;

It may have even looked like a good idea at the time.

> > If one does `stty erase ^H' on a TTY, it's quite logical to map it to
> > backspace, and show it to the user as such.
> 
> Not quite -- it's logical to make it so that when the user types C-h  
> or backspace, that the previous character is erased.  Because the stty
> settings talk only about *behavior*.

That's true.  But the simplest thing to get that behaviour (and to
retain DEL deleting forward) is to proclaim C-h is backspace.

Or not.  I don't really have a strong conviction in this area, and
it's a matter of implementation.  If Gary or Martin will implement it
correctly as to retain the good behavior, I won't mind.

> > On X, C-h is not backspace so we may output `C-h runs ...'.  Why do
> > you think that doesn't work?
> > 
> > > There's no way to do the right thing on ttys.  The information is
> > > gone.
> > 
> > Not if you read the termio structure.
> 
> The information that is gone is which key the user pressed.  Did they
> press the backspace key?  Or did they hold Control and press H?  That's
> what I meant.

If the TTY setting says that C-h is backspace on this keyboard -- and
we must hold this setting sacred, as it's the only thing we can hold
on to -- then it's safe to assume it is.

The information is gone, but we can simply choose to believe termios.

> In the message "xxx runs yyy", xxx is the key and yyy is the behavior. 
> Termio talks about the behavior.  Which key  was actually used is no
> longer known, so it's a matter of conjecture which one you should
> print.

Oh.  That's another way of looking at it.  In the Emacs world, I
thought it might be more useful to regard termio as talking about
keys.  Again, this is of little real importance.

> Well, I dunno, say I'm sitting in front of some random keyboard, and
> Something is Going Wrong.  It might be useful information to me that
> the-big-horizontal-key-in-the-upper-right is sending C-h, rather
> than C-?.  If you print BS and DEL, I'm going to wonder whether it's
> *really* sending ^H, or whether something is trying to be
> clever/pretty.  (Yeah, I can find this out in other ways, so this
> isn't much of an argument.)

Hmm, the same goes for \e[3~ and the likes.  I tend to press
C-q <ugly-thing> often in those cases.  Having `C-h c' messages
(actually `read-key-sequence') print anything else would be little
gain.

> I guess I just think that it's more consistent, when converting ASCII
> codes to keysyms, to leave them as their Ctrl equivalents -- if you
> follow the line of reasoning that says that ^H should be turned into
> backspace, should you then also turn ^L into ClearScreen?
> 
> I'd argue that the low level tty code should not do anything "smart"
> with any of the ASCII codes.  If you want to prettify things by
> referring to ^I as tab, then do that via the function-key-map, where you
> can change the behavior later from lisp, if you decide that it turned
> out not to be such a good idea.

This consistency is a better argument.  But do note that the `C-h c'
messages will continue to print whatever it is in function-key-map.

> > You need the C code to look at termio, and to remove the C-? -> QKdelete
> > dependency.  Once you do the latter, other code may also break.
> 
> For termio, can't you just spawn an "stty" process and parse its
> output?

I don't think I'll ever vote for that solution.  Call it a matter of
preference, but I don't accept spawning of a process for this.

-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
I'm a Lisp variable -- bind me!

