Index: /trunk/source/cocoa-ide/app-delegate.lisp
===================================================================
--- /trunk/source/cocoa-ide/app-delegate.lisp	(revision 15165)
+++ /trunk/source/cocoa-ide/app-delegate.lisp	(revision 15166)
@@ -211,6 +211,5 @@
     (when filename
       (#/ensureListener: self nil)
-      (let* ((doc (#/topListener hemlock-listener-document))
-	     (process (hemlock-document-process doc)))
+      (let ((process (top-listener-process)))
 	(process-interrupt process #'(lambda ()
 				       (load filename)
@@ -224,6 +223,5 @@
     (when filename
       (#/ensureListener: self nil)
-      (let* ((doc (#/topListener hemlock-listener-document))
-	     (process (hemlock-document-process doc)))
+      (let ((process (top-listener-process)))
 	(process-interrupt process #'(lambda ()
 				       (compile-file filename)
Index: /trunk/source/cocoa-ide/cocoa-listener.lisp
===================================================================
--- /trunk/source/cocoa-ide/cocoa-listener.lisp	(revision 15165)
+++ /trunk/source/cocoa-ide/cocoa-listener.lisp	(revision 15166)
@@ -398,7 +398,12 @@
     (unless (%null-ptr-p doc) doc)))
 
+(defun top-listener-process ()
+  (let* ((doc (#/topListener hemlock-listener-document)))
+    (unless (%null-ptr-p doc)
+      (hemlock-document-process doc))))
+
 
 (defun symbol-value-in-top-listener-process (symbol)
-  (let* ((process (hemlock-document-process (#/topListener hemlock-listener-document))))
+  (let* ((process (top-listener-process)))
      (if process
        (ignore-errors (symbol-value-in-process symbol process))
@@ -406,5 +411,5 @@
   
 (defun hemlock-ext:top-listener-output-stream ()
-  (let* ((process (hemlock-document-process (#/topListener hemlock-listener-document))))
+  (let* ((process (top-listener-process)))
     (when process
       (setq process (require-type process 'cocoa-listener-process))
@@ -412,5 +417,5 @@
 
 (defun hemlock-ext:top-listener-input-stream ()
-  (let* ((process (hemlock-document-process (#/topListener hemlock-listener-document))))
+  (let* ((process (top-listener-process)))
     (when process
       (setq process (require-type process 'cocoa-listener-process))
@@ -549,6 +554,6 @@
                       (< range-end prot-end)))))
       t)))
-    
-    
+
+
 ;;; Action methods
 (objc:defmethod (#/interrupt: :void) ((self hemlock-listener-document) sender)
@@ -700,5 +705,5 @@
    +null-ptr+
    #$YES)
-  (hemlock-document-process (#/topListener hemlock-listener-document)))
+  (top-listener-process))
 
 (defmethod ui-object-eval-selection ((app ns:ns-application)
