[Openmcl-devel] Backups, revision control, and taking over the world

Ron Garret ron at flownet.com
Wed Aug 5 13:50:54 PDT 2009


I wanted to change the way Hemlock stores backups.  I like having  
backups, but I don't like having them stored with the emacs convention  
of appending a twiddle to the file name.  (I'd rather have them stored  
in a hidden directory where I can get to them if I need them but they  
aren't in my face every time I look at a directory.  I'm a bit of a  
neat freak.)

While wandering through the sources I found this intriguing bit of  
code in cocoa-editor.lisp:

(defun write-hemlock-backup-file (url)
   (unless (%null-ptr-p url)
     (when (#/isFileURL url)
       (let* ((path (#/path url)))
         (unless (%null-ptr-p path)
           (let* ((newpath (#/stringByAppendingString: path #@"~"))
                  (fm (#/defaultManager ns:ns-file-manager)))
             ;; There are all kinds of ways for this to lose.
             ;; In order for the copy to succeed, the destination  
can't exist.
             ;; (It might exist, but be a directory, or there could be
             ;; permission problems ...)
             (#/removeFileAtPath:handler: fm newpath +null-ptr+)
             (#/copyPath:toPath:handler: fm path newpath +null-ptr 
+)))))))

The reason it's intriguing is that quite a bit of effort seems to have  
been made to accept a URL as an argument, as opposed to accepting a  
file name, or simply converting the URL to a file name and calling  
COPY-FILE.  All this to me strongly hints at the possibility of using  
the IDE to edit source files that are stored in places other than the  
local file system.  Like, say, a RESTful web-based file store.  Like,  
say, a remote SVN repository.  (Well, maybe not SVN because SVN  
sucks ;-) but you can connect the dots.)

I would think that having an IDE whose editor was closely coupled with  
a revision control system would be a Cool Thing (tm).  It would  
significantly reduce the barriers to working on collaborative  
projects.  Might get people's attention.  Might be the sort of thing  
that those clever folks at Clozure might have already thought of.

So... is the fact that write-hemlock-backup-file takes a URL as its  
argument just a tease, or is something like this already on someone's  
agenda?

rg




More information about the Openmcl-devel mailing list