zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: Global aliases, eval, and completion (Re: Expanding interactively aliases)
Date: Mon, 26 Feb 2001 16:51:34 +0000	[thread overview]
Message-ID: <1010226165134.ZM5059@candle.brasslantern.com> (raw)
In-Reply-To: <1010226072557.ZM4551@candle.brasslantern.com>

On Feb 26,  7:25am, Bart Schaefer wrote:
}
} } > My real point is that the existing _expand appears to be expanding
} } > global aliases already. [...] A quick check reveals that this is
} } > with the substitute style and is due to the fact that the aliases
} } > are expanded within eval.
} } 
} } Now that you say that... I seem to have a very faint memory of a
} } discussion about this (not in _expand, I think, we had the problem
} } somewhere else). I think we found a solution which I can't think of
} } now and I don't know where to search for it either.

I was just diffing some backup copies I'd made of things like minor changes
to _arguments against the current sources, and I found the solution I think
you're thinking about.

} [...] _arguments does things like
} 
} 	eval ws\=\( "${action[2,-2]}" \)
} and
} 	eval "action=( $action )"
} 
} There are a number of other completion functions that use eval for similar
} purposes.

We can replace all `eval's of that particular form with

	set -A ws ${=~action[2,-2]}
or
	set -A action ${=~action}

etc., which also gives us liberty to remove the wordsplitting or globbing
when appropriate (I think wordsplitting always is, but globbing might better
be left off in a few cases).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


  reply	other threads:[~2001-02-26 16:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-21  8:19 Expanding interactively aliases Sven Wischnowsky
2001-02-21  8:42 ` Andrej Borsenkow
2001-02-21 10:50   ` Geoff Wing
2001-02-26  7:25 ` Global aliases, eval, and completion (Re: Expanding interactively aliases) Bart Schaefer
2001-02-26 16:51   ` Bart Schaefer [this message]
2001-02-26 23:03   ` Oliver Kiddle
2001-02-26  9:42 Sven Wischnowsky
2001-02-27 10:11 Sven Wischnowsky
2001-02-27 16:51 ` Bart Schaefer
2001-02-27 17:42   ` Bart Schaefer
2001-02-27 17:49   ` Andrej Borsenkow
2001-02-27 18:25     ` Bart Schaefer
2001-02-28  9:10 Sven Wischnowsky
2001-03-05 13:28 Sven Wischnowsky

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=1010226165134.ZM5059@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --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).