[Linedit-cvs] CVS update: src/complete.lisp src/utility-functions.lisp
Nikodemus Siivola
nsiivola at common-lisp.net
Sun Apr 25 11:40:18 UTC 2004
Update of /project/linedit/cvsroot/src
In directory common-lisp.net:/tmp/cvs-serv32280
Modified Files:
complete.lisp utility-functions.lisp
Log Message:
* Fixed a bug in completion (when completion was attempted on a fully completed name)
* Default of :if-exists :append to start-debug
Date: Sun Apr 25 07:40:18 2004
Author: nsiivola
Index: src/complete.lisp
diff -u src/complete.lisp:1.7 src/complete.lisp:1.8
--- src/complete.lisp:1.7 Thu Apr 22 22:33:18 2004
+++ src/complete.lisp Sun Apr 25 07:40:18 2004
@@ -73,12 +73,12 @@
with max
for cand in matches
do (let ((diff (mismatch string cand)))
- (unless (< diff (length string))
- (setf common (if common
- (subseq common 0 (mismatch common cand))
- cand)
- max (max max (length cand))
- all (cons cand all))))
+ (when (and diff (> diff (length string)))
+ (setf common (if common
+ (subseq common 0 (mismatch common cand))
+ cand)
+ max (max max (length cand))
+ all (cons cand all))))
finally (if (or (null common)
(<= (length common) (length string)))
(return (values all max))
@@ -121,7 +121,7 @@
do (let* ((full (funcall namefun entry))
(diff (mismatch string full)))
(dbg "~& completed: ~A, diff: ~A~%" full diff)
- (unless (< diff (length string))
+ (unless (and diff (< diff (length string)))
(dbg "~& common ~A mismatch ~A~&" common
(mismatch common full))
(setf common (if common
Index: src/utility-functions.lisp
diff -u src/utility-functions.lisp:1.12 src/utility-functions.lisp:1.13
--- src/utility-functions.lisp:1.12 Mon Apr 12 09:34:50 2004
+++ src/utility-functions.lisp Sun Apr 25 07:40:18 2004
@@ -50,7 +50,9 @@
(defun start-debug (pathname &rest open-args)
"Start linedit debugging output to pathname, with additional
open-args passed to `open'."
- (setf *debug* (apply #'open pathname :direction :output open-args)))
+ (setf *debug* (apply #'open pathname
+ :direction :output
+ (append open-args '(:if-exists :append)))))
(defun end-debug ()
"End linedit debugging output."
More information about the linedit-cvs
mailing list