If you have directories which need temporary changes to your environment, you can use smartcd to modify it when you cd to the directory, and optionally undo those changes when you leave.