[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section attempts to answer the question "Why does Emacs use flow-control characters in its command character set?" For a second view on this issue, read the comments on flow control in the `emacs/INSTALL' file from the distribution; for help with Termcap entries and DEC terminal concentrators, see `emacs/etc/TERMS'.
At one time, most terminals did not need flow control, and none used
C-s
and C-q for flow control. Therefore, the choice of
C-s and C-q as command characters for searching and quoting
was natural and uncontroversial. With so many commands needing key
assignments, of course we assigned meanings to nearly all ASCII
control characters.
Later, some terminals were introduced which required these characters for flow control. They were not very good terminals for full-screen editing, so Emacs maintainers ignored them. In later years, flow control with C-s and C-q became widespread among terminals, but by this time it was usually an option. And the majority of Emacs users, who can turn flow control off, did not want to switch to less mnemonic key bindings for the sake of flow control.
So which usage is "right"---Emacs's or that of some terminal and concentrator manufacturers? This question has no simple answer.
One reason why we are reluctant to cater to the problems caused by C-s and C-q is that they are gratuitous. There are other techniques (albeit less common in practice) for flow control that preserve transparency of the character stream. Note also that their use for flow control is not an official standard. Interestingly, on the model 33 teletype with a paper tape punch (around 1970), C-s and C-q were sent by the computer to turn the punch on and off!
As window systems and PC terminal emulators replace character-only
terminals, the flow control problem is gradually disappearing. For the
mean time, Emacs provides a convenient way of enabling flow control if
you want it: call the function enable-flow-control
.
keyboard-translate-table
(see section 40.8.2 Translating Input Events).
You can use the function enable-flow-control-on
in your
init file to enable flow control automatically on certain
terminal types.
(enable-flow-control-on "vt200" "vt300" "vt101" "vt131") |
Here is how enable-flow-control
does its job:
(set-input-mode nil t)
.
keyboard-translate-table
to translate C-\ and
C-^ into C-s and C-q. Except at its very
lowest level, Emacs never knows that the characters typed were anything
but C-s and C-q, so you can in effect type them as C-\
and C-^ even when they are input for other commands.
See section 40.8.2 Translating Input Events.
If the terminal is the source of the flow control characters, then once
you enable kernel flow control handling, you probably can make do with
less padding than normal for that terminal. You can reduce the amount
of padding by customizing the Termcap entry. You can also reduce it by
setting baud-rate
to a smaller value so that Emacs uses a smaller
speed when calculating the padding needed. See section 40.9 Terminal Output.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |