Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Bug in "zed" with autoloaded functions



On Sun, 8 Aug 2004, Bart Schaefer wrote:

> Index: Functions/Misc/zed
> ===================================================================
>    if [[ $var = *\#\ undefined* ]] then
>        autoload +X $1
> +      var="$(functions $1)"

Actually I don't like this.  It used to be the case that, if one aborted
zed -f of an autoloaded function, the function remained undefined.  The
new behavior loads the function unconditionally.

So I propose this instead:

Index: Functions/Misc/zed
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/zed,v
retrieving revision 1.8
diff -u -r1.8 zed
--- Functions/Misc/zed	23 Jun 2004 16:14:27 -0000	1.8
+++ Functions/Misc/zed	8 Aug 2004 16:49:06 -0000
@@ -74,7 +74,7 @@
   var="$(functions $1)"
   # If function is undefined but autoloadable, load it
   if [[ $var = *\#\ undefined* ]] then
-      autoload +X $1
+      var="$(autoload +X $1; functions $1)"
   elif [[ -z $var ]] then
     var="$1() {
 }"



Messages sorted by: Reverse Date, Date, Thread, Author