I always use InputForm to check the result object,such as Dataset or Graphics or other objects.But if you are in the result of InputForm,you cannot use the Front-End function of balance the bracket. Note this gif
When I double click the input line, I will select all content just in this bracket.But when I'm in result of InputForm,I will select all line. Of course I can copy the output of InputForm as another new input,but which will make the notebook more mess.
Any method can make the output of InputForm support the function of balance the bracket?
Answer
Per my comment, I like using expr //InputForm //SequenceForm, but another similar possibility is to use a custom head with a custom MakeBoxes rule. For instance, let's call the custom form myInputForm. Then, we can define:
myInputForm /: MakeBoxes[myInputForm[expr_], StandardForm] := MakeBoxes[InputForm[expr]]
We also need to add myInputForm to $OutputForms:
Unprotect[$OutputForms];
AppendTo[$OutputForms, myInputForm];
Protect[$OutputForms];
Now, myInputForm gets stripped before being stored in Out. For instance:
Interpolation[{1,2,3,4}]
% //myInputForm
% //Head
InterpolatingFunction[{{1, 4}}, <>]
InterpolatingFunction[{{1, 4}}, { 5, 3, 0, {4}, {4}, 0, 0, 0, 0, Automatic, {}, {}, False}, {{1, 2, 3, 4}}, {{ 1}, {2}, {3}, {4}}, {Automatic}]
InterpolatingFunction

Comments
Post a Comment