From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14554 invoked by alias); 3 May 2011 15:05:01 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29140 Received: (qmail 15981 invoked from network); 3 May 2011 15:04:59 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110503080432.ZM15979@torch.brasslantern.com> Date: Tue, 03 May 2011 08:04:32 -0700 In-reply-to: <110503073902.ZM15889@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: zle messes up 'words' variable?" (May 3, 7:39am) References: <110428203139.ZM11856@torch.brasslantern.com> <110502184235.ZM14465@torch.brasslantern.com> <110503073902.ZM15889@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Felipe Contreras Subject: Re: zle messes up 'words' variable? Cc: zsh-workers@zsh.org MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On May 3, 7:39am, Bart Schaefer wrote: } } ... bashcompinit has responsibility } for loading the bash completion functions in a way that makes them } compatible. That's not the same as first loading bashcompinit and } then independently defining a new completion, though I lean toward } the conclusion that use of the bash-compatible "complete" command is } probably the correct place to fix this if it can be managed. Try this: Index: Completion/bashcompinit =================================================================== diff -c -r1.2 bashcompinit --- Completion/bashcompinit 22 Jun 2004 07:53:03 -0000 1.2 +++ Completion/bashcompinit 3 May 2011 15:01:09 -0000 @@ -120,7 +120,13 @@ ;; F) COMPREPLY=() - $OPTARG "${words[0]}" "${words[CURRENT-1]}" "${words[CURRENT-2]}" + (){ + set -- "${words[0]}" "${words[CURRENT-1]}" "${words[CURRENT-2]}" + # There may be more things we need to add to this typeset to + # protect bash functions from compsys special variable names + typeset -h words + $OPTARG "$@" + } results+=( "${COMPREPLY[@]}" ) ;; G)