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

Re: Tilde expansion and completion again

    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> >     This is short: why aren't PWD and OLDPWD stored in $nameddirs
> > until a 'cd' command is issued?
> Peter told you the workaround, but he didn't answer "why".
> In the cases of PWD, OLDPWD, and nearly all other variables "known to the 
> shell" their values have already been assigned long before autonamedirs 
> can become set in your rc files.  Therefore they don't become nameddirs 
> until the _next_ time they are assigned (which for PWD and OLDPWD is upon 
> the next "cd"), or when nameddirs are forcibly rebuilt with "hash -d".

    Ok, now I have it clear :) Thanks a lot, Bart.
> > Why aren't the rest of parameters whose value starts with a slash stored 
> > directly in $nameddirs withouth the need to call 'hash -d'?
> Because it's not the job of the "setopt" command to track down and tickle 
> all possible side effects of the options that you've told it to change.
> And if you think about it, you wouldn't want it to even if it could.

    I don't want setopt to do the job, but zsh itself as soon as the
values are stored. The problem is the autonamedirs option, because
this cannot be done unless it is on.

    Well, the 'hash -d' method is more flexible.
    Thanks again Bart :)

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736
http://www.dervishd.net & http://www.pleyades.net/

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