From 68a6e19aa84b4da7d236f45a8107b737cef1b9f5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 18 Dec 2008 10:12:27 +0100 Subject: Reverted xsource changes, use source for includes --- etc/functions/xsource | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'etc/functions') diff --git a/etc/functions/xsource b/etc/functions/xsource index a892d36..2546965 100755 --- a/etc/functions/xsource +++ b/etc/functions/xsource @@ -1,16 +1,8 @@ ## vim:ft=zsh -# Since source in a function makes typeset'ed parameters local -# (which is not what we want), we use a combination of functions -# and aliases here: -# autoload xsource; xsource -# xsource file anotherfile && x_source -xsource() { - typeset file - (( ${#*} )) && unset xsource_files - for file in $*; { - [[ -r $file ]] && xsource_files=($xsource_files $file) - } - (( ${#xsource_files} )) || return 1 +# Note: This function's behaviour differs hrom source. +# With source, parameters declared local are available to the sourcing script. +# With xsource, parameters declared local will NOT be available. +# Keep that in mind when using this function +if [[ -r $1 ]] { + source $1 } - -alias x_source='source $xsource_files; unset xsource_files' -- cgit v1.2.3