From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2683 invoked by alias); 9 Jan 2013 16:05:19 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17549 Received: (qmail 8125 invoked from network); 9 Jan 2013 16:05:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130109080502.ZM9501@torch.brasslantern.com> Date: Wed, 09 Jan 2013 08:05:02 -0800 In-reply-to: Comments: In reply to Daniel "Re: completer that first expands global aliases (Re: dsf)" (Jan 9, 7:29am) References: <1357650387.9070.YahooMailNeo@web171903.mail.ir2.yahoo.com> <20130108170145.GA4762@kelebek.lublin.se> <130108102404.ZM4596@torch.brasslantern.com> <130108204025.ZM4816@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: completer that first expands global aliases (Re: dsf) MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 9, 7:29am, Daniel wrote: } } But what was your _expand_alias_hack returning non-0 and attempt with } compprefunc() supposed to do then? I though they would manage to have } the alias expanded and then continue with completion. But as I said, } they stop short of actually completing. But the expansion is done, and } does NOT leave any trailing space/word boundary... _expand_alias is a completion function, so it is changing the result of completion, not the input to completion. This means that the next step (_menu or _complete, for example) still see the original input "DL" and find no completions for it. All that my hacks accomplish is to tell the shell that the expansion step is not in itself a successful completion, so that it won't append the the auto-suffix and leaves you able to continue completing with the expansion in place. I thought beforehand that the the compprefuncs one might do a bit more, but it doesn't. To accomplish what you want, you need to expand the alias before the completion is invoked. You can't do this within a single "zle -C" widget without mucking around the values of words[CURRENT] and PREFIX, and it may not always work even then.