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

autoload



Bart:

I did this, which should be verbatim as you posted:


    # Assume starting here with the default $fpath
    zsh_default_functions=~/.zsh-default-functions.zwc
    if ! zcompile -t $zsh_default_functions >&/dev/null
    then
      # File is missing or out of date.  Rebuild it.
      # Removes the file if any function cannot be compiled.
      zcompile $zsh_default_functions $^fpath/*(N.:A)
    fi
    if [[ -f $zsh_default_functions ]]
    then
      fpath=( $zsh_default_functions )
      autoload -w $zsh_default_functions
    fi

... and I get:

    /aWorking/Zsh/Boot/ztest:5: parse error near `)'
/aWorking/Zsh/Boot/ztest:zcompile:10: can't read file: /usr/share /zsh/functions/Completion /Base.zwc

('ztest' being sourced by .zshrc and where I do experiments.)

'Base.zwc' exists:

    $ ls -l Base.zwc
    -rw-r--r-- 1 root root 269472 Aug 31 16:26 Base.zwc

... and  "zcompile -t Base.zwc" doesn't report anything amiss.

The " parse error near `)' " msg. is puzzling since it always reports line 5 regardless of anything added above it ,eg: "echo "this echo is only here to add a line of code"".

For example if I modify your code like this:

    line5
        # Assume starting here with the default $fpath
zsh_default_functions=~/.zsh-default-functions.zwc
    line9

... I get this:

    /aWorking/Zsh/Boot/ztest:5: command not found: line5
    /aWorking/Zsh/Boot/ztest:9: command not found: line9
    /aWorking/Zsh/Boot/ztest:5: parse error near `)'
/aWorking/Zsh/Boot/ztest:zcompile:14: can't read file: /usr/share /zsh/functions/Completion/Base.zwc

... so the deliberate errors are as expected, yet she insists on finding an `)' error on line 5 as well, and that after having reached line 9, so I have no idea how to understand that.





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