zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: completer that first expands global aliases  (Re: dsf)
Date: Wed, 09 Jan 2013 08:05:02 -0800	[thread overview]
Message-ID: <130109080502.ZM9501@torch.brasslantern.com> (raw)
In-Reply-To: <kcj699$ua0$1@ger.gmane.org>

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.


      reply	other threads:[~2013-01-09 16:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07 10:01 dsf Daniel
2013-01-08  9:41 ` completer that first expands global aliases (Re: dsf) Daniel
2013-01-08  9:58   ` Peter Stephenson
2013-01-08 13:06   ` Oliver Kiddle
2013-01-08 17:01     ` Daniel
2013-01-08 18:24       ` Bart Schaefer
2013-01-08 21:29         ` Daniel
2013-01-09  4:40           ` Bart Schaefer
2013-01-09  7:29             ` Daniel
2013-01-09 16:05               ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=130109080502.ZM9501@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).