I would like to stop Mathematica from showing the "Save Changes To" dialog whenever I try to close a notebook. I tried changing this from the Option Inspector by setting the losingSaveDialog -> False However, for some reason, as soon as I then close the notebook, the dialog still pops up and when I double check, the Open Inspector seem to have changed back to default!? Is there a way for this to work as expected? I suppose that building a code for this should work, but I do not know how to do that...
After a bit of digging, one can adopt a similar code to here and do:
CurrentValue[$FrontEnd, "ClosingAutoSave"] = True
For some reason, this does not update the Option Inspector, but otherwise works.
Note: As @b3m2a1 pointed out, the above makes the change permanent, i.e. even exiting and re-entering Mathematica, the value of ClosingAutoSave will still be set on True. Instead:
CurrentValue[$FrontEndSession, "ClosingAutoSave"] = True
will only change the setting for the current session.