[comp.emacs] Making ctrl-S send some funny escape sequence

cosell@PROPHET.BBN.COM (Bernie Cosell) (12/02/86)

I tried this and it doesn't quite work.  The magic control chars in
incremental search mode (which is the point of this, isn't it, to get
your favorite search when you type ctrl-S) are defined to be *char*.
Thus, when I type ctrl-S, ctrl-S it doesn't re-search.  If anyone
knows of a way to fix the incremental search guys to take
sequences or something instead of "just chars", please let me know.

(also, I discovered, not even 'meta' works: I tried making the research
char be meta-S just to see what happens.  Well, the obvious (after you
think about it for a while): I have no way to type "meta-S".  I have
a *command* that'll make-believe it is meta-S (escape followed by
S), but that is NOT the same thing as a real meta-S, and so doesn't work.

  /Bernie

Bernie Cosell                       Internet:  cosell@bbn.com
Bolt, Beranek & Newman, Inc         USENET:    bbnccv!bpc
Cambridge, MA   02238               Telco:     (617) 497-3503

pinkas@mipos3.UUCP (Israel Pinkas) (12/03/86)

In article <8612021419.AA17163@ucbvax.Berkeley.EDU> cosell@PROPHET.BBN.COM (Bernie Cosell) writes:
>I tried this and it doesn't quite work.  The magic control chars in
>incremental search mode (which is the point of this, isn't it, to get
>your favorite search when you type ctrl-S) are defined to be *char*.
>Thus, when I type ctrl-S, ctrl-S it doesn't re-search.  If anyone
>knows of a way to fix the incremental search guys to take
>sequences or something instead of "just chars", please let me know.

This is a portion of my .emacs file:

(global-set-key "\C-^" 'isearch-forward)
(global-set-key "\C-\\" 'quoted-insert)
(global-set-key "\C-x\C-\\" 'toggle-read-only)
(global-set-key "\C-x\C-^" 'save-buffer)

(setq search-quote-char 28)
(setq search-repeat-char 30)

(global-unset-key "\C-q")
(global-unset-key "\C-s")

This sets search to be C-^ (C-` or C-6 on many terminals).  It also moves
the quote character to C-\.  (I also move C-X C-S and C-X C-Q.)  The next
lines modify the smae characters inside the search.  The last lines unset
C-S and C-Q so that when the terminal send them, they are ignored.  (Well,
almost.  Emacs still seems to see them and screen refreshes are buggy.)

-Israel
-- 
----------------------------------------------------------------------
UUCP:	{amdcad,decwrl,hplabs,oliveb,pur-ee,qantel}!intelca!mipos3!pinkas
ARPA:	pinkas%mipos3.intel.com@relay.cs.net
CSNET:	pinkas%mipos3.intel.com

cosell@PROPHET.BBN.COM (Bernie Cosell) (12/04/86)

> From: Israel Pinkas <ames!oliveb!intelca!mipos3!pinkas@cad.berkeley.edu>

> This is a portion of my .emacs file:

> (global-set-key "\C-^" 'isearch-forward)
> (global-set-key "\C-\\" 'quoted-insert)

...etc

You miss the point: if the diehard ^S lovers were willing to MOVE
search, then this religious war would have ceased being a problem
YEARS ago: ^S would have long since been back in the realm of
terminal-control-chars.  The whole point of the
I-can't-live-without-search-on-^S crowd is that they WANT SEARCH ON
^S... 

now, someone suggested that one might be able to have his cake
and eat it, too, by letting the ^S/^Q stuff stay hidden in the terminal
control protocol and 'fixing' your terminal to send something else
when you hold-down-the-CTRL-key-and-hit-S.  I was only pointing out
that as far as I've been able to puzzle out, even THAT doesn't work,
because you still can't get the "research-forward" control to use your
new sequence.

  /Bernie