Index: /trunk/ccl/examples/cocoa-editor.lisp
===================================================================
--- /trunk/ccl/examples/cocoa-editor.lisp	(revision 890)
+++ /trunk/ccl/examples/cocoa-editor.lisp	(revision 891)
@@ -399,5 +399,6 @@
 (defclass hemlock-text-storage (ns:ns-text-storage)
     ((string :foreign-type :id)
-     (edit-count :foreign-type :int))
+     (edit-count :foreign-type :int)
+     (append-edits :foreign-type :int))
   (:metaclass ns:+ns-object))
 
@@ -535,20 +536,35 @@
 
 (define-objc-method ((:void :replace-characters-in-range (:<NSR>ange r)
-			    :with-string string)
-		     hemlock-text-storage)
-    (let* ((cache (hemlock-buffer-string-cache (send self 'string)))
-           (buffer (if cache (buffer-cache-buffer cache)))
-           (hi::*buffer-gap-context* (hi::buffer-gap-context buffer))
-           (location (pref r :<NSR>ange.location))
-           (length (pref r :<NSR>ange.length))
-           (mark (hi::buffer-%mark buffer))
-           (point (hi::buffer-point buffer)))
+  			    :with-string string)
+  		     hemlock-text-storage)
+  (let* ((cache (hemlock-buffer-string-cache (send self 'string)))
+	 (buffer (if cache (buffer-cache-buffer cache)))
+	 (hi::*buffer-gap-context* (hi::buffer-gap-context buffer))
+	 (location (pref r :<NSR>ange.location))
+	 (length (pref r :<NSR>ange.length))
+	 (mark (hi::buffer-%mark buffer))
+	 (point (hi::buffer-point buffer))
+	 input-mark)
+
+    ;;
+    ;; special behavior for listener windows.
+    ;;
+    (if (and (> (slot-value self 'append-edits) 0)
+	     (progn
+	       (setf input-mark (hi::variable-value 'hemlock::buffer-input-mark :buffer buffer))
+	       (not (hi::same-line-p point input-mark))))
+	(progn
+	  ;;
+	  ;;  move the point to the end of the buffer
+	  ;;
+          (setf (hi::buffer-region-active buffer) nil)
+	  (move-hemlock-mark-to-absolute-position point cache (hemlock-buffer-length buffer)))
       (cond ((> length 0)
-             (move-hemlock-mark-to-absolute-position mark cache location)
-             (move-hemlock-mark-to-absolute-position point cache (+ location length))
-             (hemlock::%buffer-activate-region buffer))
-            (t
-             (move-hemlock-mark-to-absolute-position point cache location)))
-      (hi::insert-string point (lisp-string-from-nsstring string))))
+	     (move-hemlock-mark-to-absolute-position mark cache location)
+	     (move-hemlock-mark-to-absolute-position point cache (+ location length))
+	     (hemlock::%buffer-activate-region buffer))
+	    (t
+	     (move-hemlock-mark-to-absolute-position point cache location))))
+    (hi::insert-string point (lisp-string-from-nsstring string))))
 
 
Index: /trunk/ccl/examples/cocoa-listener.lisp
===================================================================
--- /trunk/ccl/examples/cocoa-listener.lisp	(revision 890)
+++ /trunk/ccl/examples/cocoa-listener.lisp	(revision 891)
@@ -189,4 +189,5 @@
 				    "Listener-~d" *cocoa-listener-count*)))
 	     (buffer (hemlock-document-buffer doc)))
+	(setf (slot-value (slot-value self 'textstorage) 'append-edits) 1)
 	(send doc :set-file-name  (%make-nsstring listener-name))
 	(setf (hi::buffer-pathname buffer) nil
Index: /trunk/ccl/examples/cocoa-typeout.lisp
===================================================================
--- /trunk/ccl/examples/cocoa-typeout.lisp	(revision 890)
+++ /trunk/ccl/examples/cocoa-typeout.lisp	(revision 891)
@@ -77,4 +77,8 @@
 					 :width 600
                                          :activate nil)))
+	   (rlet ((size :<NSS>ize :width 600.0f0 :height 10000.0f0))
+		 (send panel :set-max-size size)
+		 (setf (pref size :<NSS>ize.height) 1.0f0)
+		 (send panel :set-min-size size))
            (slet ((bounds (send (send panel 'content-view) 'bounds)))
 		 (let* ((view (make-instance 'typeout-view :with-frame bounds)))
