Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: regexparse



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 <pws@xxxxxxxxxxxxxxxxxxxxxxxx>



Messages sorted by: Reverse Date, Date, Thread, Author