zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: _cvs
Date: 09 Sep 1999 17:50:01 +0900	[thread overview]
Message-ID: <rsqhfl4mpty.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Sven Wischnowsky's message of "Thu, 9 Sep 1999 10:23:53 +0200 (MET DST)"

In article <199909090823.KAA02107@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> The patch below is a bit of a hack: it tests if there is only one
> string in the display list and if so, it makes this string be
> displayed as if it had a newline -- so that the other groups are 
> separately put into columns.

Hm.

> Again, yes, it was. Since display lists are so special with respect to 
> listing, the `-y' enforces the opening of a new group, treated
> completely differently and *not* with the name given with `-[JV]' in
> the same call to `comp{ctl,add,gen}'.

I see.

> The patch below at least makes the explanation string be added to the
> group named by a `-[JV]' option, if any. But you still get different
> groups, i.e. the output now looks like:
> 
>   option
>   abc   def
>   mno   pqr

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.

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

Index: Completion/Debian/_apt_arguments
===================================================================
RCS file: /projects/zsh/zsh/Completion/Debian/_apt_arguments,v
retrieving revision 1.1.1.2
diff -u -F^( -r1.1.1.2 _apt_arguments
--- _apt_arguments	1999/09/08 21:05:57	1.1.1.2
+++ _apt_arguments	1999/09/09 08:42:52
@@ -73,8 +73,12 @@
 'if [[ $PREFIX = -'"$short_seq"' ]]; then
   apt_consume_short ${PREFIX[2,-1]}
   tmp1=(${${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}#-})
-  tmp2=(-${^tmp1})
-  compadd "$expl_opt[@]" -y "($tmp2)" - ${PREFIX}${^tmp1}
+  if [[ $PREFIX = - ]]; then
+    compadd "$expl_opt[@]" - -${^tmp1}
+  else
+    tmp2=(-${^tmp1})
+    compadd "$expl_opt[@]" -y "($tmp2)" - ${PREFIX}${^tmp1}
+  fi
 elif [[ -z "$PREFIX" ]]; then
   compadd "$expl_opt[@]" - ${(M)${(s:,:)${(kj:,:)options[(R)*~0]}}:#-?}
 fi'
-- 
Tanaka Akira


  reply	other threads:[~1999-09-09  8:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-09  8:23 Sven Wischnowsky
1999-09-09  8:50 ` Tanaka Akira [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  9:14 Sven Wischnowsky
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=rsqhfl4mpty.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --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).