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

Re: [RFC][PATCH] Add change-directory() widget function



On Wed, Apr 21, 2021 at 1:12 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> Bart Schaefer wrote on Tue, Apr 20, 2021 at 20:18:24 -0700:
> > On Tue, Apr 20, 2021 at 3:14 PM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > >
> > > Should any of the words be quoted to protect against global aliases?
> >
> > This is generally speaking a fruitless task.
>
> How so?  «PM_UNALIASED» turns «noaliases» on for the duration of parsing
> the function itself, not for the duration of parsing the code which the
> function dumps into $BUFFER when executed.

Ah, I misunderstood the scope of "any of the words".

I'm of two minds on this one.  Totally agree regarding e.g. "builtin
cd".  OTOH if for some reason I have a global alias for "+1" or "-0" I
might actually want it expanded here (I'm having a hard time
visualizing a use case for such an alias in the first place).

Marlon's latest effort to generalize this as "execute-command" pushes
responsibility for all of the foregoing onto the caller.




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