Index: /branches/gz-working/cocoa-ide/cocoa-editor.lisp
===================================================================
--- /branches/gz-working/cocoa-ide/cocoa-editor.lisp	(revision 8447)
+++ /branches/gz-working/cocoa-ide/cocoa-editor.lisp	(revision 8448)
@@ -1810,16 +1810,4 @@
       (hemlock-view pane))))
 
-(defun double-%-in (string)
-  ;; Replace any % characters in string with %%, to keep them from
-  ;; being treated as printf directives.
-  (let* ((%pos (position #\% string)))
-    (if %pos
-      (concatenate 'string (subseq string 0 %pos) "%%" (double-%-in (subseq string (1+ %pos))))
-      string)))
-
-(defun nsstring-for-lisp-condition (cond)
-  (%make-nsstring (double-%-in (or (ignore-errors (princ-to-string cond))
-                                   "#<error printing error message>"))))
-
 (objc:defmethod (#/runErrorSheet: :void) ((self hemlock-frame) message)
   #+debug (#_NSLog #@"runErrorSheet: signal = %@" :id signal)
Index: /branches/gz-working/cocoa-ide/cocoa-utils.lisp
===================================================================
--- /branches/gz-working/cocoa-ide/cocoa-utils.lisp	(revision 8447)
+++ /branches/gz-working/cocoa-ide/cocoa-utils.lisp	(revision 8448)
@@ -235,6 +235,15 @@
 ;; debugging
 
+(defun double-%-in (string)
+  ;; Replace any % characters in string with %%, to keep them from
+  ;; being treated as printf directives.
+  (let* ((%pos (position #\% string)))
+    (if %pos
+      (concatenate 'string (subseq string 0 %pos) "%%" (double-%-in (subseq string (1+ %pos))))
+      string)))
+
 (defun log-debug (format-string &rest args)
-  (#_NSLog (ccl::%make-nsstring (apply #'format nil format-string args))))
+  (let ((string (apply #'format nil format-string args)))
+    (#_NSLog (ccl::%make-nsstring (double-%-in string)))))
 
 (defun nslog-condition (c)
@@ -244,4 +253,8 @@
 	(#_NSLog #@"Error in event loop: %@" :address nsstr)))))
 
+(defun nsstring-for-lisp-condition (cond)
+  (%make-nsstring (double-%-in (or (ignore-errors (princ-to-string cond))
+                                   "#<error printing error message>"))))
+
 
 
