[mod.computers.vax] XON XOFF and EMACS

mdc@DELPHI.UUCP (03/07/86)

About the XON XOFF / Emacs discussion i think 
that both parts are partly right and partly wrong .

Yes, emacs should be able to cope with the limitation of underling 
communication protocol.

BUT the XON XOFF protocol is really primitive:
thinking in term of layered levels of abstraction (for example ISO/OSI RM),
we may consider at least two interesting levels:
The user-application communication  level, and the 
terminal-computer communication level.
XON XOFF is primitive not because flow control in unuseful
but because it confuse the two levels of abstraction.
So a mechanism usually used to communicate with the application 
(i.e. ASCII characters) is used to control the communication
at the hardware level.

It is the same that having a special phone line 
where to close the communication you must say "Close!" instead
of press a button on the phone.

I think that a solution may be :

Add to XON XOFF a quote character  QUOTE (for example ^P).

So at the hardware level , 

^P    is a prefix character
^Q    means  stop sending data
^S    means  start sending data
^P^Q  means just the ascii character ^Q
^P^S  means just the ascii character ^S
^P^P  means just the ascii character ^P

The handling of XON XOFF QUOTE should be provided at the device
driver level and shold be completely transparent to the application.

If a manual control over the hardware level communication protocol
is needed there should be a not ascii key on the keyboard
that perform as a command to the terminal processor, just as
the key SET-UP do.

In this way you may have both hardware level flow control
and application level flow control without having problem 
with missing ASCII characters.


I agree, however, that XON XOFF is too widely used to 
ignore it or to change it now ...


Maurizio De Cecco
Delphi S.p.A.
Via della Vetraia, 11
55049 Viareggio
Italy
uucp: ...!mcvax!delphi!mdc

[Standard disclaimer]

[Standard  excuses for my bad english]

KFL@MC.LCS.MIT.EDU ("Keith F. Lynch") (03/12/86)

    From: mcvax!delphi!mdc@seismo.CSS.GOV

    I think that a solution may be :
    Add to XON XOFF a quote character  QUOTE (for example ^P).
    So at the hardware level , 

    ^P    is a prefix character
    ^Q    means  stop sending data
    ^S    means  start sending data
    ^P^Q  means just the ascii character ^Q
    ^P^S  means just the ascii character ^S
    ^P^P  means just the ascii character ^P

  In Emacs, text characters always self-insert, and control characters
are always commands.  ^S is the search command and ^Q is the quote-next-
character command (allowing insertion of, and searching for, control
characters).  ^P is the 'up arrow' command, and ^N the 'down arrow'
command.  This is all very easy to use and intuitive, as should be
expected based on the fact that Emacs was in essence incementally
designed by hundreds of users all over the world over a period of over
ten years.  (There has long been a network mailing list for
suggestions and complaints, and another one for bug reports.)
  So to search for a ^S in a file, you do ^S^Q^S  (Search for a Quoted
control-S).  With your suggestion this simple command would turn into
^P^S^P^Q^P^S.  Note that there is two levels of quoting here, and with
different quote characters.  Many novice users have a hard time
mastering one.  And suppose someone wanted to create an Emacs macro
file, which would contain the command ^S^Q^S.  To key it in now
requires the user to do ^Q^S^Q^Q^Q^S.  With your suggestion it would
become ^P^Q^P^S^P^Q^P^Q^P^Q^P^S.  This is not reasonable.  Commands
are already confusing enough without adding new layers of protocol
that add no new features and make life more difficult.
  Also, while going down one line would remain ^N, going up one line
would become ^P^P.  But only interactively.  In a macro it would be a
single ^P.  But you would still have to type two to insert it.  In
addition to a ^Q to quote the ^P to Emacs and another ^P to quote the
^Q which quoted the ^P which was also quoted by another ^P.  What a
nightmare!
  And presumably this change would only take place on VAXes.  I can't
see maintainers of Emacs on other machines changing their Emacs to be
compatible with the changes necessitated on VAXes by losing DEC
protocols.
  In any case, I have used Emacs a great deal on VMS VAXes and have
had no problem with it, except on a DEC terminal in smooth scroll
mode.

    I agree, however, that XON XOFF is too widely used to 
    ignore it or to change it now ...

  EMACS is too widely used to ignore it or to change it now!

								...Keith

george@GVAX.CS.CORNELL.EDU (George R. Boyce) (03/13/86)

KFL@MC.LCS.MIT.EDU ("Keith F. Lynch") writes:
> [discussion of how really painful it would be to have to quote ^s/^q
> with a ^p prefix character]

Many versions of emacs allow one to remap keys on input and all emacs
versions allow one to remap commands on keys. Thus you can either get
use to the idea that ^] sends (in the eye of emacs) a ^s or you can
get use to the idea that ^] *is* the search command. In the latter case
you still need a way of inserting a real ^s/^q and that is done by
adding a command the inserts a control character on request. Gnuemacs
has the first ability and it is real nice since you don't have to 
quote characters nearly as much, if at all (vs. your ^P^S... example :-).

^] above is just an arbitrary character which I happened to choose along
with ^\ for ^q. The author(s) of (gnu)emacs have finally gave their
blessing (?) to replacement characters for ^s/^q, they picked ^^ and ^\ but
I found ^^ hard to type on most DEC terminals (another can of worms).
(They don't like the idea any more than the rest of us that xon/xoff
exists. They just said IF you must, perhaps standardize on ^^/^\ as
replacements.)

Of course, this does nothing at all to "fix" other programs that use ^s/^q.
>
>    I agree, however, that XON XOFF is too widely used to 
>    ignore it or to change it now ...
>
>  EMACS is too widely used to ignore it or to change it now!
>
>								...Keith
Sorry, programs change every day of the week. That is the whole idea
of software! In specific, look at what the gnu project has done with
gnuemacs. 


George Boyce, Cornell Computer Services

KFL@MC.LCS.MIT.EDU ("Keith F. Lynch") (03/15/86)

    From: george@gvax.cs.cornell.edu (George R. Boyce)

    The author(s) of (gnu)emacs have finally gave their
    blessing (?) to replacement characters for ^s/^q, they picked ^^ and ^\ ...

   I don't know about GNU Emacs, but in every Emacs I have heard of,
^^ meant controlify the next character.  For instance if you cannot
enter a ^Y for some reason you can enter ^^ followed by Y and that
will act just like a ^Y.  In fact that is how one searches on a system
that eats ^Ss, you use ^^S.
  Good luck FINDING ^^ and ^\ on any DEC keyboard.  Pressing ^ or \
while holding down CONTROL won't do it!  They are there, but they are
well hidden.

    Sorry, programs change every day of the week. That is the whole idea
    of software!

  User interfaces shouldn't change every day of the week.  Maybe
computers can be instantly told that all the keys mean different
things today, but people's fingers aren't so swift.  Especially since
commands should become automatic to the user, so he can concentrate on
what he is editing rather than on the mechanics of editing it.
								...Keith

rms@PREP.AI.MIT.EDU (Richard M. Stallman) (03/15/86)

I have not changed my opinion of XON/XOFF.  It remains
that that protocol is badly designed and systems that
insist on using it should not be purchased.