summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-12-18 10:12:27 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2008-12-18 10:12:27 +0100
commit68a6e19aa84b4da7d236f45a8107b737cef1b9f5 (patch)
treeca721c79b538755dfd27a2b7d152cdc490c0c363 /etc
parentd8377aff37fc8038c866a60540bf1f515961af84 (diff)
Reverted xsource changes, use source for includes
Diffstat (limited to 'etc')
-rw-r--r--etc/function1
-rwxr-xr-xetc/functions/xsource20
-rw-r--r--etc/rc7
3 files changed, 9 insertions, 19 deletions
diff --git a/etc/function b/etc/function
index 4e13745..7f4cbb7 100644
--- a/etc/function
+++ b/etc/function
@@ -12,7 +12,6 @@ for funcfile in $ZDIR/functions/*(*N);
unset funcfile
colors
-xsource
# from https://git.tabularazor.org/~mikael/etc/tree/zsh/functions
for action in Start Stop Restart Reload; {
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'
diff --git a/etc/rc b/etc/rc
index 0231712..7d827de 100644
--- a/etc/rc
+++ b/etc/rc
@@ -26,9 +26,9 @@ source $ZDIR/alias/font
source $ZDIR/alias/default
source $ZDIR/alias/global
source $ZDIR/alias/short
-xsource $ZDIR/../provided/includes $ZDIR/local \
- $HOME/var/tmp/envstore-raw-$UID &&
-x_source
+source $ZDIR/../provided/includes
+xsource $ZDIR/local
+xsource $HOME/var/tmp/envstore-raw-$UID
source $ZDIR/completion
(( ZPROFILE )) && source $ZDIR/profile
@@ -43,7 +43,6 @@ chpwd
## cleanup
unalias 'linux:'
unalias 'openbsd:'
-unalias x_source
unfunction check_com
unfunction xexport
unfunction xsource