Use the function defined in the "common" module. Move the check for not-nil filename from common.normalize_path to core.open_doc. In this latter the filename can be nil if a new unnamed document is created.
Use the function defined in the "common" module. Move the check for not-nil filename from common.normalize_path to core.open_doc. In this latter the filename can be nil if a new unnamed document is created.