summaryrefslogtreecommitdiff
path: root/etc/functions
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-12-18 10:00:34 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-12-18 10:00:34 +0100
commitd8377aff37fc8038c866a60540bf1f515961af84 (patch)
tree1628200d8299f56500ac24f35f6b54aa69c56d16 /etc/functions
parente9db94a1e2a72ae51e476cbc372ca774f3c65125 (diff)
xsource: Removed alias definition from zshrc
Diffstat (limited to 'etc/functions')
-rwxr-xr-xetc/functions/xsource16
1 files changed, 10 insertions, 6 deletions
diff --git a/etc/functions/xsource b/etc/functions/xsource
index b5cd904..a892d36 100755
--- a/etc/functions/xsource
+++ b/etc/functions/xsource
@@ -2,11 +2,15 @@
# 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; alias x_source='source $xsource_files; unset xsource_files'
+# autoload xsource; xsource
# xsource file anotherfile && x_source
-typeset file
-(( ${#*} )) && unset xsource_files
-for file in $*; {
- [[ -r $file ]] && xsource_files=($xsource_files $file)
+xsource() {
+ typeset file
+ (( ${#*} )) && unset xsource_files
+ for file in $*; {
+ [[ -r $file ]] && xsource_files=($xsource_files $file)
+ }
+ (( ${#xsource_files} )) || return 1
}
-(( ${#xsource_files} )) || return 1
+
+alias x_source='source $xsource_files; unset xsource_files'