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: _cvs
Date: Thu, 9 Sep 1999 11:14:17 +0200 (MET DST)	[thread overview]
Message-ID: <199909090914.LAA02499@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 09 Sep 1999 17:50:01 +0900


Tanaka Akira wrote:

> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% _tst () { compadd -J option -X option -y '(mno pqr)' ghi jkl; compadd -J option -X option abc def } 
> is27e1u11% tst 
> mno   pqr   
> option
> abc   def   
> 
> This test case excahnges the order of two `compadd'. I think it's not
> intentional.

Yes, I just stumbled over this, too. The problem was just that the
group named by the `-[JV]' wasn't created before the one for the `-y', 
so the explanation string showed up in the wrong place.

> Also, I modified _apt_arguments not to use -y if it is un unnecessary.

Yep, I've just done something similar for `_display'.

Bye
 Sven

diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c	Thu Sep  9 11:04:39 1999
+++ Src/Zle/zle_tricky.c	Thu Sep  9 11:07:58 1999
@@ -3951,16 +3951,21 @@
 		} else
 		    dat->prpre = dupstring(dat->prpre);
 		/* Select the group in which to store the matches. */
-		if (dat->group || dat->ylist) {
+		if (dat->group) {
 		    endcmgroup(NULL);
-		    begcmgroup((dat->ylist ? NULL : dat->group),
-			       (dat->aflags & CAF_NOSORT));
+		    begcmgroup(dat->group, (dat->aflags & CAF_NOSORT));
 		    if (dat->aflags & CAF_NOSORT)
 			mgroup->flags |= CGF_NOSORT;
 		} else {
 		    endcmgroup(NULL);
 		    begcmgroup("default", 0);
 		}
+		if (dat->ylist) {
+		    endcmgroup(NULL);
+		    begcmgroup(NULL, (dat->aflags & CAF_NOSORT));
+		    if (dat->aflags & CAF_NOSORT)
+			mgroup->flags |= CGF_NOSORT;
+		}
 		/* Select the set of matches. */
 		oisalt = (dat->aflags & CAF_ALT);
 
@@ -5944,9 +5949,13 @@
     curcc = cc;
 
     mflags = 0;
-    if (cc->ylist || cc->gname) {
+    if (cc->gname) {
+	endcmgroup(NULL);
+	begcmgroup(cc->gname, cc->mask2 & CC_NOSORT);
+    }
+    if (cc->ylist) {
 	endcmgroup(NULL);
-	begcmgroup((cc->ylist ? NULL : cc->gname), cc->mask2 & CC_NOSORT);
+	begcmgroup(NULL, cc->mask2 & CC_NOSORT);
     }
     if (cc->mask & CC_REMOVE)
 	mflags |= CMF_REMOVE;
--- oldcompletion/Core/_display	Wed Sep  8 16:19:38 1999
+++ Completion/Core/_display	Thu Sep  9 11:11:56 1999
@@ -39,7 +39,7 @@
   # descriptions.
 
   _simple=()
-  _len=1
+  _len=-1
   for _i in "$_arr[@]";  do
     _tmp="${#_i%%:*}"
     if [[ "$_i" = *:?* ]]; then
@@ -48,6 +48,11 @@
       _simple=( "$_simple[@]" "${_i%:}" )
     fi
   done
+
+  if [[ _len -lt 0 ]]; then
+    eval "${_param}=''"
+    return 1
+  fi
 
   # Now we build the list in `_tmp', adding one line per string.
 

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


             reply	other threads:[~1999-09-09  9:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-09  9:14 Sven Wischnowsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-09-06 15:23 Oliver Kiddle
2000-05-16  0:06 Tanaka Akira
1999-09-09  8:23 Sven Wischnowsky
1999-09-09  8:50 ` Tanaka Akira
1999-09-08 14:56 Tanaka Akira
1999-07-28 17:23 Tanaka Akira
1999-07-28 17:50 ` Tanaka Akira

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=199909090914.LAA02499@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).