Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: alias vl="vi !$"



Bart Schaefer wrote:
> Inside a function, however, $_ has already been changed to be the last
> word of the _currently executing_ command, the same as as $argv[-1].
> Which is not really all that useful, though maybe more useful than if
> it had been changed to the path name of zsh or some such.
> 
> I'm usually a stickler for backwards compatibility, but does anyone
> think anything would break if the changing of $_ were delayed until
> after shell functions have been called, so that it would remain the
> last word of the _previous_ command?

It's not likely anyone's using the present form in a function; after all
there are better ways of getting the current arguments inside a
function, and if the command entered isn't simply the function (there's
a more complicated expression), it's hard to see why you would want the
last argument.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



Messages sorted by: Reverse Date, Date, Thread, Author