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

Re: _dispatch (was Re: PATCH: [for consideration] TMPSUFFIX)



Bart Schaefer wrote on Wed, Sep 28, 2016 at 11:49:17 -0700:
> } +  {
> } +    eval "$comp" && ret=0
> } +  } always {
> } +    if (( TRY_BLOCK_ERROR )); then
> } +      ... throw the exception ... 
> } +    fi
> } +  }
> 
> Sadly, that won't do it either -- TRY_BLOCK_ERROR is not set:
> 
> The eval captures everything and turns it into nonzero exit status.
> 
⋮
>     compdef 'compadd *' f
> 
> There might be another way to permit that without eval'ing, but it
> would be convoluted.

It might be easier to just give a flag to eval that means "propagate
errflag of the evaluated expression to the calling scope"?  So the eval
itself would be aborted/unrolled, too.



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