From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19865 invoked from network); 23 May 2001 06:30:13 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 May 2001 06:30:13 -0000 Received: (qmail 21242 invoked by alias); 23 May 2001 06:29:44 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14448 Received: (qmail 21219 invoked from network); 23 May 2001 06:29:43 -0000 From: "Bart Schaefer" Message-Id: <1010523062822.ZM23346@candle.brasslantern.com> Date: Wed, 23 May 2001 06:28:22 +0000 In-Reply-To: <20010522200425.A9730@flora01.SLAC.Stanford.EDU> Comments: In reply to Paul Ackersviller "Re: vi editting troubles" (May 22, 8:04pm) References: <20010522200425.A9730@flora01.SLAC.Stanford.EDU> X-Mailer: Z-Mail (5.0.0 30July97) To: Paul Ackersviller Subject: Re: vi editting troubles Cc: zsh-workers@sunsite.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 22, 8:04pm, Paul Ackersviller wrote: } Subject: Re: vi editting troubles } } Peter Stephenson wrote: } > > Another strange thing I notice when I turn on shell tracing is that my } > > TRAPZERR function runs in the middle of _history_complete_word -- is } > > there something I should be doing to avoid this? } > } > Oh, yuk. We really need some way of getting the effect of `setopt } > localtraps; unfunction TRAPZERR' in all completion functions. } } Are you saying this is still a potential problem in a general sense? Yes. The completion functions use a non-zero return value to report various conditions (often as simple as that no completions were found). The ZERR trap triggers on every such "failure". In _main_complete, which is called e.g. when you press TAB, there is code to fix up three different potential problems: (1) The completion functions assume a particular collection of setopts, so a call is made to initialize them properly. (2) ZLE closes stdin when running a widget. This confuses some external commands, so _main_complete redirects from /dev/null. (3) Turn off ZERR trapping. However, there are several functions that are called as completion widgets without passing through _main_complete; _history_complete_word is one. We did a sweep through them and took care of item (1) everywhere, but items (2) and (3) were not always caught. It isn't always necessary to do anything about (2), but it appears it is always necessary to handle (3). The only question is whether to sweep the functions again, or figure out some centralized way to fix it for good. } If it helps to know, _history_complete_word no longer shows me any } errors That's only because you aren't actually invoking _history_complete_word any more. } and this behaviour goes away with Bart's suggestion of moving } `bindkey -v' after `compinit'. You could document this as a bug, but } how can you ensure people always use this ordering? We can't ensure it, which is why I directed a question to zsh-workers about the reason for the choice of keybindings. I'm a bit surprised that no one spoke up. -- 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