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

PATCH: Re: zsh-3.1.9-dev-6 crashes occassionally



Bart Schaefer wrote:

> ...
> 
> One other item of note:  For some strange reason, it's not possible to
> alter TRAPxxx functions with "zed -f".  They come up in the editor, and
> if you create one from scratch it sticks, but no changes that you make
> to an already-existing TRAPxxx function are remembered.  No matter how
> you exit zed, they always revert to their previous value.

It's pretty obvious if you look at zed. It calls $cleanup at the end,
which contains the output of `trap'. And hence it resets all trap
functions.

This should fix that. It doesn't fix the bug that one can't edit
TRAPINT and TRAPEXIT (which are used by zed), though. Hm.

Bye
 Sven

Index: Functions/Misc/zed
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Misc/zed,v
retrieving revision 1.3
diff -u -r1.3 zed
--- Functions/Misc/zed	2000/07/27 08:14:54	1.3
+++ Functions/Misc/zed	2000/11/01 09:30:00
@@ -55,7 +55,7 @@
     var="$1() {
 }"
   fi
-  vared var && eval function "$var"
+  vared var && eval "$cleanup ;" function "$var"
 else
   [[ -f $1 ]] && var="$(<$1)"
   while vared var

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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