1

(Not a duplicate. I've checked How to "undo" SetOptions (restore defaults)? and others.)

Suppose I change some display options, e.g.:

SetOptions[EvaluationNotebook[], Background -> RGBColor[0.0, 0.0, 0.0], FontColor -> RGBColor[0, .85, .85], FontSize -> 20]

Is there a way to restore all the default display options at once, in a line or two of code, without rebooting the notebook or digging through the menus? Something like SetOptions[EvaluationNotebook[], Defaults] or a similar idea? I haven't been able to find what I need in other questions.

Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368

1 Answers1

0

Yes,

SetOptions[EvaluationNotebook[], Background -> Inherited, FontColor -> Inherited, 
 FontSize -> Inherited]

works in your case. Basically, when working with FrontEnd options Inherited is what you mean by "Default". But it doesn't always work through SetOptions, CurrentValue usually is a better choice.


Update. For "UndefinedSymbolStyle" discussed in the comments two solutions were found working:

SetOptions[EvaluationNotebook[], AutoStyleOptions -> {"UndefinedSymbolStyle" -> Inherited}]

CurrentValue[EvaluationNotebook[], {AutoStyleOptions, "UndefinedSymbolStyle"}] = Inherited
Alexey Popkov
  • 61,809
  • 7
  • 149
  • 368
  • That works great! Thank you! Follow-up question: I had used CurrentValue[EvaluationNotebook[], {AutoStyleOptions, "UndefinedSymbolStyle"}] = {FontColor -> RGBColor[0.5, 0.173, 0.765]} to edit the color of variable names to fit within the high-contrast color theme, but when I try to set FontColor -> Inherited then everything turns black (instead of the default variable color of blue). Do you know how to fix that, or should I post as a separate question? Thanks for your help! – ichthyophile Oct 29 '19 at 21:01
  • @icthyophile SetOptions[EvaluationNotebook[], AutoStyleOptions -> {"UndefinedSymbolStyle" -> Inherited}] works. Please report the problem to the tech support (support(at)wolfram.com), I strongly suspect that we have a bug in CurrentValue for CurrentValue[ EvaluationNotebook[], {AutoStyleOptions, "UndefinedSymbolStyle", FontColor}] = Inherited (it is the correct usage). – Alexey Popkov Oct 30 '19 at 01:14
  • 1
    Thanks so much for that! Your first solution worked great. I also tried CurrentValue[EvaluationNotebook[], {AutoStyleOptions, "UndefinedSymbolStyle"}] = Inherited and it worked. You solved what a half-hour of my searching couldn't figure out. Thanks for your help! – ichthyophile Oct 30 '19 at 15:06