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: _archie
Date: Mon, 18 Oct 1999 11:16:58 +0200 (MET DST)	[thread overview]
Message-ID: <199910180916.LAA25903@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 16 Oct 1999 13:47:29 +0900


Tanaka Akira wrote:

> I wrote a completion function for _archie.
> 
> But it has a problem.
> 
> Z:akr@is27e1u11% Src/zsh -f
> is27e1u11% bindkey -e; fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
> is27e1u11% compconf group_matches=yes message_format='%d' description_format='%d'
> is27e1u11% compconf describe_options=yes describe_values=yes option_prefix=yes
> is27e1u11% archie -<TAB>
> 
> ->
> 
> is27e1u11% archie -
> string
> 
> Why aren't descriptions of options displayed?

Combination of `computil' not reporting that options are allowed at
that position and a bit of stupidity in `_arguments'.


You are writing a lot of interesting completion functions, very nice,
thank you.

And before I forget to mention it... if someone wonders why I changed
`_dvi' to use `_arguments' a while ago, but didn't change `_ps' and
`_pspdf' and why I added `_yp', but not `_nis' (for the NIS+
commands): it's because I don't have many of the commands mentioned in 
`_ps' and `_pspdf' and we don't have NIS+ installed here, so I
couldn't test a completion function for it. So if someone finds the
time...

Bye
 Sven

diff -u oldsrc/Zle/computil.c Src/Zle/computil.c
--- oldsrc/Zle/computil.c	Mon Oct 18 11:10:39 1999
+++ Src/Zle/computil.c	Mon Oct 18 11:10:52 1999
@@ -976,13 +976,13 @@
 	    else
 		state.curopt = NULL;
 	} else {
-	    state.opt = (line[0] && line[1]);
+	    state.opt = (line[0] ? (line[1] ? 2 : 1) : 0);
 	    state.arg = 1;
 	    state.curopt = NULL;
 	}
 	pe = NULL;
 
-	if (state.opt && (state.curopt = ca_get_opt(d, line, 0, &pe))) {
+	if (state.opt == 2 && (state.curopt = ca_get_opt(d, line, 0, &pe))) {
 	    ddef = state.def = state.curopt->args;
 	    doff = pe - line;
 	    state.optbeg = state.argbeg = state.inopt = cur;
@@ -1009,7 +1009,7 @@
 	    }
 	    if (!state.def)
 		state.curopt = NULL;
-	} else if (state.opt && d->single &&
+	} else if (state.opt == 2 && d->single &&
 		   (state.curopt = ca_get_sopt(d, line, 0, &pe))) {
 	    char *p;
 	    Caopt tmpopt;
diff -u oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments	Mon Oct 18 09:48:45 1999
+++ Completion/Base/_arguments	Mon Oct 18 11:11:27 1999
@@ -190,7 +190,6 @@
 
           [[ -n "$matched" ]] && compadd -n -Q -S '' -s "$SUFFIX" - "$PREFIX"
           _message "$descr"
-          break
 
         elif [[ "$action" = \(\(*\)\) ]]; then
 

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


             reply	other threads:[~1999-10-18  9:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-10-18  9:16 Sven Wischnowsky [this message]
1999-10-20 16:15 ` Tanaka Akira
  -- strict thread matches above, loose matches on Subject: below --
1999-10-21 12:42 Sven Wischnowsky
1999-10-21 10:31 Sven Wischnowsky
1999-10-21 11:28 ` Tanaka Akira
1999-10-21  8:32 Sven Wischnowsky
1999-10-21  9:05 ` Tanaka Akira
1999-10-16  4:47 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=199910180916.LAA25903@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).