[Linedit-cvs] CVS update: src/editor.lisp src/smart-terminal.lisp

Nikodemus Siivola nsiivola at common-lisp.net
Sun Oct 19 23:47:22 UTC 2003


Update of /project/linedit/cvsroot/src
In directory common-lisp.net:/tmp/cvs-serv25100

Modified Files:
	editor.lisp smart-terminal.lisp 
Log Message:
Automagic selection between terminal types.
Date: Sun Oct 19 19:47:21 2003
Author: nsiivola

Index: src/editor.lisp
diff -u src/editor.lisp:1.4 src/editor.lisp:1.5
--- src/editor.lisp:1.4	Mon Sep 29 10:19:02 2003
+++ src/editor.lisp	Sun Oct 19 19:47:21 2003
@@ -27,7 +27,9 @@
   ((undo-pool :reader undo-pool :initform (make-instance 'pool))
    (line :reader editor-line :initform (make-instance 'line))
    (backend :reader editor-backend
-	    :initform (make-instance 'dumb-terminal)
+	    :initform (if (smart-terminal-p)
+			  (make-instance 'smart-terminal)
+			  (make-instance 'dumb-terminal))
 	    :initarg :backend)
    (commands :reader editor-commands
 	     :initform *commands*


Index: src/smart-terminal.lisp
diff -u src/smart-terminal.lisp:1.1 src/smart-terminal.lisp:1.2
--- src/smart-terminal.lisp:1.1	Sun Oct 19 18:49:58 2003
+++ src/smart-terminal.lisp	Sun Oct 19 19:47:21 2003
@@ -25,6 +25,11 @@
   ((point-row :initform 1 :accessor point-row)
    (active-string :initform "" :accessor active-string)))
 
+(defun smart-terminal-p ()
+  (every (lambda (key)
+	   (ti:capability key))
+	 '(:cursor-up :cursor-down :clr-eos :column-address)))
+
 (defmethod display ((backend smart-terminal) prompt line)
   (let ((*terminal-io* *standard-output*)
 	(columns (backend-columns backend)))





More information about the linedit-cvs mailing list