zshrc: remove reload()
authorFrank Terbeck <ft@bewatermyfriend.org>
Tue, 25 Aug 2009 20:05:59 +0000 (22:05 +0200)
committerFrank Terbeck <ft@bewatermyfriend.org>
Tue, 25 Aug 2009 20:07:25 +0000 (22:07 +0200)
'exec zsh' should be used for reloading the configuration, freload() for
reloading function definitions.

debian/changelog
etc/zsh/zshrc

index 113a4e2..050afad 100644 (file)
@@ -3,6 +3,8 @@ grml-etc-core (0.3.74) unstable; urgency=low
   [ Frank Terbeck ]
   * vimrc: merged /etc/vim/vimrc and /etc/skel/.vimrc into one file
   * zshrc: mark specialized run-help functions for autoloading
+  * zshrc: remove reload(). 'exec zsh' is a much more robust way of
+    reloading the configuration.
 
   [ Michael Prokop ]
   * /etc/grml/script-functions: replace 'type -p' with 'which'.
@@ -12,7 +14,7 @@ grml-etc-core (0.3.74) unstable; urgency=low
   * zshrc: Removing shtgz(). shtar() does the same, just portably.
   * zshrc: Remove broken ytdl() function.
 
- -- Frank Terbeck <ft@grml.org>  Fri, 21 Aug 2009 18:35:07 +0200
+ -- Frank Terbeck <ft@grml.org>  Tue, 25 Aug 2009 22:06:05 +0200
 
 grml-etc-core (0.3.73) unstable; urgency=low
 
index 36f54ea..ffaae2f 100644 (file)
@@ -2619,23 +2619,7 @@ setenv()  { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" }  # csh compatibility
 
 #f1# Reload an autoloadable function
 freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done }
-
-# TODO: Who really uses reload()? The proper way to reload a zsh setup is to
-# actually restart the shell via 'exec zsh'. And reload with arguments is the
-# same as freload() above. -ft
-#f1# Reload zsh setup
-reload() {
-    if [[ "$#*" -eq 0 ]] ; then
-        [[ -r ~/.zshrc ]] && . ~/.zshrc
-    else
-        local fn
-        for fn in "$@"; do
-            unfunction $fn
-            autoload -U $fn
-        done
-    fi
-}
-compdef _functions reload freload
+compdef _functions freload
 
 #f1# List symlinks in detail (more detailed version of 'readlink -f' and 'whence -s')
 sll() {