From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10015 invoked from network); 25 Dec 1999 11:38:06 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Dec 1999 11:38:06 -0000 Received: (qmail 15405 invoked by alias); 25 Dec 1999 11:38:00 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9156 Received: (qmail 15398 invoked from network); 25 Dec 1999 11:38:00 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: regexparse References: MIME-Version: 1.0 (generated by AKEMI 1.13.2 - =?ISO-2022-JP?B?Ig==?= =?ISO-2022-JP?B?GyRCQTA0Y0s8GyhCIg==?=) Content-Type: text/plain; charset=US-ASCII From: Tanaka Akira Date: 25 Dec 1999 20:37:58 +0900 In-Reply-To: Tanaka Akira's message of "25 Dec 1999 09:41:08 +0900" Message-ID: User-Agent: Chao-gnus/6.12.5 AKEMI/1.13.2 (=?ISO-2022-JP?B?GyRCQTAbKEI=?= =?ISO-2022-JP?B?GyRCNGNLPBsoQg==?=) FLAM-DOODLE/1.12.6 (=?ISO-2022-JP?B?GyRCM3cbKEI=?= 10R4.0/5.0) Emacs/20.4 (sparc-sun-solaris2.6) MULE/4.0 (HANANOEN) In article , Tanaka Akira writes: > Finally, I re-implemented most of `_regex_arguments' in C. > This should accelerate `_apt'. Oops. I found that `apt-config shell ' prints `no more arguments'. This is caused by regexparse doesnot execute completion actions since `apt-config shell ' is already valid command line. This patch make regexparse to call completion actions even if command line is valid. Index: Completion/Base/_regex_arguments =================================================================== RCS file: /projects/zsh/zsh/Completion/Base/_regex_arguments,v retrieving revision 1.1.1.11 diff -u -r1.1.1.11 _regex_arguments --- Completion/Base/_regex_arguments 1999/12/25 00:41:47 1.1.1.11 +++ Completion/Base/_regex_arguments 1999/12/25 11:31:19 @@ -70,7 +70,7 @@ "$funcname"' () { local _ra_p1 _ra_p2 _ra_left _ra_right _ra_com local _ra_actions _ra_line="${(pj:\0:)${(@)words[1,CURRENT - 1]:Q}}"$'\''\0'\''"$PREFIX" - regexparse _ra_p1 _ra_p2 "$_ra_line" '"${(j: :)${(qqqq)regex[@]}}"' + regexparse -c _ra_p1 _ra_p2 "$_ra_line" '"${(j: :)${(qqqq)regex[@]}}"' case "$?" in 0|2) _message "no more arguments";; 1) Index: Src/Modules/zutil.c =================================================================== RCS file: /projects/zsh/zsh/Src/Modules/zutil.c,v retrieving revision 1.1.1.5 diff -u -r1.1.1.5 zutil.c --- Src/Modules/zutil.c 1999/12/25 00:42:05 1.1.1.5 +++ Src/Modules/zutil.c 1999/12/25 11:31:22 @@ -992,7 +992,7 @@ } static int -rmatch(RParseResult *sm, char *subj, char *var1, char *var2) +rmatch(RParseResult *sm, char *subj, char *var1, char *var2, int comp) { LinkNode ln, lnn; LinkList nexts; @@ -1080,8 +1080,8 @@ } } while(ln); - if(!*subj) - for(ln = firstnode(sm->out); ln; ln = nextnode(ln)) { + if(!comp && !*subj) + for(ln = firstnode(sm->out); ln; ln = nextnode(ln)) { br = getdata(ln); if(br->state == st) { for(ln = firstnode(br->actions); ln; ln = nextnode(ln)) { @@ -1141,7 +1141,7 @@ ret = 0; if(!ret) - ret = rmatch(&result, subj, var1, var2); + ret = rmatch(&result, subj, var1, var2, ops['c']); popheap(); } LASTALLOC; @@ -1152,7 +1152,7 @@ static struct builtin bintab[] = { BUILTIN("zstyle", 0, bin_zstyle, 0, -1, 0, NULL, NULL), BUILTIN("zformat", 0, bin_zformat, 3, -1, 0, NULL, NULL), - BUILTIN("regexparse", 0, bin_regexparse, 3, -1, 0, NULL, NULL), + BUILTIN("regexparse", 0, bin_regexparse, 3, -1, 0, "c", NULL), }; -- Tanaka Akira