[comp.emacs] What keys do you bind in place of ^s, ^q

moore@UTKCS2.CS.UTK.EDU.UUCP (06/22/87)

I haven't decided yet.  When I used to use Gosling's emacs (now known as
Unipress emacs), I used ESC-s for search-forward and ESC-q for quote-character.
I'm now converting to GNU emacs, and these don't work so well.  Someone has
suggested using ^\ to replace ^s, but I often log in over a phone line
via Kermit, and my copy of Kermit uses ^\ for a local function escape.
I may work out a solution eventually, but I'm also trying to get the powers
that be to replace our terminal concentrator with one which doesn't need to
use in-band flow control.

Keith Moore				Internet:  moore@utkcs2.cs.utk.edu
University of Tenn CS Dept		CSnet:  moore@tennessee
Knoxville TN				BITNET:  moore@utkcs1

moore@UTKCS2.CS.UTK.EDU (Keith Moore) (06/24/87)

>When I used to use Gosling's emacs (now known as Unipress emacs), I used
>ESC-s for search-forward and ESC-q for quote-character.
>I'm now converting to GNU emacs, and these don't work so well.

Clarification:  I'm now converting to GNU emacs, and these don't work so
well if you use incremental searching instead of vanilla searching.
I now like to bind query-replace to ESC-q, so I have to find another
key for quote.

GNU emacs came with the key bindings set for incremental search, so
I decided to try it that way.  It's not a problem of which emacs.
ESC-s should work okay in either Emacs if you bind it to vanilla
search or regular expression search.

Keith Moore				Internet:  moore@utkcs2.cs.utk.edu
University of Tenn CS Dept		CSnet:  moore@tennessee
Knoxville TN				BITNET:  moore@utkcs1

ron@topaz.rutgers.edu (Ron Natalie) (06/25/87)

A few years ago on this very group a set of unified EMACS key bindings
was discussed and agreed upon.  Included in these are the following
that I heartily recommend to all EMACS developpers

1.  Use ^\ whenever you would have used ^S and use ^^ when you would
    have used ^Q.

2.  Bind M-space to set-mark, in addition to ^@, since many
    systems/terminals are incapable of dealing with NUL.  Also ESC-space
    is a much nicer key stroke sequence than CTRL-SHIFT-2 which is
    required on many terminals.

-Ron 

ram-ashwin@YALE.ARPA (Ashwin Ram) (06/26/87)

>    1.  Use ^\ whenever you would have used ^S and use ^^ when you would
>        have used ^Q.

I don't agree.  If one's terminal doesn't like ^S and ^Q, one can use
whatever else one pleases, but for the rest of us who have never experienced
any problems with ^S and ^Q, it doesn't make sense to give up TWO easy-to-use
and mnemonic control keys for highly terminal-dependent keys such as ^^
(which I don't like for the same reason as you don't like ^@ (below)).

>    2.  Bind M-space to set-mark, in addition to ^@, since many
>        systems/terminals are incapable of dealing with NUL.  Also ESC-space
>        is a much nicer key stroke sequence than CTRL-SHIFT-2 which is
>        required on many terminals.

Yeah, I hate ctrl-shift-2 too, but on most terminals, control-SPACE (which is
even easier than the two-keystroke sequence M-SPACE) emits a NUL.  I use
control-SPACE for set-mark and M-SPACE for exchange-point-and-mark.  Of
course, this is a matter of personal choice.

-- Ashwin.

ron@topaz.rutgers.EDU (Ron Natalie) (06/26/87)

No, most VT100's a use control-SPACE, we have zillions of AT&T
terminals that this doesn't work on.  Besides, ^X^X is hardwired
in my brain for exchange-point-and-mark.

bmiller@burdvax.PRC.Unisys.COM (Bruce J. Miller) (06/27/87)

In article <8706261448.AA04691@yale-eli.arpa> ram-ashwin@YALE.ARPA (Ashwin Ram) writes:
>I don't agree.  If one's terminal doesn't like ^S and ^Q, one can use
>whatever else one pleases, but for the rest of us who have never experienced
>any problems with ^S and ^Q, it doesn't make sense to give up TWO easy-to-use
>and mnemonic control keys for highly terminal-dependent keys such as ^^
>(which I don't like for the same reason as you don't like ^@ (below)).
We've run into the same argument at our site (VMS 4.4 running 18.36 in the
process of upgading to 18.47).  So we compromised, since most of our
terminals run through an obnoxious DECNET server (which gets very nasty if
you turn disable flow-control) we remapped ^S to ^\ and ^Q to ^^ in the
translate table, but we did it through an interactive function that is
called on startup.  We then provided a function to undo this for those
people lucky enough to have direct lines.  For those who might be
interested, the relevant code follows.


--Herb Miller
ARPA: hmiller@eddie.mit.edu
CHAOS: ham@deep-thought.mit.edu
UUCP: ...mit-eddie!hmiller

============================================================
     
;;; Following is bletcherous kludge stolen from bobcat.el, mutated
;;; to replace ^S/^Q with something more friendly, specifically
;;; ^\/^^

(defun evade-flow-control ()
  "Replace ^S with ^\ and ^Q with ^^."
  (interactive)
  (let ((the-table (make-string 128 0)))
    (let ((i 0))
      (while (< i 128)
	(aset the-table i i)
	(setq i (1+ i))))
    ;; Swap ^S and ^\
    (aset the-table ?\034 ?\^s)
    (aset the-table ?\^s ?\034)
    ;; Swap ^Q and ^^
    (aset the-table ?\036 ?\^q)
    (aset the-table ?\^q ?\036)
    (setq flow-control-evasion t)
    (setq keyboard-translate-table the-table)))

;;; Following undoes the bletcherous kludge and returns ^S/^Q to their normal 
;;; state.  We could just set keyboard-translate-table to nil, but will do
;;; things the hard way to avoid breaking translate tables used by
;;; individual lusers.

(defun unevade-flow-control ()
  "Return ^S and ^Q to their normal mappings."
  (interactive)
  (cond ((null flow-control-evasion) nil)
	(t ;;; Swap back ^S
	 (aset keyboard-translate-table ?\034 ?\034)
	 (aset keyboard-translate-table ?\^s ?\^s)
	 ;; Swap ^Q and ^^
	 (aset keyboard-translate-table ?\036 ?\036)
	 (aset keyboard-translate-table ?\^q ?\^q)
	 (setq flow-control-evasion nil))))

(evade-flow-control)

jv@mhres.UUCP (Johan Vromans) (06/28/87)

We use the editor SCAME, a modified version of the one created by Leif
Samuelsson. From this editor, we have adopted the use of ^] for ^S and ^^
for ^Q. On the systems which can run GNU, we use the keyboard translation
table to map ^] to ^S and ^^ to ^Q, so all emacs-like editors behave the same.


-- 
Johan Vromans                                  UUCP: ..{seismo!}mcvax!mhres!jv
Multihouse Research
Gouda, the Netherlands
(X) This text is not worth copyrighting, but it will soon be a collectors item