zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.dk
Subject: Re: About the new long/short options changes
Date: Mon, 30 Jul 2001 10:38:56 +0200 (MET DST)	[thread overview]
Message-ID: <200107300838.KAA27378@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: <200107300822.KAA27055@beta.informatik.hu-berlin.de>

I wrote:

> ...
> 
> Second, trying `gzip <TAB>' with `prefix-needed == false' didn't show
> files because of the return value of _arguments.  We've (ok: I) changed
> this several times now and can only hope it doesn't interfere with other
> complicated functions using _arguments.

Urgh.  Thinko.  This doesn't work because there may be no matches in the
completions generated by the calling function.  Damn.

I comment this out for now.  If noone sees a better solution, the thing
to do might be to make all functions using `->state' actions compare
$compstate[nmatches] to its previous value on exit.


Bye
  Sven

? Completion/Unix/Command/_gzip#
Index: Completion/Base/Utility/_arguments
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/Utility/_arguments,v
retrieving revision 1.8
diff -u -r1.8 _arguments
--- Completion/Base/Utility/_arguments	2001/06/06 09:31:54	1.8
+++ Completion/Base/Utility/_arguments	2001/07/30 08:36:39
@@ -428,6 +428,14 @@
 
   if [[ -n "$aret" ]]; then
     [[ -n $rawret ]] && return 300
+
+### Returning non-zero would allow the calling function to add its own
+### completions if we generated only options and have to use a ->state
+### action.  But if that then doesn't generate matches, the calling
+### function's return value would be wrong unless it compares
+### $compstate[nmatches] to its previous value.  Ugly.
+###
+###    return 1
   else
     [[ -n "$noargs" && nm -eq "$compstate[nmatches]" ]] && _message "$noargs"
   fi
Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.70
diff -u -r1.70 computil.c
--- Src/Zle/computil.c	2001/07/27 12:56:57	1.70
+++ Src/Zle/computil.c	2001/07/30 08:36:40
@@ -4281,9 +4281,7 @@
     SWITCHHEAPS(oldheap, compheap) {
 	while ((n = *args++)) {
 	    endcmgroup(NULL);
-	    begcmgroup(n, 0);
-	    endcmgroup(NULL);
-	    begcmgroup(n, CGF_NOSORT);
+	    begcmgroup(n, CGF_NOSORT|CGF_UNIQCON);
 	    endcmgroup(NULL);
 	    begcmgroup(n, CGF_UNIQALL);
 	    endcmgroup(NULL);
@@ -4291,7 +4289,9 @@
 	    endcmgroup(NULL);
 	    begcmgroup(n, CGF_UNIQALL);
 	    endcmgroup(NULL);
-	    begcmgroup(n, CGF_NOSORT|CGF_UNIQCON);
+	    begcmgroup(n, CGF_NOSORT);
+	    endcmgroup(NULL);
+	    begcmgroup(n, 0);
 	}
     } SWITCHBACKHEAPS(oldheap);
 

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


      reply	other threads:[~2001-07-30  8:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-20  5:01 Bart Schaefer
2001-07-20  7:38 ` Sven Wischnowsky
2001-07-20  9:26   ` Bart Schaefer
2001-07-20  9:43     ` Andrej Borsenkow
2001-07-25  8:49     ` Sven Wischnowsky
2001-07-25  9:15       ` Borsenkow Andrej
2001-07-25  9:20         ` Sven Wischnowsky
2001-07-25  9:24           ` Borsenkow Andrej
2001-07-25 10:13         ` Peter Stephenson
2001-07-25 10:43           ` Sven Wischnowsky
2001-07-25 11:36             ` Borsenkow Andrej
2001-07-25 12:16               ` Sven Wischnowsky
2001-07-25 12:35                 ` Sven Wischnowsky
2001-07-25 17:49             ` Bart Schaefer
2001-07-27 12:53               ` Sven Wischnowsky
2001-07-30  8:22                 ` Sven Wischnowsky
2001-07-30  8:38                   ` Sven Wischnowsky [this message]

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=200107300838.KAA27378@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.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).