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

Re: [PATCH] Restrict named directories to scalar parameters set to a path



On Fri, Jun 12, 2026 at 2:44 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Fri, Jun 12, 2026 at 12:52 PM Philippe Altherr
> <philippe.altherr@xxxxxxxxx> wrote:
> >
> > The documentation of AUTO_NAME_DIRS states that any parameter set to an absolute path becomes a named directory but currently setting any value turns the parameter into a named directory.
>
> Could you please describe how to reproduce the "before" scenario that
> inspired this patch?

Looking at this in the context of workers/54765 (my reply to
workers/54759), the problem appears not to be that "setting any value
turns the parameter into a named directory" -- I cannot make that
happen -- but rather that assigning any value other than a path
REMOVES an existing named directory.

This seems unambiguously correct to me, in contrast to the nameref
case in 54759 which at least has the argument that initializing a
nameref is not altering a "real" parameter.

However, this does make me think that 54759 should (if the behavior is
changed at all) be a case of "is not a nameref" rather than "is a
scalar".  That is, creating an array dx after establishing a nameddir
~dx should in fact remove the nameddir.  The case where the array is a
local is already handled by workers/54328.

What have I missed?




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