From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: RE: PATCH: cleanup in zle_tricky.c
Date: Mon, 22 Mar 1999 16:29:50 +0100 (MET) [thread overview]
Message-ID: <199903221529.QAA18026@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Mon, 22 Mar 1999 17:09:48 +0300
Andrej Borsenkow wrote:
> Ahem ... With old good ZSH ...
>
> bor@itsmx1:~/tmp%> echo $ZSH_VERSION
> 3.1.4
> bor@itsmx1:~/tmp%> l foo
> a1 b1 x1y
> bor@itsmx1:~/tmp%> setopt globcomplete
> bor@itsmx1:~/tmp%> l foo/*1TAB
> bor@itsmx1:~/tmp%> l foo/a1
> foo/a1 foo/b1
> bor@itsmx1:~/tmp%> unsetopt globcomplete
> bor@itsmx1:~/tmp%> l foo/*1TAB
> bor@itsmx1:~/tmp%> l foo/a1 foo/b1
>
> With old style completion and with new style completion and
> > not setting compstate[pattern_match] to anything not starting with a
> > `*', glob completion will insert a `*' at the cursor position.
> > Globbing is only done if expand-or-complete is used and GLOB_COMPLETE
> > is not set, as always.
>
> Sorry? If I can believe manuals (and at least 3.1.4 as you see agrees with
> me :-), in case of expand-or-complete globbing is *always* done first. Only
> if it fails, we do completion. GLOB_COMPLETE tells a) how to insert matches
> and b) what to do if _first_ globbing fails. And I really like this, and I'd
> like to have it back :-)
We are discussion two different things simultaneously, let's separate
them:
1) expand-or-complete and GLOB_COMPLETE
When GLOB_COMPLETE is set, this always kept glob-patterns from being
expanded -- as one can see in the test with 3.1.4 you have shown
above. In fact, if globbing would always be used first,
GLOB_COMPLETE would be pretty useless, wouldn't it?
Also, it would have surprised me if my patches would have changed
this behavior (which I can confirm with 3.0.5 and 3.1.4) since I
didn't even come near the test that keeps globbing from being used
when GLOB_COMPLETE is set. And this at least was documented:
When the current word has a glob pattern, do not insert all the words
resulting from the expansion but generate matches as for completion
2) inserting a `*' with GLOB_COMPLETE
After trying it with 3.0.5 and 3.1.4 I can say that they really
behaved the same way it does now, always inserting the `*',
different from what you have shown above, and it works for me with
both old and new completion -- is your 3.1.4 some interim version?
> With brand new zsh (without your last patch) with GLOB_COMPLETE:
>
> bor@itsrm2:~/test%> touch cd/{a1,b1,x1y}
> bor@itsrm2:~/test%> l cd/*1TAB
> bor@itsrm2:~/test%> l cd/a1
> a1 b1 x1y
>
> Without GLOB_COMPLETE it simply beeps.
With GLOB_COMPLETE this is as it should be, without GLOB_COMPLETE I
get the filenames inserted when using expand-or-complete and nothing
with complete-word -- which is as it should be, too.
So, if you still get behavior different from the one I described, I'd
like to find out why, but can't do that without further information.
For now I'd just change the docs -- they where wrong, indeed.
Now we can discuss if we should change something, and how (although
that would be an incompatible change, so...).
Side note: we could easily implement a completer function that
temporarily switches on compstate[pattern_match] and then tries
completion, so that with `compconf completer=_complete:_glob_complete'
and GLOB_COMPLETE unset one would get globbing completion only if
non-globbing completion didn't generate any matches (I'm currently in
search of things we could use this completer stuff for...;-).
Bye
Sven
diff -u od/Zsh/options.yo Doc/Zsh/options.yo
--- od/Zsh/options.yo Mon Mar 22 13:45:07 1999
+++ Doc/Zsh/options.yo Mon Mar 22 15:51:09 1999
@@ -343,11 +343,11 @@
item(tt(GLOB_COMPLETE))(
When the current word has a glob pattern, do not insert all the words
resulting from the expansion but generate matches as for completion and
-cycle through them like tt(MENU_COMPLETE). If no matches are found, a
-`tt(*)' is added to the end of the word or inserted at the cursor if
-tt(COMPLETE_IN_WORD) is set, and completion is attempted again using
-pattern matching. Since this doesn't use globbing, it works not only for
-files but for all completions, such as options, user names, etc.
+cycle through them like tt(MENU_COMPLETE). The matches are generated
+as if a `tt(*)' is added to the end of the word or inserted at the cursor if
+tt(COMPLETE_IN_WORD) is set. Since this doesn't use globbing, it
+works not only for files but for all completions, such as options,
+user names, etc.
)
pindex(GLOB_DOTS)
cindex(globbing, of . files)
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-03-22 15:30 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-22 15:29 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-03-24 12:29 Sven Wischnowsky
1999-03-23 9:51 Sven Wischnowsky
1999-03-24 10:41 ` Andrej Borsenkow
1999-03-22 15:43 Sven Wischnowsky
1999-03-22 17:45 ` Andrej Borsenkow
1999-03-22 14:28 Sven Wischnowsky
1999-03-22 15:32 ` Andrej Borsenkow
1999-03-22 13:55 Sven Wischnowsky
1999-03-22 14:09 ` Andrej Borsenkow
1999-03-22 14:17 ` Andrej Borsenkow
1999-03-22 10:56 Sven Wischnowsky
1999-03-22 13:02 ` Andrej Borsenkow
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199903221529.QAA18026@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).