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

RE: FPATH being reset after .zshenv







   > Unfortunately it seems that zsh resets the fpath after executing this
   file
   > (it is empty while running the file). It does however, remember the
   > autoload commands, which obviously then become useless.
   >

   I cannot reproduce it. Are you sure it is not reset in any other startup
   file?

I've looked into it some more, and found the culprit. I had the following
line earlier on:

typeset -U FPATH

which obviously makes the parameter local as a side effect. I've changed it
to -Ug now which is working fine.

Having looked back at the info documentation, I suspect what confused me
into leaving the -g out is the bit that says 'This flag does not affect the
parameter after creation':

     The -g (global) flag is treated specially: it means that any
     resulting parameter will not be restricted to local scope.  Note
     that this does not necessarily mean that the parameter will be
     global, as the flag will apply to any existing parameter (even if
     unset) from an enclosing function.  This flag does not affect the
     parameter after creation, hence it has no effect when listing
     existing parameters, nor does the flag +g have any effect except
     in combination with -m (see below).
Anyhow, thanks for the help.

Martin.




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