home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / emacs / 3888 < prev    next >
Encoding:
Text File  |  1992-12-30  |  1.8 KB  |  50 lines

  1. Path: sparky!uunet!olivea!spool.mu.edu!darwin.sura.net!gatech!destroyer!cs.ubc.ca!news.UVic.CA!spang.Camosun.BC.CA!dbarker
  2. From: dbarker@spang.Camosun.BC.CA (Deryk Barker)
  3. Newsgroups: comp.emacs
  4. Subject: Re: Problems with EMACS on a SUN using a MAC from Telnet
  5. Message-ID: <1992Dec30.222633.12966@spang.Camosun.BC.CA>
  6. Date: 30 Dec 92 22:26:33 GMT
  7. References: <168C79043.M16302@mwvm.mitre.org>
  8. Organization: Camosun College, Victoria B.C, Canada
  9. Lines: 38
  10. X-Newsreader: Tin 1.1 PL4
  11.  
  12. M16302@mwvm.mitre.org writes:
  13. : When I key CtrlS to save the file, I lock up the editor.  Does anybody know
  14. : any fixes for this?
  15.  
  16. I presume you're referring to ^X^S? ANyway, as has been pointed out,
  17. it is almost certainly because ^S is the XOFF character which will
  18. hold up all terminal (workstaition) i/o when you have software flow
  19. control enabled. You may be able to get around this using stty
  20. parameters (can't remember which one, -xon?), but if you are coming
  21. through a net connection you may not. In which case you should use the
  22. evade-flow-control function which remaps all ^S to ^\ and ^Q (XON,
  23. i.e. the reverse of ^S) to ^^. It's given in the GNU Emacs LISP manual
  24. I think, but as I can never remember exactly where, I append the
  25. source below. Run this from your .emacs file.
  26.  
  27. (defun evade-flow-control ()
  28.   "Replace C-s with C-\ and C-q with C-^."
  29.   (interactive)
  30.   (let ((the-table (make-string 128 0)))
  31.     (let ((i 0))
  32.       (while (< i 128)
  33.     (aset the-table i i)
  34.     (setq i (1+ i))))
  35.     
  36.     ;; Swap `C-s' and `C-\'.
  37.     (aset the-table ?\034 ?\^s)
  38.     (aset the-table ?\^s ?\034)
  39.     ;; Swap `C-q' and `C-^'.
  40.     (aset the-table ?\036 ?\^q)
  41.     (aset the-table ?\^q ?\036)
  42.     
  43.     (setq keyboard-translate-table the-table)))
  44.  
  45.  
  46. --
  47. Real:  Deryk Barker, Computer Science Dept., Camosun College, Victoria B.C.
  48. Email: (dbarker@spang.camosun.bc.ca)
  49. Phone: +1 604 370 4452
  50.