4
$\begingroup$

If I say use the following command:

Information["EntityFramework`*"]

It prints all the matching function from the required context but there is a option to collapse it. Similarly querying multiple contexts.

Information["*`*Entity*"]

produces result that is grouped by the contexts they are from with a option to collapse each separately.

Is there an option I can give to Information that will allow all the grouped contexts to appear collapse on initial execution so they don't clutter the screen?

$\endgroup$

2 Answers 2

2
$\begingroup$

Here's a trick to force that (sadly there is no and can be no option by how this function is written):

Information; (* activate the autoloader *)
DownValues[System`InformationDump`labeledgridwithopener] =
  DownValues[System`InformationDump`labeledgridwithopener] /.

   DynamicModuleBox[{Typeset`open$$ = True}, a___] :>
    DynamicModuleBox[{Typeset`open$$ = TrueQ@Typeset`$InformationGridOpen}, 
     a];

Now if Typeset`$InformationGridOpen is True it displays automatically opened and otherwise it's closed:

enter image description here

enter image description here

$\endgroup$
7
  • 1
    $\begingroup$ I was just about to post the same thing, more or less. :) $\endgroup$ Commented Jul 31, 2019 at 1:03
  • $\begingroup$ @MichaelE2 if you want the 30 rep this will probably bring I can delete and you can post :) $\endgroup$ Commented Jul 31, 2019 at 1:04
  • $\begingroup$ No problem. We almost tied, that's all. It's happened before. Sometimes even, I'm first. :) TrueQ@Typeset`$InformationGridOpen is a nice touch, btw. $\endgroup$ Commented Jul 31, 2019 at 1:05
  • 1
    $\begingroup$ Note: You need to load/initialize the Information[] support code before you can change the DownValues of labeledgridwithopener. Evaluating Information is sufficient it seems. $\endgroup$ Commented Jul 31, 2019 at 1:26
  • $\begingroup$ @MichaelE2 I'm sure there's some autoload on it. Didn't know that. $\endgroup$ Commented Jul 31, 2019 at 1:27
4
$\begingroup$

Until someone discovers the magic undocumented option that controls the initial states of Openers, you can process the boxes to modify the initializations of DynamicModules in information grid:

collapse = RawBoxes @ Replace[ToBoxes[#], 
   HoldPattern[Typeset`open$$ = _] :>  (Typeset`open$$ = False), All] &;
   
Information["*`*Entity"] // collapse

enter image description here

enter image description here

$\endgroup$
2
  • 1
    $\begingroup$ There is can be no magic undocumented option as System`InformationDump`labeledgridwithopener has its $$opener = True default state hardcoded in. If you redefine that function, though, it'll work clean. $\endgroup$ Commented Jul 31, 2019 at 0:54
  • 1
    $\begingroup$ MakeBoxes[#, StandardForm] &@Information["Plot*"]; (* initialize *) DownValues[System`InformationDump`labeledgridwithopener] = DownValues[System`InformationDump`labeledgridwithopener] /. HoldPattern[{Typeset`open$$ = _}] :> {Typeset`open$$ = False} makes it "permanent" (i.e. for the session). $\endgroup$ Commented Jul 31, 2019 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.