Article View: comp.emacs
Article #3486Re: Help wanted with vt102 to Sun4 dialup problem
From: Kevin Gallagher
Date: Mon, 17 Jun 1991 05:12
Date: Mon, 17 Jun 1991 05:12
127 lines
5596 bytes
5596 bytes
In article <814@infotec.UUCP> lee@infotec.UUCP () writes:
>Has anyone experienced problems with 18.57 when calling in
>from a modem and loading the vt100.el file. I reset the
>terminal to vt100 after I unset the termcaps and when the
>emacs screen comes up the I search: control q, .. keeps
>magically appearing.
If you are using a genuine VT series terminal, then you have flow control
problems. The VT terminal is issuing automatic XON/XOFF characters (C-s/C-q)
in an attempt to slow down the output from the host.
If you are using a VT100 emulator on a PC, most emulators let the modem
hardware handle flow control and don't themselves support Auto XON/XOFF.
If this is the case, then it is likely that something in between you and the
modem is using XON/XOFF flow control between it and the host. If changing
this situation is beyond your control and influence, then the attached elisp
file, flow-control.el should help.
Read the file header for instructions on how to install and use it.
Good Luck!
============================== CUT HERE =================================
;;; File: flow-control.el, v 1.0
;;;
;;; ------- ------------- ---------------------
;;; F l o w C o n t r o l A d j u s t m e n t s
;;; ------- ------------- ---------------------
;;;
;;;
;;; Copyright (C) 1990 Free Software Foundation, Inc.
;;; Copyright (C) 1991 Kevin Gallagher
;;;
;;; GNU Emacs is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY. No author or distributor accepts
;;; RESPONSIBILITY TO anyone for the consequences of using it or for
;;; whether it serves any particular purpose or works at all, unless
;;; he says so in writing. Refer to the GNU Emacs General Public
;;; License for full details.
;;;
;;; Send bug reports and suggestions for improvement to Kevin Gallagher
;;; (kgallagh@digi.lonestar.org).
;;;
;;; Everyone is granted permission to copy, modify and redistribute
;;; GNU Emacs, but only under the conditions described in the GNU
;;; Emacs General Public License. A copy of this license is supposed
;;; to have been given to you along with GNU Emacs so you can know
;;; your rights and responsibilities. It should be in a file named
;;; COPYING. Among other things, the Copyright notice and this notice
;;; must be preserved on all copies.
;;;
;;;; Terminals that use XON/XOFF flow control can cause problems with
;;;; GNU Emacs users. This file contains elisp code that makes it
;;;; easy for a user to deal with this problem, when using such a
;;;; terminal.
;;;;
;;;; To make this facility available for use to all users, place this
;;;; file, flow-control.el, into your site's public emacs/lisp
;;;; directory and add the following command to your site's default.el
;;;; file:
;;;;
;;;; (require 'flow-control)
;;;;
;;;; To invoke these adjustments, a user need only define the varible
;;;; terminal-uses-flow-control-chars in his/her own .emacs file. The
;;;; varible must contain a list of one or more terminal types in use
;;;; by that user which require flow control adjustments. Here's an
;;;; example:
;;;;
;;;; (setq terminal-uses-flow-control-chars
;;;; '("vt200" "vt300" "vt101" "vt131"))
(if (boundp 'terminal-uses-flow-control-chars)
(let ((term (getenv "TERM"))
hyphend)
;; Strip off hyphen and what follows
(while (setq hyphend (string-match "[-_][^-_]+$" term))
(setq term (substring term 0 hyphend)))
(let ((len (length terminal-uses-flow-control-chars))
(idx 0)
(temp-term nil))
(while (and (< idx len)
(not temp-term))
(if (string-equal term
(nth idx terminal-uses-flow-control-chars))
(progn
(evade-flow-control)
(setq temp-term term))
(setq idx (1+ idx)))))))
;;;;
;;;; Evade Flow Control
;;;;
(defun evade-flow-control ()
"Replace C-s with C-\ and C-q with C-^ and tell emacs to pass C-s
and C-q characters to OS."
(interactive)
;; Tell emacs to pass C-s and C-q to OS.
(set-input-mode nil t)
;; Initialize translate table.
(let ((the-table (make-string 128 0)))
(let ((i 0))
(while (< i 128)
(aset the-table i i)
(setq i (1+ i))))
;; Swap C-s and C-\
(aset the-table ?\034 ?\^s)
(aset the-table ?\^s ?\034)
;; Swap C-q and C-^
(aset the-table ?\036 ?\^q)
(aset the-table ?\^q ?\036)
(setq keyboard-translate-table the-table))
(message (concat
"XON/XOFF adjustment for "
(getenv "TERM")
": use C-\\ for C-s and use C-^ for C-q."))
(sleep-for 6)) ; Give user a chance to see message.
(provide 'flow-control)
--
----------------------------------------------------------------------------
Kevin Gallagher kgallagh@digi.lonestar.org OR ...!uunet!digi!kgallagh
DSC Communications Corporation Addr: MS 152, 1000 Coit Rd, Plano, TX 75075
----------------------------------------------------------------------------
Technical Details
Message-ID:
<1991Jun17.051212.25665@digi.lonestar.org>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!geraldo.Central.Sun.COM!texsun!digi!kgallaghReferences:
<814@infotec.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!geraldo.Central.Sun.COM!texsun!digi!kgallagh From: kgallagh@digi.lonestar.org (Kevin Gallagher) Newsgroups: comp.emacs Subject: Re: Help wanted with vt102 to Sun4 dialup problem Message-ID: <1991Jun17.051212.25665@digi.lonestar.org> Date: 17 Jun 91 05:12:12 GMT References: <814@infotec.UUCP> Organization: DSC Communications Corp, Plano, TX Lines: 127