From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18123 invoked from network); 12 Aug 2002 15:21:46 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Aug 2002 15:21:46 -0000 Received: (qmail 7298 invoked by alias); 12 Aug 2002 15:21:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17537 Received: (qmail 7285 invoked from network); 12 Aug 2002 15:21:39 -0000 From: "Bart Schaefer" Message-Id: <1020812152104.ZM29487@candle.brasslantern.com> Date: Mon, 12 Aug 2002 15:21:04 +0000 In-Reply-To: <87n0rsxsqr.fsf@julie.debian-fr.org> Comments: In reply to Bruno Bonfils "Re: read timeout argument || completion of a function" (Aug 12, 12:43pm) References: <87znvt15hr.fsf@julie.debian-fr.org> <1020812054520.ZM28574@candle.brasslantern.com> <87n0rsxsqr.fsf@julie.debian-fr.org> X-Mailer: Z-Mail (5.0.0 30July97) To: Bruno Bonfils Subject: Re: read timeout argument || completion of a function Cc: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 12, 12:43pm, Bruno Bonfils wrote: } } > The default completion is what is called when } > there isn't any other completion defined, and it is implemented by a } > function that is named _default, which happens to call another } > function named _files. } } hmm ok, i understand now. So, in this case, it's possible to change } the function which called by _default for only one command using } zstyle ? No, you cannot, using zstyle, change the functions which are called; with zstyle you can change some of the function behaviors and in some cases change the set of possible matches from which they select the list of matching completions. To change the functions called, use compdef. } sure, in fact i have : } } % vi .zshrc } ... } source .zsh/rc/functions.rc } } fpath=($HOME/.zsh/functions $fpath) } ... And where in that sequence is your call to "compinit"? } % vi .zsh/rc/functions.rc } } ... } upgrade () { } if [ -z $1 ] ; then } sudo apt-get update } sudo apt-get -u upgrade } else } echo "sudo apt-get update" | ssh $1 } # ask before the upgrade } local dummy } echo "sudo apt-get --no-act upgrade" | ssh $1 } echo -n "Process the upgrade ?" } read -q dummy } if [[ $dummy == "y" ]] ; then } echo "sudo apt-get -u upgrade --yes" } fi } fi } } It looks like that always passes its argument to ssh. So you can just: compdef upgrade=ssh } upgrade } file.. } } _upgrade } host.. I'm at a loss to explain this. Have you tried using the _complete_help and _complete_debug key bindings? Man page excerpt: _complete_debug (^X?) This widget performs ordinary completion, but captures in a temporary file a trace of the shell commands executed by the completion system. Each completion attempt gets its own file. A command to view each of these files is pushed onto the editor buffer stack. _complete_help (^Xh) This widget displays information about the context names, the tags, and the completion functions used when completing at the current cursor position. If given a numeric argument other than 1 (as in `ESC-2 ^Xh'), then the styles used and the contexts for which they are used will be shown, too. Note that the information about styles may be incomplete; it depends on the information available from the completion functions called, which in turn is determined by the user's own styles and other settings. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net