comparison lisp/utils/flow-ctrl.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children b82b59fe008d
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
88 (defun enable-flow-control-on (&rest losing-terminal-types) 88 (defun enable-flow-control-on (&rest losing-terminal-types)
89 "Enable flow control if using one of a specified set of terminal types. 89 "Enable flow control if using one of a specified set of terminal types.
90 Use `(enable-flow-control-on \"vt100\" \"h19\")' to enable flow control 90 Use `(enable-flow-control-on \"vt100\" \"h19\")' to enable flow control
91 on VT-100 and H19 terminals. When flow control is enabled, 91 on VT-100 and H19 terminals. When flow control is enabled,
92 you must type C-\\ to get the effect of a C-s, and type C-^ 92 you must type C-\\ to get the effect of a C-s, and type C-^
93 to get the effect of a C-q." 93 to get the effect of a C-q.
94 (let ((term (getenv "TERM")) 94
95 hyphend) 95 This function has no effect unless the current device is a tty.
96 (if term 96
97 (progn 97 The tty terminal type is determined from the TERM environment variable.
98 ;; Strip off hyphen and what follows 98 Trailing hyphens and everything following is stripped, so a TERM
99 (while (setq hyphend (string-match "[-_][^-_]+$" term)) 99 value of \"vt100-nam\" is treated the same as \"vt100\"."
100 (setq term (substring term 0 hyphend))) 100 (and
101 (and (member term losing-terminal-types) 101 (eq (device-type) 'tty)
102 (enable-flow-control)))))) 102 (getenv "TERM")
103 (member (replace-in-string (getenv "TERM") "[-_].*$" "")
104 losing-terminal-types)
105 (enable-flow-control)))
103 106
104 (provide 'flow-ctrl) 107 (provide 'flow-ctrl)
105 108
106 ;;; flow-ctrl.el ends here 109 ;;; flow-ctrl.el ends here