Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rochester!quiroz From: quiroz@rochester.ARPA (Cesar Quiroz) Newsgroups: comp.emacs Subject: Re: Passing ^S, was "What's wrong with flow control?" Message-ID: <22827@rochester.ARPA> Date: Tue, 2-Dec-86 18:02:10 EST Article-I.D.: rocheste.22827 Posted: Tue Dec 2 18:02:10 1986 Date-Received: Tue, 2-Dec-86 21:51:10 EST References: <8612020023.AA05566@ucbvax.Berkeley.EDU> <1385@hoptoad.uucp> Reply-To: quiroz@ROCHESTER.UUCP (Cesar Quiroz) Organization: U of Rochester, CS Dept, Rochester, NY Lines: 70 Summary: You can use the keyboard-translate-table, maybe Expires: Sender: Followup-To: In the recent round of derogatory comments about flow-control mechanisms, rwells@PROPHET hinted to the possibility of hiding the ugliness by remapping your physical keyboard, so you type CTRL-S, but the terminal sends out something else. Later, gnu@hoptoad took exception to the usefulness of the approach, by claiming that not all the associations of character and function are in the keymaps (I guess he is not referring to GNUemacs, although the search characters are not in keymaps, but that is yet another issue). References at the end. The point that needs to be stressed is that rwells's mechanism can be complemented: your Emacs can read the "something else" as ^S again. It then avoids having to touch the keymaps (or the assignments of special variables or anything hardwired in the code itself). The proposed solution depends on your good luck to a certain extent: it is not a cure to the problem, but just a possible workaround. I will summarize here one case I had to deal with, I hope it will suggest others how to solve their particular problems. Also, I will explain it from the viewpoint of GNUemacs, I assume other Emacses have their own ways to cope with this. My horror story: I am typing this on a perfectly decent and smart Guru terminal, connected to a perfectly smart Vax over a totally broken switching mechanism. As I have access to other terminals, it is not acceptable for me to remember that in this particular Guru I have to type something different from ^S. So I do the following: On login, if I am coming from a dialup at 9600, the .login asks me if this is a Guru. If so, it downloads escape sequences that do all sorts of magic, in particular they remap CTRL-S to transmit ^]. Then, I fix the keyboard-translate-table (my .emacs asks for confirmation) so that ^] will be seen by the rest of Emacs as ^S. In this way, I don't have to change any keybindings (whether keymaps or not) nor I have to reprogram myself to type strange things in different terminals. The cost is the loss of ^] (big deal) and the need to confirm things to my .login and my .emacs. keyboard -> data-switching -> kbd-xlate-table -> keymaps -> Real Emacs CTRL-S ^] ^] ^] ^] ^S ... happinesss I hope this will be enough to convey the idea. More details on request, of course. =Cesar From article <1385@hoptoad.uucp> (gnu@hoptoad.uucp (John Gilmore)): %In article <8612020023.AA05566@ucbvax.Berkeley.EDU>, rwells@PROPHET.BBN.COM writes: %> Your terminal or terminal emulator could have a mode in %> which it translates keyboard entry of Control-S and Control-Q into %> something else - either multi-character escape sequences or other %> control characters. You then initialize emacs to recognize these %> translated sequences as equivalent to real ^S/^Q... % %Therein lies a problem. Only a few of the Emacs dependencies on %^S and ^Q are in the nice keymaps; the rest are hardwired into Lisp %or MockLisp code. E.g. in incremental search in Gosmacs, the mlisp %macro reads the keyboard, checks for ^R or ^S (to change the direction %of search) and then does the search for that character. Changing %^S to M-S in the keymaps won't make M-S work properly inside incr-search. %Quote characters like ^Q tend to be embedded even worse. -- Cesar Augusto Quiroz Gonzalez Department of Computer Science {allegra|seismo}!rochester!quiroz University of Rochester or Rochester, NY 14627 quiroz@ROCHESTER