Index: /trunk/aux/cocotron/win32/cocotron/cocotron-r661.patch
===================================================================
--- /trunk/aux/cocotron/win32/cocotron/cocotron-r661.patch	(revision 13125)
+++ /trunk/aux/cocotron/win32/cocotron/cocotron-r661.patch	(revision 13125)
@@ -0,0 +1,102 @@
+Index: AppKit/NSApplication.h
+===================================================================
+--- AppKit/NSApplication.h	(revision 661)
++++ AppKit/NSApplication.h	(working copy)
+@@ -9,8 +9,9 @@
+ #import <AppKit/NSResponder.h>
+ #import <AppKit/AppKitExport.h>
+ #import <AppKit/NSGraphics.h>
++#import <AppKit/NSWindow.h>
+ 
+-@class NSWindow,NSImage,NSMenu, NSPasteboard, NSDisplay;
++@class NSWindow,NSImage,NSMenu, NSPasteboard, NSDisplay, NSWindowController, NSDocument;
+ 
+ APPKIT_EXPORT NSString *NSModalPanelRunLoopMode;
+ APPKIT_EXPORT NSString *NSEventTrackingRunLoopMode;
+@@ -209,6 +210,7 @@
+ @end
+ 
+ @interface NSObject(NSApplication_serviceRequest)
++
+ -(BOOL)writeSelectionToPasteboard:(NSPasteboard *)pasteboard types:(NSArray *)types;
+ @end
+ 
+Index: AppKit/NSApplication.m
+===================================================================
+--- AppKit/NSApplication.m	(revision 661)
++++ AppKit/NSApplication.m	(working copy)
+@@ -29,6 +29,7 @@
+ #import <AppKit/CGWindow.h>
+ #import <AppKit/NSRaise.h>
+ #import <objc/message.h>
++#import <AppKit/NSWindow.h>
+ 
+ NSString *NSModalPanelRunLoopMode=@"NSModalPanelRunLoopMode";
+ NSString *NSEventTrackingRunLoopMode=@"NSEventTrackingRunLoopMode";
+@@ -413,6 +414,11 @@
+        needsUntitled = [_delegate applicationShouldOpenUntitledFile: self];
+    }
+ 
++   if(needsUntitled && _delegate && [_delegate respondsToSelector: @selector(applicationOpenUntitledFile:)]) {
++     needsUntitled = ![_delegate applicationOpenUntitledFile: self];
++   }
++                                                 
++
+    if(needsUntitled && controller && ![controller documentClassForType:[controller defaultType]]) {
+        needsUntitled = NO;
+    }
+@@ -466,12 +472,18 @@
+ }
+ 
+ -(void)run {
+-    
+-   NSAutoreleasePool *pool=[NSAutoreleasePool new];
+-   [self finishLaunching];
+-   [pool release];
++  static BOOL didlaunch = NO;
++  NSAutoreleasePool *pool;
++
++  _isRunning=YES;
++
++  if (!didlaunch) {
++    didlaunch = YES;
++    pool=[NSAutoreleasePool new];
++    [self finishLaunching];
++    [pool release];
++  }
+    
+-   _isRunning=YES;
+    
+    do {
+        pool = [NSAutoreleasePool new];
+Index: AppKit/NSDocument.m
+===================================================================
+--- AppKit/NSDocument.m	(revision 661)
++++ AppKit/NSDocument.m	(working copy)
+@@ -21,6 +21,8 @@
+ 
+ @implementation NSDocument
+ 
++static int untitled_document_number = 0;
++
+ +(NSArray *)readableTypes {
+    int             i;
+    NSArray        *knownDocTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDocumentTypes"];
+@@ -98,7 +100,7 @@
+       _fileURL=nil;
+       _fileType=nil;
+       _changeCount=0;
+-      _untitledNumber=0;
++      _untitledNumber=untitled_document_number++;
+       _hasUndoManager=YES;
+       _activeEditors=[NSMutableArray new];
+     }
+@@ -344,7 +346,7 @@
+ {
+   if(_fileURL==nil) 
+     {
+-      if(_untitledNumber > 1)
++      if(_untitledNumber != 0)
+         return [NSString stringWithFormat:@"Untitled %d", _untitledNumber];
+       else
+         return @"Untitled";
