Yes, I have thought of that.
The problem would be that there could be something like
$UnitSystem="Metric";
$UnitSystem="Imperial";
$UnitSystem="Metric";
and then an edit could be made and it would add
$UnitSystem="Metric";
$UnitSystem="Imperial";
$UnitSystem="Metric";
$UnitSystem="Imperial";
at the end which I wouldn't like.
I would need to process the settings to delete all cases of
$UnitSystem="Imperial";
so I have
$UnitSystem="Metric";
$UnitSystem="Metric";
and then I would need to delete the duplicates.
I would also need to add a check that if I have already written to the init.m file that it shouldn't add another one. For example if the current file contains this
$UnitSystem="Metric";
It wouldn't write one more time to have
$UnitSystem="Metric";
$UnitSystem="Metric";
I'm not sure how to do this though.
A program would have to be written for every setting including vector maps, autosave, SI units, and more. I think the solution would be a database.
I think the solution would be a database. There would be a business rule that you couldn't add a value if it already had a value. For example, you could have an entity setting with the property value for the setting. I could add an entity unitsystem with the value "metric". I could then implement a business rule and an integrity check constraint that you can't add a new entity for a setting if the key already exists and you can't update without permission to unprotect the data or something like that.