[Linedit-cvs] CVS update: src/complete.lisp src/editor.lisp src/linedit.asd src/version.lisp-expr

Nikodemus Siivola nsiivola at common-lisp.net
Fri Mar 5 18:58:58 UTC 2004


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

Modified Files:
	complete.lisp editor.lisp linedit.asd version.lisp-expr 
Log Message:
 * Fixed an off-by-one error.
 * Even better filename completion.

Date: Fri Mar  5 13:58:58 2004
Author: nsiivola

Index: src/complete.lisp
diff -u src/complete.lisp:1.3 src/complete.lisp:1.4
--- src/complete.lisp:1.3	Fri Mar  5 13:21:36 2004
+++ src/complete.lisp	Fri Mar  5 13:58:58 2004
@@ -30,6 +30,11 @@
     (:directory t)
     (:symbolic-link (file-kind (merge-pathnames (read-link pathname) pathname)))))
 
+(defun relative-pathname-p (pathname)
+  (let ((dir (pathname-directory pathname)))
+    (or (null dir)
+	(eq :relative (car dir)))))
+
 ;; This version of directory-complete isn't nice to symlinks, and
 ;; should be replaced by something backed by foreign glue.
 (defun directory-complete (string)
@@ -37,13 +42,16 @@
   (let* ((common nil)
 	 (all nil)
 	 (max 0)
-	 (dir (pathname-directory-pathname string)))
+	 (dir (pathname-directory-pathname string))
+	 (namefun (if (relative-pathname-p string)
+		      #'namestring
+		      (lambda (x) (namestring (merge-pathnames x))))))
     (unless (underlying-directory-p dir)
       (return-from directory-complete (values nil 0)))
     (with-directory-iterator (next dir)
       (loop for entry = (next)
 	    while entry
-	    do (let* ((full (namestring (merge-pathnames entry)))
+	    do (let* ((full (funcall namefun entry))
 		      (diff (mismatch string full)))
 		 (dbg "~& completed: ~A, diff: ~A~%" full diff)
 		 (unless (< diff (length string))


Index: src/editor.lisp
diff -u src/editor.lisp:1.11 src/editor.lisp:1.12
--- src/editor.lisp:1.11	Sat Feb 28 06:32:05 2004
+++ src/editor.lisp	Fri Mar  5 13:58:58 2004
@@ -145,7 +145,7 @@
 if the point is just after a word, or the point."
   (with-editor-point-and-string ((point string) editor)
     (if (or (not (at-delimiter-p string point))
-	    (not (at-delimiter-p string (1- point))))
+	    (not (and (plusp point) (at-delimiter-p string (1- point)))))
 	(1+ (or (position-if 'word-delimiter-p string :end point :from-end t) 
 		-1)) ; start of string
 	point)))
@@ -157,7 +157,7 @@
     (let ((tmp (cond ((at-delimiter-p string point)
 		      (position-if-not 'word-delimiter-p string 
 				       :end point :from-end t))
-		     ((at-delimiter-p string (1- point))
+		     ((and (plusp point) (at-delimiter-p string (1- point)))
 		      (position-if-not 'word-delimiter-p string
 				       :end (1- point) :from-end t))
 		     (t point))))


Index: src/linedit.asd
diff -u src/linedit.asd:1.26 src/linedit.asd:1.27
--- src/linedit.asd:1.26	Fri Mar  5 13:21:36 2004
+++ src/linedit.asd	Fri Mar  5 13:58:58 2004
@@ -48,7 +48,7 @@
     (error 'operation-error :component c :operation o)))
 
 (defsystem :linedit
-    :version "0.15.8"
+    :version "0.15.9"
     :depends-on (:uffi :terminfo :osicat)
     :components
   (;; Common


Index: src/version.lisp-expr
diff -u src/version.lisp-expr:1.11 src/version.lisp-expr:1.12
--- src/version.lisp-expr:1.11	Fri Mar  5 13:21:36 2004
+++ src/version.lisp-expr	Fri Mar  5 13:58:58 2004
@@ -1 +1 @@
-0.15.8
+0.15.9





More information about the linedit-cvs mailing list