From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Completion/matching control problem
Date: Mon, 2 Aug 1999 14:36:58 +0200 (MET DST) [thread overview]
Message-ID: <199908021236.OAA13350@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Sven Wischnowsky's message of Mon, 2 Aug 1999 13:28:06 +0200 (MET DST)
Felix Rosencrantz wrote:
> Here's a problem with matching control that I encountered. I've been
> meaning to send this patch in for some time. If I understood the code
> better, I think I provide a cleaner test case.
>
> mkdir bug
> cd bug
> touch Abc-Def-Ghij.txt
> touch Abc-def.ghi.jkl_mno.pqr.txt
> touch Abc_def_ghi_jkl_mno_pqr.txt
> compctl -M 'm:{a-z}={A-Z} r:|[.,_-]=*'
> ls a-a<TAB>
There was also a problem in join_strs() which could cause an endless
loop. And if you have a matcher such as `m:-=[-_]', the string
inserted was sometimes not what you'd expect, e.g. after `ls Abc-d<TAB>'
where the `d' was removed. This was caused by the loop in
join_clines() which tried to find matching anchors even if the
prefixes before the current anchors matched. For now I have just
unc-commented that code -- I still like the idea.
Bye
Sven
diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c Mon Aug 2 13:29:22 1999
+++ Src/Zle/zle_tricky.c Mon Aug 2 14:31:20 1999
@@ -2871,7 +2871,8 @@
*ap += mp->wlen; *alp -= mp->wlen;
*bp += bl; *blp -= bl;
t = 1;
- }
+ } else
+ t = 0;
}
}
}
@@ -3422,6 +3423,11 @@
}
/* Now see if they have matching anchors. If not, cut the list. */
if (!(o->flags & CLF_MID) && !cmp_anchors(o, n, 1)) {
+#if 0
+ /* This used to search forward for matching anchors.
+ * Unfortunately this does the wrong thing if the prefixes
+ * before the differing anchors match nicely. */
+
Cline t, tn;
for (t = n; (tn = t->next) && !cmp_anchors(o, tn, 1); t = tn);
@@ -3430,6 +3436,7 @@
n = tn;
continue;
} else {
+#endif
if (o->flags & CLF_SUF)
break;
@@ -3438,7 +3445,9 @@
free_cline(o->next);
o->next = NULL;
o->flags |= CLF_MISS;
+#if 0
}
+#endif
}
/* Ok, they are equal, now join the sub-lists. */
if (o->flags & CLF_MID)
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-08-02 12:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-08-02 12:36 Sven Wischnowsky [this message]
-- strict thread matches above, loose matches on Subject: below --
1999-08-02 12:50 Sven Wischnowsky
1999-08-02 11:28 Sven Wischnowsky
1999-07-28 17:47 Felix Rosencrantz
1999-07-29 8:03 ` Peter Stephenson
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=199908021236.OAA13350@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).