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

Re: cd && cdable_vars (bug?)



On Mar 29,  1:46pm, Francisco Borges wrote:
}
} Two questions/comments about cd and cdable_vars:
} 
} 1. I have cdable_vars set and I do have some data directories with
}    "integer" names: 2, 3, 5.
} 
}    When trying to complete on these dirs, I get not only the dirs I'm
}    supposed to get (those inside directory "5/.") but I also get all
}    subdirs of the fifth entry in my dirstack as "directory after
}    cdablevar".

That looks like a bug in _cd.  It should be getting handled by _tilde
and classified as "directory-stack".
 
}    Which AFAIK should not happen, since there is a directory "5", so
}    there should be no cdablevar lookup, right?

That's probably true, but it may depend on your other completion settings.
Completion usually errs on the side of giving you too many choices, when
there is ambiguity.
 
} 2. The first problem lead me to try completing on cdablevars from the

Do you mean "completing" here, or do you mean executing "cd"?

}    dirstack. This is *not* something I would like to do, but I tried
}    motivated by the noise when completing.
} 
}    And it failed! But it shouldn't, right?

I think the doc for CDABLE_VARS predates the ability to refer to dirstack
entries with tilde-notation ... "as if it were preceded by a `~'" really
means "look it up in the named directories table and use the value of the
parameter".  Since "3" is not really a parameter ...  Anyway, I believe
this is a case of the implementation outrunning the doc.



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