Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: compinstall and non-default file



> With the following file generated by compinstall it cannot find it's
> definition. I'd expected it to parse the file.

Yes, this was just plain stupidity.  Even if it had registered that you'd
edited it, it would have tried to search the name before you edited it.
I've put in a test that the file you give does have definitions in it.

Index: Completion/Core/compinstall
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/compinstall,v
retrieving revision 1.8
diff -u -r1.8 compinstall
--- Completion/Core/compinstall	2000/04/27 20:44:48	1.8
+++ Completion/Core/compinstall	2000/04/28 09:20:03
@@ -69,9 +69,19 @@
 file where these can be found.  Note that this will only work if they
 are exactly the form in which compinstall inserted them.  If you leave
 the line as it is, or empty, I won't search."
-  vared -ch -p 'file> ' newifile
-  [[ -z $newifile || $ifile = $newifile ]] && foundold=false
+  while true;  do
+    vared -ch -p 'file> ' newifile
+    if [[ -n $newifile && $ifile != $newifile ]]; then
+      if __ci_test_ifile $newifile; then
+        foundold=true
+	break
+      fi
+      print "I couldn't find any definitions there.  Edit a new filename, or
+leave the line blank to ignore it."
+    fi
+  done
 fi
+ifile=$newifile
 
 if [[ $foundold = true ]]; then
   sed -n "/^[   ]*$startline/,/^[       ]*$endline/p" $ifile |


-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author