Automatically saves prefs on `set` unless new `doNotSave` flag is set.

This is following the pattern @RaymondLim established in #6740.