From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: (was Re: _configure does not work)
Date: Tue, 9 Mar 1999 11:32:33 +0100 (MET) [thread overview]
Message-ID: <199903091032.LAA13868@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Tue, 9 Mar 1999 11:12:37 +0300
Andrej Borsenkow wrote:
> (patches up to and including 5962)
>
> bor@itsrm2:~%> zsh -f
> itsrm2% cd /tools/src
> itsrm2% cd zsh-3.1.5-pws-11
> itsrm2% fpath=($PWD/Completion/*(/))
> itsrm2% source Completion/Core/compinit
> itsrm2% ./configure --prefix=/t<TAB>
> B-e-e-p
The reason for this was that `_configure' didn't give a pattern and
action for things like `=PREFIX'. That's why I said I would like to
know about more patterns that should be used in the functions using
`_long_options'.
> itsrm2% ./configure --e-d<TAB>
> itsrm2% ./configure
> (the whole stuff deleted)
>
> I'd thought, it completed to at least --enable-dynamic before.
I think it didn't, I think it generated a list containing
`--enable-dynamic', `--enable-zsh-debug' and others. This was wrong in
the matching code in zle_tricky.c.
Ok, the patch below changes zle_tricky.c to match only a sub-string up
to a partial-word-separator for each such match spec and it changes
`_configure' to accept some more patterns.
Bye
Sven
diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c Mon Mar 8 10:23:41 1999
+++ Src/Zle/zle_tricky.c Tue Mar 9 11:00:03 1999
@@ -3453,11 +3453,20 @@
* characters are matched by the `*' pattern.
* We do this by looping over the string
* and calling this function recursively. */
- int i = 0, j = iw, k = lw;
+ int i = 0, j = iw, k = lw, m = 0;
int jj = il + mp->llen, kk = ll - mp->llen;
char *p = l + mp->llen, *q = w;
for (; k; i++, j++, k--, q++) {
+ if ((mp->flags & CMF_RIGHT) &&
+ (mp->right && k >= mp->ralen &&
+ pattern_match(mp->right, q,
+ NULL, NULL))) {
+ if (m++) {
+ k = 0;
+ break;
+ }
+ }
if (match_pfx(p, q, NULL, NULL, NULL, NULL))
break;
}
@@ -3679,13 +3688,23 @@
!pattern_match(mp->left, w - mp->lalen,
NULL, NULL));
if (t) {
- int i = 0, j = iw, k = lw;
+ int i = 0, j = iw, k = lw, m = 0;
int jj = il + mp->llen, kk = ll - mp->llen;
char *p = l - mp->llen - 1, *q = w - 1;
- for (; k; i++, j++, k--, q--)
+ for (; k; i++, j++, k--, q--) {
+ if ((mp->flags & CMF_LEFT) &&
+ (mp->left && k >= mp->lalen &&
+ pattern_match(mp->left, q - mp->lalen,
+ NULL, NULL))) {
+ if (m++) {
+ k = 0;
+ break;
+ }
+ }
if (match_pfx(p, q, NULL, NULL, NULL, NULL))
break;
+ }
if (k && i) {
if (nlp) {
nw = addtoword(&rw, &rwlen, nw, mp,
@@ -4195,7 +4214,6 @@
t = s;
if (ppre)
t = dyncat(ppre, t);
- lc = NULL;
if (!cp && !ms && (mstack || psuf)) {
int bl = ((aflags & CAF_MATCH) ? llpl : 0);
Cline *clp = &lc, tlc;
diff -u oc/User/_configure Completion/User/_configure
--- oc/User/_configure Mon Mar 8 11:05:13 1999
+++ Completion/User/_configure Tue Mar 9 11:02:02 1999
@@ -1,3 +1,4 @@
#defcomp configure
-_long_options
+_long_options '*=(E|)PREFIX*' '_files -/' \
+ '*=PROGRAM*' '_command_names'
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-03-09 10:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-09 10:32 Sven Wischnowsky [this message]
1999-03-09 10:47 ` Andrej Borsenkow
1999-03-09 11:36 ` Andrej Borsenkow
1999-03-09 12:54 Sven Wischnowsky
1999-03-09 14:04 ` Andrej Borsenkow
1999-03-09 13:09 Sven Wischnowsky
1999-03-09 13:37 ` Andrej Borsenkow
1999-03-09 13:58 Sven Wischnowsky
1999-03-09 14:25 Sven Wischnowsky
1999-03-09 16:47 ` 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=199903091032.LAA13868@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).