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

Re: [PATCH v2 2/3] Fix the ':A' word modifier on paths with '..' components.



On Jun 27, 12:20am, Daniel Shahaf wrote:
}
} Mikael Magnusson wrote on Sat, Jun 25, 2016 at 18:47:58 +0200:
} > That sounds pretty pointless, you would still break existing scripts,
} 
} Yes, that's the whole point: I think the "new" semantics should be the
} default.

Obviously breaking scripts is not the point.  On the other hand, I don't
think many scripts would care.  :A is only used in four places in zsh's
Completion and Functions trees and none of those would suffer from the
change in semantics as far as I can tell.

I floated the idea of testing CHASE_DOTS so that there would be a way
to globally revert to the old behavior without having to update a lot
of scripts, but I hadn't considered the "backward" semantics, and I'm
not in favor of introducing a new option specifically for :A control.
However, with the current implementation there is NO way to obtain the
semantics Daniel wants.

Therefore I think the only reasonable solutions are:
(1) keep the current default and respect CHASE_DOTS to get the function
Daniel wants, or
(2) change the default and use :a:A to get the old behavior.

I lean slightly towards (1) but only because the doc has explicitly
called out the "resolve .. first" behavior for the past 7 years.



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