Commits

Anonymous committed f6bc169

ropemacs: saving nonexistent files

  • Participants
  • Parent commits 99a03da

Comments (0)

Files changed (1)

File rope/contrib/ropemacs.py

     def before_save_actions(self):
         if self.project is not None:
             resource = self._get_resource()
-            if resource is not None:
+            if resource is not None and resource.exists():
                 self.old_content = resource.read()
             else:
                 self.old_content = ''
         if project is not None:
             self.project.close()
             self.project = None
-            lisp.message('Project closed.')
+            lisp.message('Project closed')
 
     def do_rename(self, newname, module=False):
         self._check_project()
 
     def _get_resource(self):
         filename = lisp.buffer_file_name()
-        resource = libutils.path_to_resource(self.project, filename)
+        resource = libutils.path_to_resource(self.project, filename, 'file')
         return resource
 
     def _check_project(self):