Run `run-mode-hooks' if it is available, otherwise `run-hooks'. This function saves the current buffer.