zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: Misc. documentation stuff
Date: Mon, 26 Jun 2000 10:33:43 +0200 (MET DST)	[thread overview]
Message-ID: <200006260833.KAA19008@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Sun, 25 Jun 2000 20:05:15 +0000


Bart Schaefer wrote:

> This patch includes:
> 
> * Add some minimal doc for `compfiles' and `compgroups'.  It'd be really
>   nice if some knowledgable person (hi, Sven) could explain the syntax
>   of these and other commands in computil in a little more detail.  The
>   same goes for zregexparse (hi, Tanaka) in zutil.

I've added a bit, but I still think this is probably too special to
the completion system to require full explanations.

> * Fix some typos under "Matching Control" in compwid.
> 
> * Alphabetize the builtins in computil and add findex entries.

This was at least partly intentional... putting the only things that
might be useful outside of the completion system at the top.

> ...
> 
> I also added back a minimal reference to `compfmt' because it's still
> defined in computil.c and therefore will show up in command completion
> listings and `hash -m' output and so forth.  But it might be better to
> simply remove it entirely.

I forgot that. The patch removes it.


Thanks!

Bye
 Sven

Index: Doc/Zsh/mod_computil.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_computil.yo,v
retrieving revision 1.4
diff -u -r1.4 mod_computil.yo
--- Doc/Zsh/mod_computil.yo	2000/06/25 20:17:33	1.4
+++ Doc/Zsh/mod_computil.yo	2000/06/26 08:32:56
@@ -43,16 +43,22 @@
 findex(compfiles)
 item(tt(compfiles))(
 Used by the tt(_path_files) function to optimize complex recursive
-filename generation (globbing).
+filename generation (globbing).  It does three things.  With the
+tt(-p) and tt(-P) options it builds the glob patterns to use,
+including the paths already handled and trying to optimize the
+patterns with respect to the prefix and suffix from the line and the
+match specification currently used.  The tt(-i) option does the
+directory tests for the tt(ignore-parents) style and the tt(-r) option 
+tests if a component for some of the matches are equal to the string
+on the line and removes all other matches if that is true.
 )
-findex(compfmt)
-item(tt(compfmt))(
-An obsolete form of `tt(zformat -f)'.  Do not use this.
-)
 findex(compgroups)
 item(tt(compgroups))(
 Used by the tt(_tags) function to implement the internals of the
-tt(group-order) style.
+tt(group-order) style.  This only takes its arguments as names of
+completion groups and creates the groups for it (all six types: sorted 
+and unsorted, both without removing duplicates, with removing all
+duplicates and with removing consecutive duplicates).
 )
 findex(compquote)
 item(tt(compquote) var(names) ...)(
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.35
diff -u -r1.35 computil.c
--- Src/Zle/computil.c	2000/06/26 08:10:33	1.35
+++ Src/Zle/computil.c	2000/06/26 08:32:57
@@ -3026,50 +3026,6 @@
     return 0;
 }
 
-static char *
-fmtstr(char *str, char c, char *repl)
-{
-    int len, num, rlen;
-    char *s, *ret, *rp;
-
-    len = strlen(str);
-    rlen = strlen(repl);
-
-    for (num = 0, s = str; *s; s++)
-	if (*s == '%' && s[1] == c)
-	    num++, s++;
-
-    ret = (char *) zhalloc((num * (rlen - 2)) + len + 1);
-
-    for (s = str, rp = ret; *s; s++) {
-	if (*s == '%' && s[1] == c) {
-	    strcpy(rp, repl);
-	    rp += rlen;
-	    s++;
-	} else
-	    *rp++ = *s;
-    }
-    *rp = '\0';
-
-    return ret;
-}
-
-static int
-bin_compfmt(char *nam, char **args, char *ops, int func)
-{
-    char *param = args[0], *str = args[1];
-
-    for (args += 2; *args; args++) {
-	if (args[0][1] != ':') {
-	    zwarnnam(nam, "invalid argument `%s'", args[0], 0);
-	    return 1;
-	}
-	str = fmtstr(str, **args, *args + 2);
-    }
-    setsparam(param, ztrdup(str));
-    return 0;
-}
-
 #define PATH_MAX2 (PATH_MAX * 2)
 
 static LinkList
@@ -3699,7 +3655,6 @@
     BUILTIN("compquote", 0, bin_compquote, 1, -1, 0, NULL, NULL),
     BUILTIN("comptags", 0, bin_comptags, 1, -1, 0, NULL, NULL),
     BUILTIN("comptry", 0, bin_comptry, 0, -1, 0, NULL, NULL),
-    BUILTIN("compfmt", 0, bin_compfmt, 2, -1, 0, NULL, NULL),
     BUILTIN("compfiles", 0, bin_compfiles, 1, -1, 0, NULL, NULL),
     BUILTIN("compgroups", 0, bin_compgroups, 1, -1, 0, NULL, NULL),
 };

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-06-26  8:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-26  8:33 Sven Wischnowsky [this message]
2000-06-26 15:26 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
2000-06-25 20:05 Bart Schaefer

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=200006260833.KAA19008@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).