1
0
mirror of synced 2026-05-03 14:49:45 +00:00

Separate interface for imagefile creation from the send-to-printer interface

This commit is contained in:
rmkaplan
2025-12-04 22:41:06 -08:00
parent 8b06dd69f5
commit 5dc4ca219d
29 changed files with 1443 additions and 1410 deletions

View File

@@ -1,16 +1,15 @@
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
(FILECREATED "20-Jan-2023 22:44:05" {DSK}<home>frank>il>medley>gmedley>library>UNIXPRINT.;4 13651
(FILECREATED "13-Sep-2025 20:28:22" 
{DSK}<Users>kaplan>Local>medley3.5>working-medley>library>UNIXPRINT.;4 13582
:CHANGES-TO (VARS UNIXPRINTCOMS)
:EDIT-BY rmk
:PREVIOUS-DATE "18-Jan-2023 13:28:36" {DSK}<home>frank>il>medley>gmedley>library>UNIXPRINT.;3
)
:CHANGES-TO (FNS UnixPrint)
:PREVIOUS-DATE "13-Sep-2025 20:27:21"
{DSK}<Users>kaplan>Local>medley3.5>working-medley>library>UNIXPRINT.;3)
(* ; "
Copyright (c) 1990-1993, 1995, 1997, 1999, 2001, 2018, 2023 by Venue.
")
(PRETTYCOMPRINT UNIXPRINTCOMS)
@@ -48,7 +47,9 @@ Copyright (c) 1990-1993, 1995, 1997, 1999, 2001, 2018, 2023 by Venue.
(CDR x])
(UnixPrint
[LAMBDA (HOST FILE PRINTOPTIONS) (* ; "Edited 7-Dec-2001 14:55 by rmk:")
[LAMBDA (HOST FILE PRINTOPTIONS) (* ; "Edited 13-Sep-2025 20:28 by rmk")
(* ; "Edited 11-Sep-2025 20:48 by rmk")
(* ; "Edited 7-Dec-2001 14:55 by rmk:")
(* ; "Edited 20-May-92 14:13 by nilsson")
(* ;; "Given a print FILE, use the Unix %"lpr%" command to spool it to a printer.")
@@ -88,58 +89,56 @@ Copyright (c) 1990-1993, 1995, 1997, 1999, 2001, 2018, 2023 by Venue.
(* ;; "The temp file's name will be of the form medleyprint.<idate>, so all such files can be found for deletion on a subsequent call after a certain amount of time (2 minutes) has gone by. If we delete immediately, it may happen before lpr has done its thing. ")
(CL:MULTIPLE-VALUE-BIND (tmpstream tmpname)
(UnixTempFile 'medleyprint.)
(COND
(tmpstream
(CL:MULTIPLE-VALUE-BIND
(tmpstream tmpname)
(UnixTempFile 'medleyprint.)
(COND
(tmpstream
(* ;; "First, copy the lisp file to /tmp so lpr can find it.")
(* ;; "First, copy the lisp file to /tmp so lpr can find it.")
[CL:WITH-OPEN-STREAM
(out tmpstream)
(CL:WITH-OPEN-STREAM
(in (OPENSTREAM FILE 'INPUT))
(printout PROMPTWINDOW .TAB0 0 "Spooling output to Unix printer"
(COND
(PRINTER (CONCAT " '" PRINTER "'"))
(T ""))
"...")
(IF NSIDES
THEN
(* ;; "Have to put magic simplex/duplex stuff in the tmp file itself, after the first line, cause there is no other way to control some duplex printers.")
[CL:WITH-OPEN-STREAM
(out tmpstream)
(CL:WITH-OPEN-STREAM
(in (OPENSTREAM FILE 'INPUT))
(printout PROMPTWINDOW .TAB0 0 "Sending output to Unix printer" (OR PRINTER "")
"...")
(IF NSIDES
THEN
(* ;; "Have to put magic simplex/duplex stuff in the tmp file itself, after the first line, cause there is no other way to control some duplex printers.")
(BIND C SAWCR
DO (SETQ C (BIN in))
(IF (MEMB C (CHARCODE (CR LF)))
THEN (BOUT out C)
(SETQ SAWCR T)
ELSEIF SAWCR
THEN
(* ;; "First char of 2nd line: nonCR/LF after CR/LF")
(BIND C SAWCR
DO (SETQ C (BIN in))
(IF (MEMB C (CHARCODE (CR LF)))
THEN (BOUT out C)
(SETQ SAWCR T)
ELSEIF SAWCR
THEN
(* ;; "First char of 2nd line: nonCR/LF after CR/LF")
(* ;; "Put out simplex header, then print character in C")
(* ;; "Put out simplex header, then print character in C")
(PRINTOUT out "%%BeginSetup" T)
(PRINTOUT out "[{" T "%%%%BeginFeature: *Duplex Simplex" T
"<< /Duplex " (CL:IF (EQ NSIDES 1)
"false"
"true")
" /Tumble false >> setpagedevice" T
"%%%%EndFeature" T "} stopped cleartomark" T)
(PRINTOUT out "%%EndSetup" T)
(BOUT out C)
(COPYCHARS in out (GETFILEPTR in)
-1)
(RETURN)
ELSE (BOUT out C)))
ELSE (COPYCHARS in out 0 -1]
(PRINTOUT out "%%BeginSetup" T)
(PRINTOUT out "[{" T "%%%%BeginFeature: *Duplex Simplex" T
"<< /Duplex " (CL:IF (EQ NSIDES 1)
"false"
"true")
" /Tumble false >> setpagedevice" T "%%%%EndFeature"
T "} stopped cleartomark" T)
(PRINTOUT out "%%EndSetup" T)
(BOUT out C)
(COPYCHARS in out (GETFILEPTR in)
-1)
(RETURN)
ELSE (BOUT out C)))
ELSE (COPYCHARS in out 0 -1]
(* ;; "Now make Unix print the /tmp file.")
(* ;; "Now make Unix print the /tmp file.")
(ShellCommand (UnixPrintCommand PRINTER COPIES NAME tmpname)
PROMPTWINDOW)
(printout PROMPTWINDOW "done" T))
(T (ERROR "Couldn't create unix temp file"))))]
(ShellCommand (UnixPrintCommand PRINTER COPIES NAME tmpname)
PROMPTWINDOW)
(printout PROMPTWINDOW "done" T))
(T (ERROR "Couldn't create unix temp file"]
T])
(UnixShellQuote
@@ -303,9 +302,8 @@ Copyright (c) 1990-1993, 1995, 1997, 1999, 2001, 2018, 2023 by Venue.
(ADDTOVAR LAMA )
)
(PUTPROPS UNIXPRINT COPYRIGHT ("Venue" 1990 1991 1992 1993 1995 1997 1999 2001 2018 2023))
(DECLARE%: DONTCOPY
(FILEMAP (NIL (1389 11216 (InstallUnixPrinter 1399 . 1991) (UnixPrint 1993 . 6875) (UnixShellQuote
6877 . 8306) (UnixTempFile 8308 . 9531) (UnixPrintCommand 9533 . 11214)) (11550 13243 (
UnixPrintCommand 11560 . 13241)))))
(FILEMAP (NIL (1354 11238 (InstallUnixPrinter 1364 . 1956) (UnixPrint 1958 . 6897) (UnixShellQuote
6899 . 8328) (UnixTempFile 8330 . 9553) (UnixPrintCommand 9555 . 11236)) (11572 13265 (
UnixPrintCommand 11582 . 13263)))))
STOP