[net.unix-wizards] Emacs and XON/XOFF

buck@NRL-CSS.ARPA (06/29/84)

From:  Joe Buck <buck@NRL-CSS.ARPA>

If you have Gosling's Emacs (a.k.a. UniPress Emacs) for a bsd system, it's
easy to modify it to use XON/XOFF (this was necessary here because we plan
to use a terminal line concentrator that automatically does XON/XOFF flow
control). Basically, you do the following:

In dsp.c, change the switch to RAW mode to a switch to CBREAK mode. Then
turn off all special characters except ^S and ^Q. I also switch to the new
tty driver and set literal-next to ^\, which seems mnemonic for Unix/C types
and is unused by "raw" Emacs. Now to do a search-forward, the user says ^\^S
(Emacs will just see the ^S).  Or he/she can bind the function (as well as
quote-character and write-current-file) to any other key sequence.  Don't
forget to save and restore the old special characters.

I don't know about distributing my mods since I'm not clear on the licensing
situation. We initially got Gosling's when it was public domain, but then
paid UniPress for their version. In any case, it's easy to do.

-Joe

chris@umcp-cs.UUCP (07/01/84)

*	From:  Joe Buck <buck@NRL-CSS.ARPA>

	If you have Gosling's Emacs (a.k.a. UniPress Emacs) for a
	bsd system, it's easy to modify it to use XON/XOFF (this
	was necessary here because we plan to use a terminal line
	concentrator that automatically does XON/XOFF flow control).
	Basically, you do the following:

	In dsp.c, change the switch to RAW mode to a switch to
	CBREAK mode. Then turn off all special characters except
	^S and ^Q. I also switch to the new tty driver and set
	literal-next to ^\, which seems mnemonic for Unix/C types
	and is unused by "raw" Emacs. Now to do a search-forward,
	the user says ^\^S (Emacs will just see the ^S).  Or he/she
	can bind the function (as well as quote-character and
	write-current-file) to any other key sequence.  Don't forget
	to save and restore the old special characters.

Actually, using ^\ for literal next to quote the ^S won't work
properly on VT1xx terminals:  they ``notice'' that the user has
typed ^S, and don't send one of their own when the input buffer is
about to overflow.

Not all VT1xx emulations behave this way, however.

By the way, you should note that changing dsp.c as described above
will disable the META key on any terminals you have that actually
have one (e.g., AAA).  If you ask me, the META key alone is worth
all the trouble of coming up with the padding requirements for the
various terminals Emacs uses.  (Although someday perhaps I'll add
a command line switch to control whether you get RAW or CBREAK...)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci (301) 454-7690
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland

thomas@utah-gr.UUCP (Spencer W. Thomas) (07/10/84)

Gee, we've been running our Emacs in CBREAK mode for years, and still use
our meta-keys.  Of course, we did hack the tty driver a little...  Our main
reason for using CBREAK mode is to get the ^G interrupt (yes, we're still
using the infamous HalfBaked mode).  Really nice when your Mlisp goes into
an infinite loop.  I did hack in a variable you can set to get Xon/Xoff flow
control if you need it (but didn't think of using LNEXT).

=Spencer