=== modified file 'zsh-functions/zsv_write_scriptnames' --- zsh-functions/zsv_write_scriptnames 2014-06-25 09:36:47 +0000 +++ zsh-functions/zsv_write_scriptnames 2014-06-25 09:32:54 +0000 @@ -1,26 +1,25 @@ -local -A loaded -local ffile fname xtrace - -# disable tracing for noisy part -[[ -o xtrace ]]; xtrace=$? -(($xtrace)) && set +x - -# check which autoloadable functions are loaded -for ffile in $^fpath/*(.N); do - fname=$ffile:t - if (($+functions[$fname])) && \ - [[ $functions[$fname] != 'builtin autoload -XU' ]] && \ - ! (($+loaded[$fname])); then - loaded[$fname]=$ffile - fi -done - -# restore tracing -(($xtrace)) && set -x - -# print service's script file, explicit restart files and autoloaded -# functions into restart.files -print -rl - $svtab_src[$zsv_name] $restart_files $loaded >$zsv_dir/restart.files +typeset -f -T zsv_write_scriptnames + +write_scriptnames() { + local -A loaded + local ffile fname + + # check which autoloadable functions are loaded + for ffile in $^fpath/*(.N); do + fname=$ffile:t + if (($+functions[$fname])) && \ + [[ $functions[$fname] != 'builtin autoload -XU' ]] && \ + ! (($+loaded[$fname])); then + loaded[$fname]=$ffile + fi + done + + # print service's script file, explicit restart files and autoloaded + # functions into restart.files + print -rl - $svtab_src[$zsv_name] $restart_files $loaded >$zsv_dir/restart.files +} + +write_scriptnames # add the executable to restart.files if [[ $run[1] == /* ]]; then