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

Re: something strange with delete-char-or-list



Andrej Borsenkow wrote:

> bor@itsrm2:~%> compconf -L
> compconf correct_accept='2n'
> compconf match_original='yes'
> compconf completer='_oldlist:_complete:_match'
> compconf dumpfile='/home/bor/.zcompdump'
> compconf oldlist_list='_match'
> compconf path_cursor='yes'
> compconf match_insert='unambig'
> compconf correct_prompt='correct to:'
> bor@itsrm2:~%> ls /a/p/u/z/*^D
> bor@itsrm2:~%> ls /a/p/u/z/*<TAB>
> zip/     zmodem/  zsh/
> bor@itsrm2:~%> ls
> zip/     zmodem/  zsh/
> 
> ??? Where is the command line?

The code in _oldlist said to keep the old list but it didn't
explicitly say what to insert into the line and since there wasn't any 
information about an unambiguous string or something like that
anymore, the word was erased. The patch below makes it be kept or --
if automenu is set -- menu-completion be started.

> And related question:
> 
> bor@itsrm2:~%> ls /a/p/u/z/*<TAB>
> bor@itsrm2:~%> ls /archive/pub/unix/z/\*
> zip/     zmodem/  zsh/
> 
> Is it intentional, that pattern after the first ambiguous component is
> preserved? (Oh, yes, I like it!) Is it possible to output it "as is" then and
> not quouted?

We once had this, but that was a bug -- the path prefix and suffix
wasn't quoted.
I know that it would be nice to have this, but how should _path_files
decide what should be quoted (e.g. a component like `foo bar') and
what not (a pattern like `*[0-9]')?

If you find a solution, let me know.

Bye
 Sven

diff -u oc/Core/_oldlist Completion/Core/_oldlist
--- oc/Core/_oldlist	Thu Jul  8 16:20:29 1999
+++ Completion/Core/_oldlist	Mon Jul 12 09:02:22 1999
@@ -15,6 +15,11 @@
   elif [[ $compconfig[oldlist_list] = *${_lastcomp[completer]}* ]]; then
     [[ "$_lastcomp[insert]" = unambig* ]] && compstate[to_end]=single
     compstate[old_list]=keep
+    if [[ -o automenu ]]; then
+      compstate[insert]=menu
+    else
+      compadd -Qs "$SUFFIX" - "$PREFIX"
+    fi
     return 0
   fi
 fi

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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