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

Re: How sensible is ... ?



Typing away merrily, Peter Stephenson produced the immortal words:
> > Is this a sufficient test?  It /seems/ to work as I want ...
> 
> In this particular case, you don't need it, since return will function
> like exit in a script.

*doh*

>   foo=global
>   local foo >/dev/null
>   if [[ $foo = global ]]; then 
>     print At top level
>   else
>     print Inside a function
>   fi

I found that using 'alias' inside there failed to work (in an autoloaded
function anyway) and had to convert to a function.  And useing 'typeset
-f leavecmd' then defining it after a possible 'setopt localfunctions',
it remained in scope. I'm at work and decided against spending more time
on that so just used TRAPEXIT to unfunction it -- maybe I'm just doing
something wrong ...

All this just for a really nice version of xtitle ...
-- 
--> Phil Pennock ; GAT d- s+:+ a23 C++(++++) UL++++/I+++/S+++/H+ P++@ L+++
E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++ DI+ D+
G+ e+ h* r y?



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