Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!cbmvax!bpa!burdvax!bmiller From: bmiller@burdvax.PRC.Unisys.COM (Bruce J. Miller) Newsgroups: comp.emacs Subject: Re: What keys do you bind in place of ^s, ^q Message-ID: <3851@burdvax.PRC.Unisys.COM> Date: Sat, 27-Jun-87 00:42:04 EDT Article-I.D.: burdvax.3851 Posted: Sat Jun 27 00:42:04 1987 Date-Received: Sun, 28-Jun-87 04:46:52 EDT References: <8706261448.AA04691@yale-eli.arpa> Sender: news@burdvax.PRC.Unisys.COM Reply-To: hmiller@eddie.mit.edu Organization: Unisys Corporation, Paoli Research Center; Paoli, PA Lines: 62 Summary: Setting up the replacement in an interactive function works well 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)