From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7505 invoked from network); 21 Feb 1999 20:04:12 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Feb 1999 20:04:12 -0000 Received: (qmail 6849 invoked by alias); 21 Feb 1999 19:51:14 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5456 Received: (qmail 6819 invoked from network); 21 Feb 1999 19:51:11 -0000 From: "Bart Schaefer" Message-Id: <990221115050.ZM11464@candle.brasslantern.com> Date: Sun, 21 Feb 1999 11:50:50 -0800 In-Reply-To: <19990221184045.24549.qmail@hotmail.com> Comments: In reply to "Matt Armstrong" "Re: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion" (Feb 21, 10:40am) References: <19990221184045.24549.qmail@hotmail.com> X-Mailer: Z-Mail (4.0b.820 20aug96) To: "Matt Armstrong" , zsh-workers@sunsite.auc.dk Subject: Re: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 21, 10:40am, Matt Armstrong wrote: } Subject: Re: PATCH: zsh-3.1.5-pws-9, TRAPZERR fix for new completion } } As far as restoring it, Do'h! I thought I tested that, but obviously } not. Is there an easy way to bind a function to a different name and } restore it? I've tried games with stuff like foo=$(functions TRAPZERR) } ... eval $foo, but that seems suboptimal. You can do zsh% eval newname "$(functions oldname)" zsh% oldname() { ... } zsh% eval oldname "$(functions newname)" zsh% unfunction newname as long as newname is unique and oldname isn't awaiting autoload. For traps, if you use the "trap" builtin instead of a TRAPxxx() function, the trap is automatically removed at the end of the local scope. That does not restore any outer-scope traps, though (global-scope TRAPxxx() is deleted by local-scope "trap ... xxx" commands). -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com