From daaf5f50d7bf3664e7f482c5cf797db164db41ef Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Tue, 23 Nov 2010 23:16:16 +0100 Subject: [PATCH] zshrc: Do not set `localoptions' in `xsource()' "emulate -L zsh" sets zsh's option set to the default values of zsh's native mode. The `-L' causes the options to be set local to the surrounding function. That makes sense in most cases. With `xsource()' however, we explicitly want to *allow* changing options from the files sourced by that function. That's one of the main purposes of the function. I took the `emulate' call out entirely because it doesn't make sense without `-L' in untility functions. I also hardened the function's code a little when it's run with non-zsh-mode options (like sh_word_split). Reported-by: Dominic Hopf --- debian/changelog | 7 ++++++- etc/zsh/zshrc | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3509f4e..070e878 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,7 +3,12 @@ grml-etc-core (0.3.85) UNRELEASED; urgency=low [ Ulrich Dangel ] * zshrc: Removed `startx()' and `xinit()' functions - -- Frank Terbeck Sun, 21 Nov 2010 12:03:50 +0100 + [ Frank Terbeck ] + * zshrc: Do not set `localoptions' in `xsource()'. That makes it + impossible to set options in `.zshrc.pre' or `.zshrc.local'. Reported + by Dominic Hopf. Thanks! + + -- Frank Terbeck Tue, 23 Nov 2010 23:13:50 +0100 grml-etc-core (0.3.84) unstable; urgency=low diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 068e10c..c1cc68d 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -417,14 +417,13 @@ fi # Check if we can read given files and source those we can. xsource() { - emulate -L zsh if (( ${#argv} < 1 )) ; then printf 'usage: xsource FILE(s)...\n' >&2 return 1 fi while (( ${#argv} > 0 )) ; do - [[ -r $1 ]] && source $1 + [[ -r "$1" ]] && source "$1" shift done return 0 -- 2.1.4