zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: rpm completion is unnecessarily slow and broken
Date: Wed, 12 Jul 2000 11:00:33 +0200 (MET DST)	[thread overview]
Message-ID: <200007120900.LAA19611@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Adam Spiers's message of Tue, 11 Jul 2000 16:05:01 +0100


[moved to -workers, why was it on -users?]

Adam Spiers wrote:

> $ rpm -q --<TAB>
> 
> I think something must be going wrong with the matching, because not
> only does this run `rpm -qa' for some reason, but:
> 
> $ rpm -q --w<TAB>
> $ rpm -q --changelog
> zsh: do you wish to see all 61 possibilities (42 lines)?

A problem with the return value of _arguments when triggering a
->state action. The options were completed but the return value was
300 to indicate the ->state stuff.

This is ugly. For now I made _rpm check compstate[nmatches], but I
don't know if this is the right solution (and if it is, there may be
other functions where we should add it).

Maybe we should make _arguments return something different if options
were completed and calling functions should check that and decide
whether they want to try completion for the state at all and to get
their return value right. Suggestions, anyone?

Bye
 Sven

Index: Completion/Linux/_rpm
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Linux/_rpm,v
retrieving revision 1.14
diff -u -r1.14 _rpm
--- Completion/Linux/_rpm	2000/06/05 23:20:48	1.14
+++ Completion/Linux/_rpm	2000/07/12 09:00:10
@@ -41,7 +41,7 @@
 
 # Used by `_arguments', made local here.
 
-local curcontext="$curcontext" state lstate line
+local curcontext="$curcontext" state lstate line nm="$compstate[nmatches]"
 typeset -A opt_args
 
 state=''
@@ -246,6 +246,8 @@
     _files "$expl[@]" -/ && ret=0
     ;;
   esac
+
+  [[ ret -eq 0 || $nm -ne $compstate[nmatches] ]] && return 0
 done
 
 return ret

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


                 reply	other threads:[~2000-07-12  9:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200007120900.LAA19611@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).