From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20324 invoked from network); 28 Dec 1999 11:59:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Dec 1999 11:59:50 -0000 Received: (qmail 11531 invoked by alias); 28 Dec 1999 11:59:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9162 Received: (qmail 11521 invoked from network); 28 Dec 1999 11:59:35 -0000 To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: regexparse In-reply-to: "Tanaka Akira"'s message of "25 Dec 1999 20:37:58 +0900." Date: Tue, 28 Dec 1999 12:01:05 +0000 From: Peter Stephenson Message-Id: Tanaka Akira wrote: > This patch make regexparse to call completion actions even if command > line is valid. I'd rather it was called zregexparse if it's to be a builtin, to avoid clashes and maintain consistency. Index: Completion/Base/_regex_arguments =================================================================== RCS file: /home/pws/CVSROOT/projects/zsh/Completion/Base/_regex_arguments,v retrieving revision 1.3 diff -u -r1.3 _regex_arguments --- Completion/Base/_regex_arguments 1999/12/28 11:52:37 1.3 +++ Completion/Base/_regex_arguments 1999/12/28 11:53:15 @@ -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 -c _ra_p1 _ra_p2 "$_ra_line" '"${(j: :)${(qqqq)regex[@]}}"' + zregexparse -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: /home/pws/CVSROOT/projects/zsh/Src/Modules/zutil.c,v retrieving revision 1.3 diff -u -r1.3 zutil.c --- Src/Modules/zutil.c 1999/12/28 11:52:37 1.3 +++ Src/Modules/zutil.c 1999/12/28 11:53:45 @@ -721,7 +721,7 @@ return 1; } -/* Regexparse stuff. */ +/* Zregexparse stuff. */ typedef struct { int cutoff; @@ -1105,7 +1105,7 @@ } /* - usage: regexparse string regex... + usage: zregexparse string regex... status: 0: matched 1: unmatched (all next state candidates are failed) @@ -1114,7 +1114,7 @@ */ static int -bin_regexparse(char *nam, char **args, char *ops, int func) +bin_zregexparse(char *nam, char **args, char *ops, int func) { int oldextendedglob = opts[EXTENDEDGLOB]; char *var1 = args[0]; @@ -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, "c", NULL), + BUILTIN("zregexparse", 0, bin_zregexparse, 3, -1, 0, "c", NULL), }; -- Peter Stephenson