MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Remove MakeExpression settings

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118590] Re: Remove MakeExpression settings
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Tue, 3 May 2011 08:22:57 -0400 (EDT)
  • References: <ipm2f1$58n$1@smc.vnet.net> <ipoipp$g2j$1@smc.vnet.net>

David Bailey wrote:

> On 02/05/2011 11:53, Peter Breitfeld wrote:
>> I made some settings using MakeExpression and MakeBoxes. Suppose I use
>>
>> beautyOut[a_]:=MakExpression[...]
>>
>> I can find these definitions in Definition[MakeBoxes] and
>> Definitions[MakeBoxes].
>>
>> Sometimes I want to switch off these definitions. The only way I found
>> is to use Quit.
>>
>> My question:
>> Is it possible, to remove the definitions made from the set of
>> definitons of MakeExpression and Makeboxes?
>>
>> Thank you
>> Peter
> One possibility is not to remove them but activate/deactivate them based 
> on a global variable
>
> mySwitch=True;
>
> MakeExpression[...,StandardForm]:=Module[.............]/;mySwitch;
>
> Set up this way, they can be activated/deactivated at will.
>
> David Bailey
> http://www.dbaileyconsultancy.co.uk
>

Thanks to David and John!

I now use the following approach. The Definitions are strored in
FormatValues[MakeBoxes] and FormatValues[MakeExpression]. I now maintain
a list "beautyList" which contains all Symbols I want beauty.

I have a Definition defBeauty[a_], which makes setting in MakeBoxes and
MakeExpression. To find these definitions in the FormatValues list, I
add a nonsense form to the form parameter of MakeBoxes/Expression. e.g.

MakeBoxes[bla, form:StandardForm|TraditionalForm|WEIRD]...

The function undefBeauty[a] now looks for the pattern WEIRD, deletes the
entry in FormatValues[...], removes a from beautyList and calls
defBeauty for all remaining entries in beautyList. This works quite good. 

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Adding computed values to a Contourplot function
  • Next by Date: Re: Undo/Redo
  • Previous by thread: Re: Remove MakeExpression settings
  • Next by thread: Huge file for a several-line plot