4
$\begingroup$

Recently Mathematica broke on me and I had to reinstall. I lost all of the changes I've made in my Options Inspector over the past year and am attempting to go back and change them again by memory. It's somewhat frustrating. In the future I would like to avoid this.

I'd like to keep a copy of all option settings which I've changed from their default values. It would be great to have a list. There are a lot of options, so I would like this list to contain only the ones that have been changed from default. Is there a way to gather this information programmatically?

This would allow me to create a function that when executed will change all of these options at once so I'm back up and running quickly. It would be nice to see these options in a list to remind me of what I changed. Any ideas on how this would be done?

Mike

$\endgroup$

1 Answer 1

3
$\begingroup$

According to the "Front End" section of Configuration Files for the Wolfram System, user preferences, including those set by Options Inspector, are located in $UserBaseDirectory in the file "/FrontEnd/init.m". This is a large file, and the options set by Options Inspector are at the end. The list appears to contain all options, whether changed by the user or not.

In the situation described by the OP, it might be possible to save a copy of this file in some safe place and, after Mathematica has been reinstalled, copy the old "/FrontEnd/init.m" file over the reinstalled file to recover the options set by the user. Understand, of course, that the reason that Mathematica broke might be that this very file had became corrupted.

A safer alternative would be to (electronically) compare the installation version of "/FrontEnd/init.m" with the version containing user modifications, and create a file listing the differences. Assuming that those differences are modest in number, they could be reentered by hand using Options Inspector after Mathematica has been reinstalled.

Caveat Emptor: I am no expert in the internals of Mathematica and am merely reporting what I learned in a very brief exploration of the topic. Some related information can be found by searching, say with Google, for "mathematica preferences file".

$\endgroup$
4
  • $\begingroup$ diff-ing the modified init.m with a pristine copy is a nice idea. $\endgroup$ Oct 14, 2015 at 17:16
  • $\begingroup$ Thank you. Great! This will work. $\endgroup$
    – B flat
    Oct 15, 2015 at 10:16
  • $\begingroup$ @J.M. Is there any simple way to get a clean copy? Is any backup stored anywhere? $\endgroup$
    – Kvothe
    Aug 14, 2020 at 20:11
  • $\begingroup$ @Kvothe, there isn't a backup unless you already made one before you started modifying your init.m. Perhaps what you can do is to save your already modified init.m somewhere else, uninstall and reinstall Mathematica, and then compare your backed up init.m with the one from the fresh installation. $\endgroup$ Aug 14, 2020 at 22:48

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.