don't re-announce on reload unless something changes
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 3 May 2011 12:59:34 +0000 (15:59 +0300)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 3 May 2011 12:59:34 +0000 (15:59 +0300)
  Default highlight color should be NIL.

backend.lisp
editor.lisp

index 198289a..c7be9d1 100644 (file)
 
 (defparameter *default-columns* 80)
 (defparameter *default-lines* 24)
-(defparameter *highlight-color* :green
+(defparameter *highlight-color* nil
   "Color to use for highlighting parentheses. NIL is the current foreground
-color bolded, other options are :BLACK, :RED, :GREEN, :YELLOW, :BLUE,
-:MAGENTA, :CYAN, and :WHITE.")
+color bolded, other options are terminal colors :BLACK, :RED, :GREEN, :YELLOW,
+:BLUE, :MAGENTA, :CYAN, and :WHITE.")
 
 (defclass backend ()
   ((ready-p :accessor backend-ready-p :initform nil)
index 1b7e698..459290d 100644 (file)
 (defclass smart-editor (editor smart-terminal) ())
 (defclass dumb-editor (editor dumb-terminal) ())
 
-(let ((ann nil))
-  (defun make-editor (&rest args)
-    (ti:set-terminal)
-    (let ((type (if (smart-terminal-p)
-                   'smart-editor
-                   'dumb-editor)))
-      (unless ann
-       (format t "~&Linedit version ~A [~A mode]~%"
-               *version*
-               (if (eq 'smart-editor type)
-                   "smart"
-                   "dumb")))
-      (setf ann t)
-      (apply 'make-instance type args))))
+(defvar *announced* nil)
+
+(defun make-editor (&rest args)
+  (ti:set-terminal)
+  (let* ((type (if (smart-terminal-p)
+                   'smart-editor
+                   'dumb-editor))
+         (spec (list *version* type)))
+    (unless (equal *announced* spec)
+      (format t "~&Linedit version ~A [~A mode]~%"
+              *version*
+              (if (eq 'smart-editor type)
+                  "smart"
+                  "dumb"))
+      (setf *announced* spec))
+    (apply 'make-instance type args)))
 
 ;;; undo