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

Re: General comments on completion



Andrej Borsenkow wrote:

> [It started from the example below; but then I realised, it is not a bug - but,
> probably, unwanted feature]
> 
> bor@itsrm2:/tools/src/zsh-3.1.5-pws-24%> patch -p0 --dry-run <
> /a/p/u/z/p/*24/<6909-><TAB>
> bor@itsrm2:/tools/src/zsh-3.1.5-pws-24%> patch -p0 --dry-run < /archive/pub/unix
> /zsh/patches/pws-24/69<TAB>
> 6926   6933   6936   6937   6939   6941   6945   6946   6947
> bor@itsrm2:/tools/src/zsh-3.1.5-pws-24%> patch -p0 --dry-run < /archive/pub/unix
> /zsh/patches/pws-24/6901
> 6901   6903   6908   6933   6937   6941   6946
> 6902   6904   6926   6936   6939   6945   6947

We already had this once or twice (or thrice, or...). The problem is
that you sometimes want only the prefix to expand and the rest of the
line left unchanged (if the thing inside the path is ambiguous). But
unless someone modifies _match to try to keep trailing patterns that
were not substituted by matched parts, we have this -- admittedly ugly
-- behavior. I have this still lingering on my todo-list, but I'm not
sure if this could really be done (not everything is a pathname).

Btw. have you tried `compconf path_expand=yes' lately?

> Is it possible to insert prefix but still do not exit the current completion
> "session"? So, that the list that was generated first is used also for possible
> menu completion? I tried _oldlist - but it does not seem to work (this is with
> modified _match that always inserts prefix):

It can be done with _oldlist if we enhance it a bit... this is left as 
an exercise for the interested reader (at least for now ;-).

Seems I forgot to send the patch below.

Bye
 Sven

diff -u oc/Core/_path_files Completion/Core/_path_files
--- oc/Core/_path_files	Mon Jul  5 10:24:16 1999
+++ Completion/Core/_path_files	Mon Jul  5 14:07:25 1999
@@ -377,7 +377,7 @@
 exppaths=( "${(@)exppaths:#$orig}" )
 
 if [[ -n "$compconfig[path_expand]" &&
-      $#exppaths -eq 0 && nm -eq compstate[nmatches] ]]; then
+      $#exppaths -eq 1 && nm -eq compstate[nmatches] ]]; then
   compadd -QU -S '' "$group[@]" "$expl[@]" -i "$IPREFIX" -I "$ISUFFIX" \
           -M 'r:|/=* r:|=*' -p "$linepath" - "${(@)exppaths}"
 fi

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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