From: Michael Prokop Date: Sun, 19 Nov 2006 13:46:02 +0000 (+0100) Subject: * /etc/zsh/zshrc: improve error handling; do *not* export $FPATH X-Git-Tag: 0.1-33~4 X-Git-Url: http://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=943b9eeb8b15b3ca93a9360c2321f7e3d16a3468 * /etc/zsh/zshrc: improve error handling; do *not* export $FPATH to avoid problems with different zsh versions. --- diff --git a/debian/changelog b/debian/changelog index bb5a9bc..a4b91a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +grml-etc-core (0.1-33) unstable; urgency=low + + * /etc/zsh/zshrc: improve error handling; do *not* export $FPATH + to avoid problems with different zsh versions. + + -- Michael Prokop Sun, 19 Nov 2006 14:45:25 +0100 + grml-etc-core (0.1-32) unstable; urgency=low * zsh-setup: applied patch from Frank Terbeck for improved diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 131a19b..821ed27 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3,7 +3,7 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Son Okt 29 17:49:13 CET 2006 [mika] +# Latest change: Son Nov 19 14:45:18 CET 2006 [mika] ################################################################################ # This file is sourced only for interactive shells. It # should contain commands to set up aliases, functions, @@ -14,7 +14,7 @@ # {{{ check for version/system # check for versions (compatibility reasons) - if autoload is-at-least && is-at-least ; then + if autoload is-at-least && is-at-least 2>/dev/null ; then is4() { is-at-least 4 } is42() { is-at-least 4.2 } else @@ -71,7 +71,7 @@ # cdpath=(.. ~) # Support our own site-functions - [ -d /etc/zsh/site-functions ] && export FPATH=/etc/zsh/site-functions:$FPATH + [ -d /etc/zsh/site-functions ] && FPATH=/etc/zsh/site-functions:$FPATH # automatically remove duplicates from these arrays typeset -U path cdpath fpath manpath @@ -130,8 +130,9 @@ fi # we don't want to quote/espace URLs on our own... # avoid 'url-quote-magic: function definition file not found' on some older boxes - if [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Zle/url-quote-magic" ] ; then - autoload -U url-quote-magic && zle -N self-insert url-quote-magic + if [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Zle/url-quote-magic" ] && \ + autoload -U url-quote-magic && url-quote-magic 2>/dev/null && zle -N self-insert url-quote-magic ; then + zle -N self-insert url-quote-magic else print 'Notice: no url-quote-magic available :(' fi @@ -140,7 +141,7 @@ fi autoload run-help # use via 'esc-h' # completion system - is42 && if autoload -U compinit && [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Completion/compinit" ] ; then + if autoload -U compinit && [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Completion/compinit" ] && compinit 2>/dev/null ; then compinit else print 'Notice: no compinit available :(' @@ -286,10 +287,10 @@ fi # }}} # {{{ set prompt - if [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Prompts/promptinit" ] ; then - autoload promptinit && promptinit # people should be able to use their favourite prompt + if [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Prompts/promptinit" ] && autoload promptinit && promptinit 2>/dev/null ; then + promptinit # people should be able to use their favourite prompt else - print 'Notice: no prompiinit available :(' + print 'Notice: no promptinit available :(' fi # precmd() => a function which is executed just before each prompt # precmd () { setopt promptsubst; [[ -o interactive ]] && jobs -l; @@ -339,7 +340,7 @@ fi } # set colors - if autoload colors && colors ; then + if autoload colors && colors 2>/dev/null ; then BLUE="%{${fg[blue]}%}" RED="%{${fg_bold[red]}%}" GREEN="%{${fg[green]}%}"