[Linedit-cvs] CVS update: src/editor.lisp src/sbcl-repl.lisp src/utility-functions.lisp

Nikodemus Siivola nsiivola at common-lisp.net
Fri Mar 5 22:10:59 UTC 2004


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

Modified Files:
	editor.lisp sbcl-repl.lisp utility-functions.lisp 
Log Message:
Escape backslashes
Date: Fri Mar  5 17:10:59 2004
Author: nsiivola

Index: src/editor.lisp
diff -u src/editor.lisp:1.12 src/editor.lisp:1.13
--- src/editor.lisp:1.12	Fri Mar  5 13:58:58 2004
+++ src/editor.lisp	Fri Mar  5 17:10:59 2004
@@ -100,7 +100,7 @@
 (defun redraw-line (editor &key markup)
   (display editor 
 	   :prompt (editor-prompt editor) 
-	   :line (get-string editor) 
+	   :line (get-string editor)
 	   :point (get-point editor)
 	   :markup markup))
 


Index: src/sbcl-repl.lisp
diff -u src/sbcl-repl.lisp:1.7 src/sbcl-repl.lisp:1.8
--- src/sbcl-repl.lisp:1.7	Fri Mar  5 13:21:36 2004
+++ src/sbcl-repl.lisp	Fri Mar  5 17:10:59 2004
@@ -74,7 +74,7 @@
 		    (declare (type stream out in))
 		      ;; FIXME: Yich.
 		    (terpri)
-		    (with-input-from-string (in (repl-reader in out))
+		    (with-input-from-string (in (meta-escape (repl-reader in out)))
 		      (funcall read-form-fun in out)))
 		  (lambda (in out)
 		    (declare (type stream out in))


Index: src/utility-functions.lisp
diff -u src/utility-functions.lisp:1.9 src/utility-functions.lisp:1.10
--- src/utility-functions.lisp:1.9	Thu Mar  4 08:52:53 2004
+++ src/utility-functions.lisp	Fri Mar  5 17:10:59 2004
@@ -61,4 +61,12 @@
   "Like min, except ignores NILs."
   (apply #'min (remove-if #'null args)))
 
-	
\ No newline at end of file
+(defun meta-escape (string)
+  (declare (simple-string string))
+  (let (stack)
+    (loop for i from 1 upto (length string)
+	  for char across string
+	  when (eql #\\ char)
+	  do (push #\\ stack)
+	  do (push char stack))
+    (coerce (nreverse stack) 'simple-string)))





More information about the linedit-cvs mailing list