diff 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
line wrap: on
line diff
--- a/lisp/utils/flow-ctrl.el	Mon Aug 13 08:45:53 2007 +0200
+++ b/lisp/utils/flow-ctrl.el	Mon Aug 13 08:46:35 2007 +0200
@@ -90,16 +90,19 @@
 Use `(enable-flow-control-on \"vt100\" \"h19\")' to enable flow control
 on VT-100 and H19 terminals.  When flow control is enabled,
 you must type C-\\ to get the effect of a C-s, and type C-^
-to get the effect of a C-q."
-  (let ((term (getenv "TERM"))
-	hyphend)
-    (if term
-	(progn
-	  ;; Strip off hyphen and what follows
-	  (while (setq hyphend (string-match "[-_][^-_]+$" term))
-	    (setq term (substring term 0 hyphend)))
-	  (and (member term losing-terminal-types)
-	       (enable-flow-control))))))
+to get the effect of a C-q.
+
+This function has no effect unless the current device is a tty.
+
+The tty terminal type is determined from the TERM environment variable.
+Trailing hyphens and everything following is stripped, so a TERM
+value of \"vt100-nam\" is treated the same as \"vt100\"."
+  (and
+   (eq (device-type) 'tty)
+   (getenv "TERM")
+   (member (replace-in-string (getenv "TERM") "[-_].*$" "")
+           losing-terminal-types)
+   (enable-flow-control)))
 
 (provide 'flow-ctrl)