Set the ClosingSaveDialog to False

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...

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

• Probably safer to do it on $FrontEndSession instead of $FrontEnd. Doesn't make the changes permanent Mar 7, 2019 at 20:16