make sure dirs is not an alias or function
authorMichael Prokop <mika@grml.org>
Sun, 17 Dec 2006 12:52:57 +0000 (13:52 +0100)
committerMichael Prokop <mika@grml.org>
Sun, 17 Dec 2006 12:52:57 +0000 (13:52 +0100)
debian/changelog
etc/skel/.zshrc
etc/zsh/zshrc

index 6546b5a..fa471bc 100644 (file)
@@ -1,3 +1,10 @@
+grml-etc-core (0.2.13) unstable; urgency=low
+
+  * /etc/zsh/zshrc + /etc/skel/.zshrc: make sure 'dirs' is not
+    an alias or function
+
+ -- Michael Prokop <mika@grml.org>  Sun, 17 Dec 2006 13:52:22 +0100
+
 grml-etc-core (0.2.12) unstable; urgency=low
 
   * /etc/zsh/zshrc: add support for global dirstack handling
index 0d4a52f..bfae710 100644 (file)
@@ -3,7 +3,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Don Nov 30 17:03:28 CET 2006 [mika]
+# Latest change: Son Dez 17 13:51:23 CET 2006 [mika]
 ################################################################################
 
 # source ~/.zshrc.global {{{
 # jump between directories
 # Copyright 2005 Nikolai Weibull <nikolai@bitwi.se>
 # notice: option AUTO_PUSHD has to be set
-  d(){
+  alias d &>/dev/null || functions d &>/dev/null || d(){
     emulate -L zsh
     autoload -U colors
     local color=$fg_bold[blue]
index addc8e6..baa5890 100644 (file)
@@ -3,7 +3,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Don Nov 30 16:15:06 CET 2006 [mika]
+# Latest change: Son Dez 17 13:52:04 CET 2006 [mika]
 ################################################################################
 # This file is sourced only for interactive shells. It
 # should contain commands to set up aliases, functions,
@@ -239,8 +239,8 @@ fi
   autoload run-help # use via 'esc-h'
 
 # completion system
-  if autoload -U compinit && [ -f "/usr/share/zsh/$ZSH_VERSION/functions/Completion/compinit" ] && compinit 2>/dev/null ; then
-    compinit
+  if autoload -U compinit && compinit 2>/dev/null ; then
+     compinit 2>/dev/null || print 'Notice: no compinit available :('
    else
      print 'Notice: no compinit available :('
      function zstyle { }
@@ -250,7 +250,7 @@ fi
   is4 && autoload -U zed                  # use ZLE editor to edit a file or function
 
   is4 && for mod in complist deltochar mathfunc ; do
-             zmodload -i zsh/${mod}
+             zmodload -i zsh/${mod} 2>/dev/null || print "Notice: no ${mod} available :("
          done
 
 # autoload zsh modules when they are referenced
@@ -379,7 +379,11 @@ fi
      # "cd -" won't work after login by just setting $OLDPWD, so
      cd $dirstack[0] && cd $OLDPWD
   fi
-  chpwd() { dirs -pl >! ~/.zdirs }
+  # notice: we have to make sure 'dirs' is not a function/alias, otherwise
+  # zsh might hang of course
+  chpwd() {
+    alias dirs &>/dev/null || functions dirs &>/dev/null || dirs -pl >! ~/.zdirs
+  }
 # }}}
 
 # {{{ display battery status on right side of prompt via running 'BATTERY=1 zsh'