Index: panes.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/panes.lisp,v
retrieving revision 1.165
diff -u -r1.165 panes.lisp
--- panes.lisp	1 Dec 2005 12:06:40 -0000	1.165
+++ panes.lisp	23 Dec 2005 12:12:24 -0000
@@ -367,7 +367,7 @@
    (new-width :initform nil)
    (new-height :initform nil)
    (redisplay-needed :accessor pane-redisplay-needed
-		     :initarg :redisplay-neeeded :initform nil))
+		     :initarg :redisplay-needed :initform nil))
   (:documentation ""))
 
 (defmethod print-object ((pane pane) sink)
@@ -2373,7 +2373,7 @@
 		       :initarg :end-of-line-action
 		       :reader pane-end-of-line-action)
    (end-of-page-action :initform :scroll
-		       :initarg :end-of-line-action
+		       :initarg :end-of-page-action
 		       :reader pane-end-of-page-action)
    (double-buffering :initform nil
 		     :initarg :double-buffering
Index: Backends/PostScript/graphics.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/Backends/PostScript/graphics.lisp,v
retrieving revision 1.14
diff -u -r1.14 graphics.lisp
--- Backends/PostScript/graphics.lisp	31 Oct 2005 10:21:14 -0000	1.14
+++ Backends/PostScript/graphics.lisp	23 Dec 2005 12:12:27 -0000
@@ -68,7 +68,7 @@
 
 (defvar *extra-entries* 0)
 
-(defun write-postcript-dictionary (stream)
+(defun write-postscript-dictionary (stream)
   ;;; FIXME: DSC
   (format stream "~&%%BeginProlog~%")
   (format stream "/~A ~D dict def ~2:*~A begin~%"
Index: Backends/PostScript/sheet.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/Backends/PostScript/sheet.lisp,v
retrieving revision 1.10
diff -u -r1.10 sheet.lisp
--- Backends/PostScript/sheet.lisp	31 Oct 2005 10:21:14 -0000	1.10
+++ Backends/PostScript/sheet.lisp	23 Dec 2005 12:12:28 -0000
@@ -89,7 +89,7 @@
                 (format file-stream "%%Pages: (atend)~%")))
              (format file-stream "%%DocumentNeededResources: (atend)~%")
              (format file-stream "%%EndComments~%~%")
-             (write-postcript-dictionary file-stream)
+             (write-postscript-dictionary file-stream)
              (dolist (text-style (device-fonts (sheet-medium stream)))
                (write-font-to-postscript-stream (sheet-medium stream) text-style))
              (start-page stream)
@@ -107,20 +107,38 @@
         (finish-output file-stream))
       (destroy-port port))))
 
+
 (defun start-page (stream)
   (with-slots (file-stream current-page transformation) stream
-      (format file-stream "%%Page: ~D ~:*~D~%" (incf current-page))
-      (format file-stream "~A begin~%" *dictionary-name*)))
+    (format file-stream "%%Page: ~D ~:*~D~%" (incf current-page))
+    (format file-stream "~A begin~%" *dictionary-name*)))
+
+;; We define a new output-record class and a method on
+;; replay-output-record so that we can record calls to new-page.
+(defclass new-page-record (climi::basic-output-record)
+  ())
+
+(defmethod replay-output-record ((record new-page-record) stream
+				 &optional (region nil) (x-offset 0) (y-offset 0))
+  (declare (ignore region x-offset y-offset))
+  (new-page stream))
 
 (defun new-page (stream)
-  ;; FIXME: it is necessary to do smth with GS -- APD, 2002-02-11
-  (let ((medium (sheet-medium stream)))
-    (postscript-restore-graphics-state medium)
+  (when (stream-recording-p stream)
+    (stream-add-output-record stream (make-instance 'new-page-record)))
+  (when (stream-drawing-p stream)
+    ;; FIXME: it is necessary to do smth with GS -- APD, 2002-02-11
+    ;; FIXME^2:  what do you mean by that? -- TPD, 2005-12-23
+    (postscript-restore-graphics-state stream)
     (format (postscript-stream-file-stream stream) "end~%showpage~%")
     (start-page stream)
-    (postscript-save-graphics-state medium))
-  (clear-output-record (stream-output-history stream))
-  (setf (stream-cursor-position stream) (values 0 0)))
+    (postscript-save-graphics-state stream)
+    ;; If we call clear-output-record here, it wipes all remaining
+    ;; output, so all pages after the first are blank.  But I don't
+    ;; know quite what the original purpose of the call was, so,
+    ;; FIXME.  -- TPD 2005-12-23
+    ;; (clear-output-record (stream-output-history stream))
+    (setf (stream-cursor-position stream) (values 0 0))))
 
 
 ;;;; Output Protocol
