I have Echo's buried in code all over my notebook, I'd like a flag to turn them all on or off globally.
- Sure
Unprotect[Echo];Echo=Identitywould disable them, but then you can't re-enable them - A solution that works for all the various types of Echos (EchoName, EchoEvaluation, ...) would be nice
QuietEchodoesn't work because I'd have to write it add it around every blob of code
Echo=., no? $\endgroup$Echo = #&instead, sinceEchocan take multiple arguments. $\endgroup$Echo[withmyEchoin your code, then at the top assign an appropriate value tomyEcho, i.e.myEcho = Echovs.myEcho = Identitydepending on what you want. The global search should be relatively safe and painless, sinceEchois not a common keyword in other function names. This would also work with all othertypes of Echo, turning them intomyEcho...versions if you wanted. $\endgroup$Echobeing one of the autoloaded symbols. Check, e.g. on a fresh kernel, this:OwnValues[Echo], you will see something like{HoldPattern[Echo] :> System`Dump`AutoLoad[Hold[Echo], Hold[Echo, EchoFunction], "Language`Echo`"] /; System`Dump`TestLoad}. So, initially,EchohasOwnValues. When you executeEcho[0](actually, justEchois enough), you cause that definition to run. As a result,OwnValues[Echo]get cleared, insteadDownValues[Echo]get populated. When you doEcho = Identitywithout auto-load, you hopelessly overwrite autoload code. $\endgroup$