* General comments on completion
@ 1999-07-03 12:41 Andrej Borsenkow
0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 1999-07-03 12:41 UTC (permalink / raw)
To: ZSH workers mailing list
[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
Actually, when writing this I realised what happens ... instead of using old
list completion builds new one. This is obviously the result of me setting
compconf match_insert=unambig ... that makes completion to "forget" about
previously generated list ... No, this can't be right.
I am speaking as an illiterate user now. After I pressed TAB the first time, I
got a list of matches. And now I expect, that this list of matches will be
retained until I'm through with completing of current word. Anything else is
very confusing.
Yes, I understand, that when completion inserts prefix, it considers the whole
story done. This was (and still is) true as long as we complete only prefix -
but it is wrong with general glob patterns.
So, I ask others - how often do you complete glob patterns in real life? I find
it often better when I know the real name but it won't be unique if I write only
prefixes. Using glob pattern(s) I can then specify the name unambiguously and
still save typing.
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):
bor@itsrm2:/archive/pub/unix/zsh/patches/pws-24%> compconf
completer='_oldlist:_complete:_match'
bor@itsrm2:/archive/pub/unix/zsh/patches/pws-24%> l <6909-><TAB>
bor@itsrm2:/archive/pub/unix/zsh/patches/pws-24%> l 69<TAB>
6926 6933 6936 6937 6939 6941 6945 6946 6947 6955 6956
bor@itsrm2:/archive/pub/unix/zsh/patches/pws-24%> l 6901
6901 6903 6908 6933 6937 6941 6946 6955
6902 6904 6926 6936 6939 6945 6947 6956
/andrej
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: General comments on completion
@ 1999-07-05 12:19 Sven Wischnowsky
0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1999-07-05 12:19 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1999-07-05 12:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-03 12:41 General comments on completion Andrej Borsenkow
1999-07-05 12:19 Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).