Modify Windows printing so that it works on Windows 95, which doesn't
authorChris Hanson <org/chris-hanson/cph>
Thu, 8 Jan 1998 18:13:07 +0000 (18:13 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 8 Jan 1998 18:13:07 +0000 (18:13 +0000)
have the "print" program.

v7/src/edwin/print.scm

index 85903c9898ae6fae20b7ed323548bfad27d37c42..be429025c25a749dd3139d4270bb2b59c11b6d2e 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: print.scm,v 1.14 1997/12/26 23:46:41 cph Exp $
+;;;    $Id: print.scm,v 1.15 1998/01/08 18:13:07 cph Exp $
 ;;;
 ;;;    Copyright (c) 1991-97 Massachusetts Institute of Technology
 ;;;
@@ -113,9 +113,17 @@ Variable LPR-SWITCHES is a list of extra switches (strings) to pass to lpr."
   print-headers? title buffer
   (call-with-temporary-file-pathname
    (lambda (pathname)
-     (write-region region pathname #f #t)
+     (call-with-temporary-buffer " print"
+       (lambda (temp)
+        (insert-region (region-start region)
+                       (region-end region)
+                       (buffer-end temp))
+        (insert-char #\page (buffer-end temp))
+        (write-region (buffer-region temp) pathname #f #t)))
      (shell-command #f #f #f #f
-                   (string-append "print " (->namestring pathname))))))
+                   (string-append "copy "
+                                  (->namestring pathname)
+                                  " prn")))))
 
 (define (print-region-title-string region)
   (let ((buffer-title