It's not exactly what you're asking, but note that a file with any unsaved changes will have an asterisk appended to its filename in the title bar. If you want to check something's saved before closing it, look to the asterisk.
Notably making changes that sum to zero will asterisk a document, which can be confusing. Some routine actions like enabling dynamics can also asterisk a document.