zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@u.genie.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: Expanding interactively aliases
Date: Tue, 20 Feb 2001 18:54:16 +0000	[thread overview]
Message-ID: <20010220185416.A448@rambo.logica.co.uk> (raw)

Peter Stephenson wrote (on zsh-users):

> Quite possibly Sven has already added an option to the _expand 
> completer by now, otherwise I'll try and remember to look at that.

I had a quick look at _expand and, as I thought there is nothing to
explicitly expand aliases. I thought about adding it myself and had in
mind something along the lines of:

if zstyle -T ":completion:${curcontext}:" aliases; then
  (( CURRENT == 1 )) || exp=( "$exp[@]" "$aliases[$words[1]]" )
  exp=( "$exp[@]" "$galiases[$words[CURRENT]]" )
fi

This is fairly irrelevant and don't expect that to work because I've not
really tried it.

My real point is that the existing _expand appears to be expanding global
aliases already. I wouldn't have expected this because -U is used when
autoloading _expand. A quick check reveals that this is with the
substitute style and is due to the fact that the aliases are expanded
within eval.

I don't think it is ideal that autoload -U functions are subject to
aliases within eval and you could probably break a few bits of completion
with certain global aliases. Would it be easy to avoid this somehow? The
other solution would be a -U argument to eval which probably isn't a great
idea because eval currently takes no options.

And, BTW, alias has a -L option which you could have used in your
edit-alias function. Especially handy if you alias' name starts with '-'.

Oliver Kiddle


             reply	other threads:[~2001-02-20 18:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-20 18:54 Oliver Kiddle [this message]
     [not found] <Tc0a8890c51d8f3b42a@mailsweeper01.cambridgesiliconradio.com>
2001-02-20 19:02 ` Peter Stephenson
2001-02-21  8:19 Sven Wischnowsky
2001-02-21  8:42 ` Andrej Borsenkow
2001-02-21 10:50   ` Geoff Wing
2001-02-26 12:32 Sven Wischnowsky
2001-02-26 12:48 ` Peter Stephenson

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=20010220185416.A448@rambo.logica.co.uk \
    --to=opk@u.genie.co.uk \
    --cc=zsh-workers@sunsite.dk \
    /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).