From owner-ntemacs-users@june  Wed Aug 28 10:53:46 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Wed" "28" "August" "1996" "10:41:25" "-0600" "Brad Sileo" "brad@geodata-gis.com" nil "39" "Re: help: printing under NT" "^From:" nil nil "8" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id KAA14868 for <voelker@june.cs.washington.edu>; Wed, 28 Aug 1996 10:53:46 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id KAA43228 for <voelker@joker.cs.washington.edu>; Wed, 28 Aug 1996 10:53:29 -0700
Received: from nile.GeoData-GIS.com (nile.GeoData-GIS.COM [204.133.146.23]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id JAA07930 for <ntemacs-users@cs.washington.edu>; Wed, 28 Aug 1996 09:48:18 -0700
Received: from thames (thames.GeoData-GIS.COM [204.133.146.30]) by nile.GeoData-GIS.com (8.7.5/8.7.3) with SMTP id KAA23096 for <ntemacs-users@cs.washington.edu>; Wed, 28 Aug 1996 10:41:27 -0600 (MDT)
Message-Id: <1.5.4.32.19960828164125.002ef454@nile.geodata-gis.com>
X-Sender: brad@nile.geodata-gis.com
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Brad Sileo <brad@GeoData-GIS.com>
To: ntemacs-users@cs.washington.edu
Subject: Re: help: printing under NT
Date: Wed, 28 Aug 1996 10:41:25 -0600

At 04:15 PM 8/28/96 +0200, you wrote:
>Item Subject: cc:Mail Text
>     Hi,
>     
>     I didn't get emacs printing to work under NT. Hopefully someone can 
>     help. I did the following (with Brad Sileo's print-NT.el solution):
>     
>     o put print-NT.el into \emacs\lisp directory
>     o adapted my .emacs file (\\\\servername\\printername)
>     o restarted emacs
>     o choosing Postscript Print Buffer from the menue produces
>       a Postscript file in the \temp directory, but NOT on the printer
>     o using 'print /d:\\servername\printername' with this file from the
>       commandline produces a nice output on the printer
>     
>     Any ideas, what goes wrong after producing of the file???

Seems like maybe you didn't define the ps-lpr-destination variable
correctly.  You can check it with C-h v ps-lpr-destination
It should look something like(assuming you didn't change my definitions):
ps-lpr-destination's value is ("\\\\server\\ps_printer")

Documentation:
*The UNC style location for Postscript print jobs
The default is \\thames\colorado.
Remember to escape the backslashes(use '\\' for each '\') for emacs.

--------------------

Also, is there any output in the *messages* buffer? It should report on the
results of the shell command there.

======================================================
                   Brad Sileo
              GeoData Solutions, Inc.		
Network Engineer                     GIS Consultant
Voice:(303)650-1600                 Fax:(303)650-1795 
             http://www.geodata-gis.com
======================================================

From owner-ntemacs-users@june  Tue Aug 27 09:52:14 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "27" "August" "1996" "09:58:05" "-0600" "Brad Sileo" "brad@geodata-gis.com" nil "132" "Re: Print-NT.el " "^From:" nil nil "8" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id JAA12664 for <voelker@june.cs.washington.edu>; Tue, 27 Aug 1996 09:52:14 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id JAA41007 for <voelker@joker.cs.washington.edu>; Tue, 27 Aug 1996 09:52:12 -0700
Received: from nile.GeoData-GIS.com ([204.133.146.23]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id JAA08400 for <ntemacs-users@cs.washington.edu>; Tue, 27 Aug 1996 09:04:55 -0700
Received: from thames (thames.GeoData-GIS.COM [204.133.146.30]) by nile.GeoData-GIS.com (8.7.5/8.7.3) with SMTP id JAA04887 for <ntemacs-users@cs.washington.edu>; Tue, 27 Aug 1996 09:58:04 -0600 (MDT)
Message-Id: <1.5.4.32.19960827155805.002ebdd4@nile.geodata-gis.com>
X-Sender: brad@nile.geodata-gis.com
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Brad Sileo <brad@GeoData-GIS.com>
To: ntemacs-users@cs.washington.edu
Subject: Re: Print-NT.el 
Date: Tue, 27 Aug 1996 09:58:05 -0600

Here is a slightly modified version of this code. I changed it to use the
shell command print, which accepts a device specifier(i.e. a UNC) and file
name as its arguments.  This allows me to use native NT printers from
emacs(is there an easier way to do this?).  It also lets users easily set
the variables lpr-destination and ps-lpr-destination to the UNC of their
favorite printer.  Thanks for the code bit Frederic, as I have needed to fix
my NT->emacs printing for some time!!

At 09:38 AM 8/27/96 +0200, you wrote:
>
>
>This is my little contribution to the use of Emacs under NT.
>
>This file is based on the exemple of Pascal Obry.
>It overwrites the items of the Tools menu.
>
>This works with lpr.exe and a dos shell-command
>


------------------- .emacs file (of default.el) --------------
;;; Setup printing for NT's using print-NT.el
(setq lpr-command     "print"
      ps-paper-type   'ps-a4)
;;;; Lots of nice docs so users can figure it out...
(defvar      lpr-destination    '("\\\\host\\share-name")
  "*The UNC style location for regular print jobs\nThe default is
\\\\host\\share-name.\nRemember to escape the backslashes(use '\\\\' for
each '\\') for emacs.")
(defvar      ps-lpr-destination '("\\\\host\\share-name_ps")
  "*The UNC style location for Postscript print jobs\nThe default is
\\\\host\\share-name_ps.\nRemember to escape the backslashes(use '\\\\' for
each '\\') for emacs.")

-------------------- Slightly modified print-NT.el ---------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; print-NT.el
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The variables lpr-switches and ps-lpr-switches have been replaced by
;;  lpr-destination and ps-lpr-destination, which must be defined. It would
;;  be cleaner if these could be null and the system default used, but 
;;  I'm too new to emacs Lisp to know how to do that without lots of thought
;;  :-)

(defvar ps-lpr-buffer "c:\\temp\\psspool.ps")
(defvar txt-lpr-buffer "c:\\temp\\psspool.txt")

;;;;;;; simple print

(defun print-lpr-buffer ()
	(shell-command
   (apply 'concat (append (list lpr-command " /D:")
                          lpr-destination
                          (list " " txt-lpr-buffer))))
	(delete-file txt-lpr-buffer)
)
(defun nt-print-buffer ()
  (interactive)
	(write-region (point-min) (point-max) txt-lpr-buffer)
	(print-lpr-buffer )
)
(defun nt-print-region ()
  (interactive)
	(write-region (point) (mark) txt-lpr-buffer)
	(print-lpr-buffer )
)

(define-key menu-bar-tools-menu [print-region]
  '("Print Region" . nt-print-region))
(define-key menu-bar-tools-menu [print-buffer]
  '("Print Buffer" . nt-print-buffer))

;;;;;;; ps-print 

(require 'ps-print)

(defun ps-print-lpr-buffer ()
	(shell-command
   (apply 'concat (append (list ps-lpr-command " /D:")
                          ps-lpr-destination
                          (list " " ps-lpr-buffer))))
	(delete-file  ps-lpr-buffer)
)

(defvar ps-print-use-faces nil
	"*Non-nil means alway print with faces.")

(defun toggle-use-face ()
	(interactive)
	(if ps-print-use-faces 
			(progn (setq ps-print-use-faces nil)
						 (message "ps-print-use-faces disabled"))
		(setq ps-print-use-faces t)
		(message "ps-print-use-faces unabled"))
)
(define-key menu-bar-tools-menu [toggle-use-face]
  '("Toggle on/off print-with-faces" . toggle-use-face))

(defun nt-ps-print-buffer ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-buffer-with-faces ps-lpr-buffer)
		(ps-print-buffer ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-buffer]
  '("Postscript Print Buffer" . nt-ps-print-buffer))
(define-key global-map "\C-cp" 'nt-ps-print-buffer)


(defun nt-ps-print-region ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-region-with-faces (point) (mark) ps-lpr-buffer)
		(ps-print-region (point) (mark) ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-region]
  '("Postscript Print Region" . nt-ps-print-region))
(define-key global-map "\C-crp" 'nt-ps-print-region)

;;;;;;;;;;
======================================================
                   Brad Sileo
              GeoData Solutions, Inc.		
Network Engineer                     GIS Consultant
Voice:(303)650-1600                 Fax:(303)650-1795 
             http://www.geodata-gis.com
======================================================

From owner-ntemacs-users@june  Tue Aug 27 01:35:10 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "27" "August" "1996" "09:38:53" "+0200" "Frederic Corne" "frederic.corne@erli.fr" nil "111" "Print-NT.el " "^From:" nil nil "8" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id BAA08135 for <voelker@june.cs.washington.edu>; Tue, 27 Aug 1996 01:35:10 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id BAA41908 for <voelker@joker.cs.washington.edu>; Tue, 27 Aug 1996 01:35:09 -0700
Received: from polaris.gsi.fr (polaris.gsi.fr [150.175.128.2]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id AAA04923 for <ntemacs-users@cs.washington.edu>; Tue, 27 Aug 1996 00:40:52 -0700
Received: from canis.gsi.fr (canis.gsi.fr [150.175.3.7]) by polaris.gsi.fr (8.7.3/8.6.12) with SMTP id JAA04116 for <ntemacs-users@cs.washington.edu>; Tue, 27 Aug 1996 09:41:34 +0200 (MET DST)
Received: from erli.fr ([150.175.65.76]) by canis.gsi.fr with SMTP id AA11725   (5.67b-Emil1.1/IDA-1.4.4 for <ntemacs-users@cs.washington.edu>); Tue, 27 Aug 1996 09:40:12 +0200
Received: from banane by erli.fr (4.1/SMI-4.1) 	id AA09552; Tue, 27 Aug 96 09:38:54 +0200
Message-Id: <9608270738.AA09552@erli.fr>
Reply-To: frederic.corne@erli.fr
From: Frederic Corne <frederic.corne@erli.fr>
To: ntemacs-users@cs.washington.edu
Subject: Print-NT.el 
Date: Tue, 27 Aug 96 09:38:53 +0200



This is my little contribution to the use of Emacs under NT.

This file is based on the exemple of Pascal Obry.
It overwrites the items of the Tools menu.

This works with lpr.exe and a dos shell-command

Add in your .emacs and change your server and printer name:

(setq lpr-command                "lpr"
			lpr-switches               '("-S your-server -P your-printer")
			ps-paper-type              'ps-a4 )

(load "print-NT"() t)
---------------------------------------------------------------

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; print-NT.el
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defvar ps-lpr-buffer "c:\\tmp\\psspool.ps")
(defvar txt-lpr-buffer "c:\\tmp\\psspool.txt")

;;;;;;; simple print

(defun print-lpr-buffer ()
	(shell-command
   (apply 'concat (append (list lpr-command " ")
                          lpr-switches
                          (list " " txt-lpr-buffer))))
	(delete-file txt-lpr-buffer)
)
(defun nt-print-buffer ()
  (interactive)
	(write-region (point-min) (point-max) txt-lpr-buffer)
	(print-lpr-buffer )
)
(defun nt-print-region ()
  (interactive)
	(write-region (point) (mark) txt-lpr-buffer)
	(print-lpr-buffer )
)

(define-key menu-bar-tools-menu [print-region]
  '("Print Region" . nt-print-region))
(define-key menu-bar-tools-menu [print-buffer]
  '("Print Buffer" . nt-print-buffer))



;;;;;;; ps-print 

(require 'ps-print)

(defun ps-print-lpr-buffer ()
	(shell-command
   (apply 'concat (append (list ps-lpr-command " ")
                          ps-lpr-switches
                          (list " " ps-lpr-buffer))))
	(delete-file  ps-lpr-buffer)
)

(defvar ps-print-use-faces nil
	"*Non-nil means alway print with faces.")

(defun toggle-use-face ()
	(interactive)
	(if ps-print-use-faces 
			(progn (setq ps-print-use-faces nil)
						 (message "ps-print-use-faces disabled"))
		(setq ps-print-use-faces t)
		(message "ps-print-use-faces unabled"))
)
(define-key menu-bar-tools-menu [toggle-use-face]
  '("Toggle on/off print-with-faces" . toggle-use-face))

(defun nt-ps-print-buffer ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-buffer-with-faces ps-lpr-buffer)
		(ps-print-buffer ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-buffer]
  '("Postscript Print Buffer" . nt-ps-print-buffer))
(define-key global-map "\C-cp" 'nt-ps-print-buffer)


(defun nt-ps-print-region ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-region-with-faces (point) (mark) ps-lpr-buffer)
		(ps-print-region (point) (mark) ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-region]
  '("Postscript Print Region" . nt-ps-print-region))
(define-key global-map "\C-crp" 'nt-ps-print-region)


;;;;;;;;;;
----------------------------------------------------------------

-- 

--- Frederic Corne --- ERLI --- frederic.corne@erli.fr ---

From owner-ntemacs-users@june  Fri Sep 20 13:33:34 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" "20" "September" "1996" "14:56:27" "" "Jeffrey D. Paquette" "paquette@ici.net" nil "18" "PRWIN32 / Printing from NTEmacs redux" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA04348 for <voelker@june.cs.washington.edu>; Fri, 20 Sep 1996 13:33:34 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id NAA18644 for <voelker@joker.cs.washington.edu>; Fri, 20 Sep 1996 13:33:33 -0700
Received: from uhura.ici.net (uhura.ici.net [204.97.252.6]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id MAA00820 for <ntemacs-users@cs.washington.edu>; Fri, 20 Sep 1996 12:48:16 -0700
Received: from Wintermute ([206.119.237.77]) by uhura.ici.net (8.7.5/8.7.3) with SMTP id PAA27888 for <ntemacs-users@cs.washington.edu>; Fri, 20 Sep 1996 15:55:44 -0400 (EDT)
Message-Id: <199609201955.PAA27888@uhura.ici.net>
Comments: Authenticated sender is <paquette@mail.ici.net>
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Priority: normal
X-mailer: Pegasus Mail for Windows (v2.42a)
From: "Jeffrey D. Paquette" <paquette@ici.net>
To: ntemacs-users@cs.washington.edu
Subject: PRWIN32 / Printing from NTEmacs redux
Date: Fri, 20 Sep 1996 14:56:27 -5

Apparently, several people out there have had problems with the
``pr'' utility I posted on my web site. Specifically, sometimes the
output of pr consists of nothing but the usage information. I put a
new version up (http://www.ici.net/customers/paquette/WinProgramming.html) 
that will print out the full command line whenever it displays the usage
information. 

If you are having this problem, or have had it in the past please use
this new version and mail the offending command line to me. 
BTW, I haven't seen this problem since I upgraded to NTEmacs 19.33.1. 
I'm wondering if there could be some malformed command lines out 
there :)



--
Jeff Paquette
paquette@ici.net

From owner-ntemacs-users@june  Tue Sep 24 12:48:43 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" "24" "September" "1996" "14:29:57" "EDT" "Robertson G. Davenport" "Robertson.Davenport@bailey.com" nil "25" "How do *you* print to HP laser jets?" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id MAA16162 for <voelker@june.cs.washington.edu>; Tue, 24 Sep 1996 12:48:43 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id MAA15718 for <voelker@joker.cs.washington.edu>; Tue, 24 Sep 1996 12:48:41 -0700
Received: from mail.bailey.com (mail.bailey.com [192.231.53.2]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id LAA10681 for <ntemacs-users@cs.washington.edu>; Tue, 24 Sep 1996 11:58:42 -0700
Received: by mail.bailey.com (4.1/SMI-4.1) 	id AA02944; Tue, 24 Sep 96 14:58:29 EDT
Received: from unknown(192.231.54.4) by mail.bailey.com via smap (V1.3) 	id sma002932; Tue Sep 24 14:58:05 1996
Received: from banyanmail.bailey.com by bailey.com (5.0/SMI-SVR4) 	id AA09921; Tue, 24 Sep 1996 14:58:01 -0400
Received: by banyanmail.bailey.com with VINES-ISMTP; Tue, 24 Sep 96 14:48:41 EDT
Message-Id: <vines.Lev7+5o0GmB@banyanmail.bailey.com>
X-Priority: 3 (Normal)
X-Incognito-Sn: 106
X-Incognito-Format: VERSION=2.02.90 ENCRYPTED=NO
From: "Robertson G Davenport" <Robertson.Davenport@bailey.com>
To: <ntemacs-users@cs.washington.edu>
Subject: How do *you* print to HP laser jets?
Date: Tue, 24 Sep 96 14:29:57 EDT

Hi again,

  I'd like to print source code from Emacs using smaller fonts than the 
printer normally uses, but so far my printing attempts use the default HPLJ 
font.  I have a networked HPLJ4 at work and a local Epson ActionLaser1500 at 
home - neither of which are postscript capable.  (I'm running Win95 and Emacs 
19.33.1 on both machines, too).
  I'd also like to figure out how to print small sheets (small pages with 
small fonts) to go into my small notebook (4"x6").

  I can do some of this with a utility called 4PRINT and can probably adjust 
the various code that's been posted on this list recently to use it as the 
command to print - but it's old and has some problems and I have to believe 
other people out there do things differently and I could learn from them.

  So, how do *you* print files?  Are there other/newer utilities that control 
printing to HPLJs? (HPCL?)  Searching the net netted me only utilities from 
92 and earlier - also making me thing I'm going about this the wrong way.

  Any pointers, advice, words of wisdom all gladly accepted.  If desired I 
can post a summary of my discoveries to this list later.

  Thanks for reading,

  Rob

From owner-ntemacs-users@june  Mon Sep 23 07:04:30 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "23" "September" "1996" "09:06:14" "-0400" "John Morey" "jmorey@r2d2.tbi.com" nil "36" "Re: PRWIN32 / Printing from NTEmacs redux" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id HAA24159 for <voelker@june.cs.washington.edu>; Mon, 23 Sep 1996 07:04:29 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id HAA17401 for <voelker@joker.cs.washington.edu>; Mon, 23 Sep 1996 07:04:29 -0700
Received: from r2d2.tbi.com ([206.5.81.6]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id GAA22193 for <ntemacs-users@cs.washington.edu>; Mon, 23 Sep 1996 06:06:32 -0700
Message-Id: <199609231306.GAA22193@june.cs.washington.edu>
Received: by r2d2.tbi.com 	(1.38.193.4/16.2) id AA03847; Mon, 23 Sep 1996 09:06:14 -0400
In-Reply-To: <199609201955.PAA27888@uhura.ici.net>
References: <199609201955.PAA27888@uhura.ici.net>
From: John Morey <jmorey@r2d2.tbi.com>
To: ntemacs-users@cs.washington.edu
Subject: Re: PRWIN32 / Printing from NTEmacs redux
Date: Mon, 23 Sep 1996 09:06:14 -0400

Jeff,

Thanks for the debug version of pr.  I was able to figure out what was
causing the trouble for me on Emacs version 19.34.  In the file lpr.el
there is a variable lpr-page-header-switches.  This is the variable
that ntemacs is using to print on my pc.  After I changed this
variable printing with pr was OK.  It seems strange that the value of
lpr-switches was echoed into the minibuffer but
lpr-page-header-switches was being used but I don't really understand
the lisp stuff.


--
John Morey

>>>>> "Jeffrey" == Jeffrey D Paquette <paquette@ici.net> writes:

Jeffrey> Apparently, several people out there have had problems with
Jeffrey> the ``pr'' utility I posted on my web site. Specifically,
Jeffrey> sometimes the output of pr consists of nothing but the usage
Jeffrey> information. I put a new version up
Jeffrey> (http://www.ici.net/customers/paquette/WinProgramming.html)
Jeffrey> that will print out the full command line whenever it
Jeffrey> displays the usage information.

Jeffrey> If you are having this problem, or have had it in the past
Jeffrey> please use this new version and mail the offending command
Jeffrey> line to me.  BTW, I haven't seen this problem since I
Jeffrey> upgraded to NTEmacs 19.33.1.  I'm wondering if there could be
Jeffrey> some malformed command lines out there :)



Jeffrey> --
Jeffrey> Jeff Paquette
Jeffrey> paquette@ici.net

From owner-ntemacs-users@june  Fri Sep 13 15:01:46 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Fri" "13" "September" "1996" "14:54:23" "-0600" "Brad Sileo" "brad@geodata-gis.com" nil "129" "Re: how do you set up a printer for NT v4" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id PAA19281 for <voelker@june.cs.washington.edu>; Fri, 13 Sep 1996 15:01:46 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA23292 for <voelker@joker.cs.washington.edu>; Fri, 13 Sep 1996 15:01:45 -0700
Received: from nile.GeoData-GIS.com ([204.133.146.23]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id OAA12554 for <ntemacs-users@cs.washington.edu>; Fri, 13 Sep 1996 14:01:38 -0700
Received: from thames (thames.GeoData-GIS.COM [204.133.146.30]) by nile.GeoData-GIS.com (8.7.5/8.7.3) with SMTP id OAA07045; Fri, 13 Sep 1996 14:54:23 -0600 (MDT)
Message-Id: <1.5.4.32.19960913205423.002f3604@nile.geodata-gis.com>
X-Sender: brad@nile.geodata-gis.com
X-Mailer: Windows Eudora Light Version 1.5.4 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Brad Sileo <brad@GeoData-GIS.com>
To: rcourt@infinity.com, ntemacs-users@cs.washington.edu
Subject: Re: how do you set up a printer for NT v4
Date: Fri, 13 Sep 1996 14:54:23 -0600

At 03:52 PM 9/11/96 -0700, rcourt@infinity.com wrote:
>I tried to use the sample from the NT page at the U, but to no avail.  Has 
>anyone had any success setting up a printer and printing?  If so, how?  As 
>for my vital statistics, NT v4 OS, HP-682C printer.  Oh, and no problems 
>printing from other windoze applications.

Here is the LISP I use, though it is on NT v3.51, as long as the "print"
command is implemented in NT 4.0(I don;t have it to check), it should work
fine. BTW, this is not my code, though I did alter it a bit to use print
instead of lpr from its original form on this list.

As long as your printer is working correctly and you can print useing the
command line "print" command, this should work.  It ataches to the menu
options print buffer, postscript print buffer, etc..

-------- This goes in your .emacs or default.el file -------

;;; Setup printing for NT's using lpr.exe/NT-print.el
(setq lpr-command     "print"
      ps-paper-type   'ps-a4)

(defvar      lpr-destination    '("\\\\server\\printer")
  "*The UNC style location for regular print jobs\nThe default is
\\\\server\\printer.\nRemember to escape the backslashes(use '\\\\' for each
'\\') for emacs.")
(defvar      ps-lpr-destination '("\\\\server\\printer")
  "*The UNC style location for Postscript print jobs\nThe default is
\\\\server\\printer.\nRemember to escape the backslashes(use '\\\\' for each
'\\') for emacs.")

(load "print-NT"() t)


------- lisp file -- print-NT.el ----- put this in your EMACSLOADPATH
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; print-NT.el
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defvar ps-lpr-buffer "c:\\temp\\psspool.ps")
(defvar txt-lpr-buffer "c:\\temp\\psspool.txt")

;;;;;;; simple print

(defun print-lpr-buffer ()
	(shell-command
   (apply 'concat (append (list lpr-command " /D:")
                          lpr-destination
                          (list " " txt-lpr-buffer))))
	(delete-file txt-lpr-buffer)
)
(defun nt-print-buffer ()
  (interactive)
	(write-region (point-min) (point-max) txt-lpr-buffer)
	(print-lpr-buffer )
)
(defun nt-print-region ()
  (interactive)
	(write-region (point) (mark) txt-lpr-buffer)
	(print-lpr-buffer )
)

(define-key menu-bar-tools-menu [print-region]
  '("Print Region" . nt-print-region))
(define-key menu-bar-tools-menu [print-buffer]
  '("Print Buffer" . nt-print-buffer))



;;;;;;; ps-print 

(require 'ps-print)

(defun ps-print-lpr-buffer ()
	(shell-command
   (apply 'concat (append (list ps-lpr-command " /D:")
                          ps-lpr-destination
                          (list " " ps-lpr-buffer))))
	(delete-file  ps-lpr-buffer)
)

(defvar ps-print-use-faces nil
	"*Non-nil means alway print with faces.")

(defun toggle-use-face ()
	(interactive)
	(if ps-print-use-faces 
			(progn (setq ps-print-use-faces nil)
						 (message "ps-print-use-faces disabled"))
		(setq ps-print-use-faces t)
		(message "ps-print-use-faces unabled"))
)
(define-key menu-bar-tools-menu [toggle-use-face]
  '("Toggle on/off print-with-faces" . toggle-use-face))

(defun nt-ps-print-buffer ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-buffer-with-faces ps-lpr-buffer)
		(ps-print-buffer ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-buffer]
  '("Postscript Print Buffer" . nt-ps-print-buffer))
(define-key global-map "\C-cp" 'nt-ps-print-buffer)


(defun nt-ps-print-region ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-region-with-faces (point) (mark) ps-lpr-buffer)
		(ps-print-region (point) (mark) ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-region]
  '("Postscript Print Region" . nt-ps-print-region))
(define-key global-map "\C-crp" 'nt-ps-print-region)


;;;;;;;;;;
======================================================
                   Brad Sileo
              GeoData Solutions, Inc.		
Network Engineer                     GIS Consultant
Voice:(303)650-1600                 Fax:(303)650-1795 
             http://www.geodata-gis.com
======================================================

From owner-ntemacs-users@june  Tue Oct  1 06:41:50 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Tue" " 1" "October" "1996" "08:55:45" "-0400" "David J. Fiander" "davidf@mks.com" nil "31" "PS printing buffers" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id GAA14680 for <voelker@june.cs.washington.edu>; Tue, 1 Oct 1996 06:41:49 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id GAA26379 for <voelker@joker.cs.washington.edu>; Tue, 1 Oct 1996 06:41:49 -0700
Received: from mks-gate.mks.com (mks-gate.mks.com [142.77.7.224]) by june.cs.washington.edu (8.7.6/7.2ju) with ESMTP id FAA10232 for <ntemacs-users@cs.washington.edu>; Tue, 1 Oct 1996 05:55:56 -0700
Received: from mks.com (milli.mks.com [1.0.0.16]) by mks-gate.mks.com (8.7.4/8.7.3) with SMTP id IAA08918 for <ntemacs-users@cs.washington.edu>; Tue, 1 Oct 1996 08:55:55 -0400 (EDT)
Received: from davidf-nt.mks.com.mks.com by mks.com (SMI-8.6/SMI-SVR4) 	id IAA29209; Tue, 1 Oct 1996 08:55:45 -0400
Message-Id: <199610011255.IAA29209@mks.com>
From: "David J. Fiander" <davidf@mks.com>
To: ntemacs-users@cs.washington.edu
Subject: PS printing buffers
Date: Tue, 1 Oct 1996 08:55:45 -0400

The outline of how to print postscript from within emacs is good,
except for two little problems:  it doesn't work for those of us
that don't use cmd.exe as our shell, and it doesn't change the
"Tools" pull-down menu to use nt-ps-print-buffer-with-faces.

I didn't have too much luck printing with faces on my B&W
postscript printer, so I don't define
nt-ps-print-buffer-with-faces, but nt-ps-print-buffer.  If you
want to use faces, just change the function names accordingly.

Here's a simple fix for both problems:

;;;
;;; Use this instead of the version of the function from the FAQ
;;; note
;;;
(defun nt-ps-print-buffer ()
  (interactive)
  (ps-print-buffer ps-lpr-buffer)
  (let ((shell-file-name "cmd.exe")	; switch back to cmd.exe temporarily
	(win32-quote-process-args nil)
	(shell-command-switch "/c"))
    (shell-command
     (apply 'concat (append (list ps-lpr-command " ")
			    ps-lpr-switches
			    (list " " ps-lpr-buffer))))))

;;;
;;; Change the menu-bar to use nt-ps-print
(define-key menu-bar-tools-menu [ps-print-buffer]
  '("Postscript Print Buffer" . nt-ps-print-buffer))

From owner-ntemacs-users@june  Wed Sep 18 18:52:44 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Wed" "18" "September" "1996" "19:17:47" "-0600" "Mark Masse" "masse@nagtje.cs.colorado.edu" nil "37" "Printing from ntemacs in Win95" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id SAA23149 for <voelker@june.cs.washington.edu>; Wed, 18 Sep 1996 18:52:44 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id SAA31153 for <voelker@joker.cs.washington.edu>; Wed, 18 Sep 1996 18:52:43 -0700
Received: from nagtje.cs.colorado.edu (nagtje.cs.Colorado.EDU [128.138.250.110]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id SAA17085 for <ntemacs-users@cs.washington.edu>; Wed, 18 Sep 1996 18:17:49 -0700
Received: (from masse@localhost) by nagtje.cs.colorado.edu (8.7.5/8.7.3) id TAA02426; Wed, 18 Sep 1996 19:17:47 -0600 (MDT)
In-Reply-To: <9609181258.AA06948@austin.asc.slb.com>
Message-ID: <Pine.HPP.3.91.960918190955.2397A-100000@nagtje.cs.colorado.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
From: Mark Masse <masse@nagtje.cs.colorado.edu>
To: ntemacs-users@cs.washington.edu
Subject: Printing from ntemacs in Win95
Date: Wed, 18 Sep 1996 19:17:47 -0600 (MDT)


Hello,

  I'm not sure if anyone needs this, but I thought I would post my 
*simple* method for printing buffers/files with ntemacs under Win95.  I 
have not tested this under NT, but it may work there as well.  I am sure 
there are better, cleaner and simpler ways to do this, but it was a quick 
hack :)  Here is what I added to my "_emacs" file:

;; This should be set to your printer's port, mine is LPT1.
(setq printer-port "LPT1:")

;; My Win 95 printing hack.  NOTE: *ALWAYS* saves buffer to file before 
;; printing.
(defun win95-print-buffer-file ()
  "Print the current buffer's file by copying the associated file to the
   printer port. Saves the buffer if has been modified and/or never saved."
  (interactive)
  (save-buffer)
  (setq file (buffer-file-name))
  (message (concat "Printing " file " on " printer-port))
  (copy-file file "lpt1:"))

;; Make "Ctrl-c p" print the current buffer
(define-key global-map "\C-cp" 'win95-print-buffer-file)


That's it, I hope that its useful...

- Mark

***********************************************************************
Mark Masse                                       Undergraduate Student
                                        Department of Computer Science
masse@nag.cs.colorado.edu                       University of Colorado  
http://www-ugrad.cs.colorado.edu/~masse                    Boulder, CO
***********************************************************************

From owner-ntemacs-users@june  Thu Sep 19 10:45:45 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "19" "September" "1996" "12:54:18" "-0400" "Paul Mitchell" "paul_mitchell@neocortek.com" nil "41" "Re: Printing from ntemacs in Win95" "^From:" nil nil "9" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id KAA05608 for <voelker@june.cs.washington.edu>; Thu, 19 Sep 1996 10:45:45 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id KAA21432 for <voelker@joker.cs.washington.edu>; Thu, 19 Sep 1996 10:45:43 -0700
Received: from perseus.ultra.net (perseus.ultra.net [199.232.56.6]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id JAA28481 for <ntemacs-users@cs.washington.edu>; Thu, 19 Sep 1996 09:56:45 -0700
Received: from psm (d76.wor.ma.ultra.net [146.115.69.76]) by perseus.ultra.net (8.7.4/dae0.6) with SMTP id MAA18188; Thu, 19 Sep 1996 12:56:35 -0400 (EDT)
Message-Id: <2.2.32.19960919165418.006d7e9c@ultranet.com>
X-Sender: psm@ultranet.com
X-Mailer: Windows Eudora Pro Version 2.2 (32)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
From: Paul Mitchell <paul_mitchell@neocortek.com>
To: Mark Masse <masse@nagtje.cs.colorado.edu>
Cc: ntemacs-users@cs.washington.edu
Subject: Re: Printing from ntemacs in Win95
Date: Thu, 19 Sep 1996 12:54:18 -0400

At 07:17 PM 9/18/96 -0600, you wrote:
>
>Hello,
>
>  I'm not sure if anyone needs this, but I thought I would post my 
>*simple* method for printing buffers/files with ntemacs under Win95.  I 
>have not tested this under NT, but it may work there as well.  I am sure 
>there are better, cleaner and simpler ways to do this, but it was a quick 
>hack :)  Here is what I added to my "_emacs" file:
>
Hi Mark.

Your win95 printing hack worked fine for me except that it wouldn't scroll
up the paper after the printing was completed.  The solution is to send a ^L
to the printer after the file has been sent.  

Here's the modified code:

;; This should be set to your printer's port, mine is LPT1.
(setq printer-port "LPT1:")

;; My Win 95 printing hack.  NOTE: *ALWAYS* saves buffer to file before 
;; printing.
(defun win95-print-buffer-file ()
  "Print the current buffer's file by copying the associated file to the
   printer port. Saves the buffer if has been modified and/or never saved."
  (interactive)
  (save-buffer)
  (setq file (buffer-file-name))
  (copy-file file printer-port)
  (save-excursion
    (set-buffer (get-buffer-create "*ControlL*"))
    (insert "") ;; this needs to be a real control-l. type C-q C-l inside
the quotes
    (write-file printer-port)
    (kill-buffer printer-port))
  (message (concat "Printing " file " on " printer-port)))

****     Paul Mitchell - NeoCortek, Inc.     ****
****       paul_mitchell@neocortek.com       ****
**** Tel: (508) 779-0355 Fax: (508) 779-2941 ****

From owner-ntemacs-users@june  Wed Oct 16 23:15:19 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "" "16" "October" "1996" "15:02:56" "EDT" "Paul Koning" "Paul_Koning@3mail.3com.com" nil "50" "Re: Printing on windows 95" "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id XAA10661 for <voelker@june.cs.washington.edu>; Wed, 16 Oct 1996 23:15:18 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id XAA26175 for <voelker@joker.cs.washington.edu>; Wed, 16 Oct 1996 23:15:14 -0700
Received: from custmail.InterNex.Net (custmail.internex.net [199.2.14.213]) by june.cs.washington.edu (8.7.6/7.2ju) with ESMTP id WAA08934 for <ntemacs-users@cs.washington.edu>; Wed, 16 Oct 1996 22:41:29 -0700
Received: from cixgate ([192.156.136.10]) by custmail.InterNex.Net (8.7.1/8.7.1) with SMTP id WAA19955 for <ntemacs-users@cs.washington.edu>; Wed, 16 Oct 1996 22:41:25 -0700 (PDT)
Received: from gw.3Com.COM by cixgate (4.1/SMI-4.1/3com-cixgate-GCA-931027-01) 	id AA01599; Wed, 16 Oct 96 22:54:10 PDT
Received: from hqsmtp2.OPS.3Com.COM by gw.3Com.COM with SMTP id AA03406   (5.65c/IDA-1.4.4 for <ntemacs-users@cs.washington.edu>); Wed, 16 Oct 1996 22:41:22 -0700
Received: by hqsmtp2.ops.3com.com (IBM OS/2 SENDMAIL VERSION 1.3.17/1.0) 	  id AA0621; Wed, 16 Oct 96 22:47:04 -0700
Message-Id: <9610170547.AA0621@hqsmtp2.ops.3com.com>
Received: by 3Com (Lotus Notes Mail Gateway for SMTP V1.1) id   A6F53403B19E596C852563C500684AFE; Wed, 16 Oct 96 22:47:02 EDT
Mime-Version: 1.0
Content-Type: Text/Plain
From: Paul Koning/US/3Com <Paul_Koning@3mail.3Com.COM>
To: Robert Brodersen <rbrodersen@siebel.com>
Cc: "'ntemacs-users@cs.washington.edu'" <ntemacs-users@cs.washington.edu>
Subject: Re: Printing on windows 95
Date: 16 Oct 96 15:02:56 EDT

Returning to a note from last May...  

>From: rbrodersen @ siebel.com (Robert Brodersen) @ UGATE    

>I modified Pascal Obry's NT PS-Print to work on Windows 95.
>I can believe how lousy the print spooler is in Windows 95.
>Avoiding it entirely seems to work fairly well tough.  A better 
>solution sure would be nice.  Perhaps someone knows of
>a port of lpr to Windows 95?

>; W95 PS-Print works by writing a file and then copying the file to the printer
>; If you use a network printer, you need to setup a capture port (using the
>; details tab of the printer properties dialog)
>; ##################################################  W95 PS-Print
>
>(require 'ps-print)
>(setq ps-lpr-command "copy")
>(setq ps-lpr2-switches '("LPT1:"))      ; switches which go after the
>filename
>(setq ps-lpr-buffer "c:\\temp\\psspool.ps")       ; a tmp spool file
>
>(defun w95-ps-print-buffer-with-faces ()
>  (interactive)
>  (ps-print-buffer-with-faces ps-lpr-buffer)
>  (shell-command
>   (apply 'concat (append (list ps-lpr-command " ")
>                          ps-lpr-switches
>                          (list " " ps-lpr-buffer " ")
>                          ps-lpr2-switches)))
>)

I tried setting the spool file name to the printer device name, but
that doesn't work.  What DID work is to set the spool file name to
the UNC name of the printer.  It helps that the printer I want to
use is a network printer; I'm not sure what the UNC name of a local
printer is (or if there even is one).  

Anyway, with that approach things get very simple:

(require 'ps-print)
(setq ps-lpr-buffer "\\\\server\\printer") ; point straight to printer

(defun w95-ps-print-buffer-with-faces ()
  (interactive)
  (ps-print-buffer-with-faces ps-lpr-buffer)
)

Thanks for pointing the way, Bob.

 paul

From owner-ntemacs-users@june  Thu Oct 17 01:41:30 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "17" "October" "1996" "09:54:08" "+0200" "Frederic Corne" "frederic.corne@erli.fr" nil "161" "Print-NT.el : printing under ntemacs." "^From:" nil nil "10" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.6/7.2ju) with SMTP id BAA17929 for <voelker@june.cs.washington.edu>; Thu, 17 Oct 1996 01:41:29 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id BAA26204 for <voelker@joker.cs.washington.edu>; Thu, 17 Oct 1996 01:41:27 -0700
Received: from polaris.gsi.fr (polaris.gsi.fr [150.175.128.2]) by june.cs.washington.edu (8.7.6/7.2ju) with ESMTP id AAA16719 for <ntemacs-users@cs.washington.edu>; Thu, 17 Oct 1996 00:55:02 -0700
Received: from erli.fr ([150.175.65.76]) by polaris.gsi.fr (8.7.3/8.6.12) with SMTP id JAA21592 for <ntemacs-users@cs.washington.edu>; Thu, 17 Oct 1996 09:55:49 +0200 (MET DST)
Received: from banane by erli.fr (4.1/SMI-4.1) 	id AA12291; Thu, 17 Oct 96 09:54:09 +0200
Message-Id: <9610170754.AA12291@erli.fr>
Reply-To: frederic.corne@erli.fr
From: Frederic Corne <frederic.corne@erli.fr>
To: ntemacs-users@cs.washington.edu
Subject: Print-NT.el : printing under ntemacs.
Date: Thu, 17 Oct 96 09:54:08 +0200


Hi all,

As I can see some news users of ntemacs meet problems with printing
under emacs, here is a slightly modified version of the print-NT.el package
I have written and posted this summer. 

Hope this helps.


FC

;;; print-NT.el --- Special printing fonctions for Windows NT
;;
;; Author: Frederic Corne <frederic.corne@erli.fr> 
;; Created: jul 1996
;; Version: 1.0  1996/10/02 
;; Keywords: print, PostScript
;;
;;; Commentary:
;; 
;;  This file is based on the example of Pascal Obry (in the ntemacs FAQ).
;;
;;  This file overwrites the items of the Tools menu, so it must be loaded 
;;  before any use of the menu.
;;
;;  It alows to print with faces or not.
;;
;; USAGE: Byte-compile this file, and add the following line to your
;;  emacs initialization file (.emacs/_emacs) according to the type 
;;  of printer command (print or lpr):
;; 
;;  if you use print.exe command (The UNC style location for regular print jobs):
;;  Remember to escape the backslashes(use '\\\\' for each '\\') for emacs.
;;  
;;  (setq lpr-command                "print"
;;  			lpr-destination               '("/D:\\\\host\\share-name") ;; for normal printer
;;  			ps-lpr-destination            '("/D:\\\\host\\share-name") ;; for postscript printer
;;  
;;  (setq  ps-paper-type              'ps-a4 ) ; the type of paper (if needed)
;;  
;;  (load "print-NT"() t)
;;  
;;  
;;  
;;  if you use lpr.exe command, add :
;;  
;;  (setq lpr-command                "lpr"
;;  			lpr-destination           '("-S host -P share-name")  ;; for normal printer
;;  			ps-lpr-destination        '("-S host -P share-name")) ;; for postscript printer
;;  			
;;  (setq  ps-paper-type              'ps-a4 ) ; the type of paper (if needed)
;;  
;;  (load "print-NT"() t)
;;  
;;
;;  You can also change the temporary buffers values ps-lpr-buffer and txt-lpr-buffer
;;;;;  
;;;;; Change log:
;;
;; Revision 1.0  1996/10/02 fcorne
;; Initial revision
;;
;; Credit for suggestions, patches and bug-fixes:
;; David J. Fiande <davidf@mks.com>
;; Brad Sileo <brad@GeoData-GIS.com> 

;;; Code:

(defvar  lpr-destination    '("-S host -P share-name"))
(defvar  ps-lpr-destination '("-S host -P share-name"))

(defvar ps-lpr-buffer "c:\\tmp\\psspool.ps")
(defvar txt-lpr-buffer "c:\\tmp\\psspool.txt")

;;;;;;; print simple
(defun print-lpr-buffer ()
  (let ((shell-file-name "cmd.exe")	; switch back to cmd.exe temporarily
				(win32-quote-process-args nil)
				(shell-command-switch "/c"))
		(shell-command
		 (apply 'concat (append (list lpr-command " ")
														lpr-destination 
														(list " " txt-lpr-buffer)))))
	(delete-file txt-lpr-buffer)
	)
(defun nt-print-buffer ()
  (interactive)
	(write-region (point-min) (point-max) txt-lpr-buffer)
	(print-lpr-buffer )
	)
(defun nt-print-region ()
  (interactive)
	(write-region (point) (mark) txt-lpr-buffer)
	(print-lpr-buffer )
	)

(define-key menu-bar-tools-menu [print-region]
  '("Print Region" . nt-print-region))
(define-key menu-bar-tools-menu [print-buffer]
  '("Print Buffer" . nt-print-buffer))



;;;;;;; ps-print 

(require 'ps-print)

(defun ps-print-lpr-buffer ()
  (let ((shell-file-name "cmd.exe")	; switch back to cmd.exe temporarily
				(win32-quote-process-args nil)
				(shell-command-switch "/c"))
		(shell-command
		 (apply 'concat (append (list ps-lpr-command " ")
														ps-lpr-destination
														(list " " ps-lpr-buffer)))))
	(delete-file  ps-lpr-buffer)
	)

(defvar ps-print-use-faces nil
	"*Non-nil means alway print with faces.")

(defun toggle-use-face ()
	(interactive)
	(if ps-print-use-faces 
			(progn (setq ps-print-use-faces nil)
						 (message "ps-print-use-faces disabled"))
		(setq ps-print-use-faces t)
		(message "ps-print-use-faces enabled"))
)
(define-key menu-bar-tools-menu [toggle-use-face]
  '("Toggle on/off print-with-faces" . toggle-use-face))

(defun nt-ps-print-buffer ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-buffer-with-faces ps-lpr-buffer)
		(ps-print-buffer ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-buffer]
  '("Postscript Print Buffer" . nt-ps-print-buffer))
(define-key global-map "\C-cp" 'nt-ps-print-buffer)


(defun nt-ps-print-region ()
  (interactive)
	(if ps-print-use-faces 
			(ps-print-region-with-faces (point) (mark) ps-lpr-buffer)
		(ps-print-region (point) (mark) ps-lpr-buffer)
		)
  (ps-print-lpr-buffer)
)
(define-key menu-bar-tools-menu [ps-print-region]
  '("Postscript Print Region" . nt-ps-print-region))
(define-key global-map "\C-crp" 'nt-ps-print-region)


;;;;;;;;;;


From owner-ntemacs-users@june  Mon Jul 22 13:58:21 1996
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Mon" "22" "July" "1996" "15:19:06" "" "Jeffrey D. Paquette" "paquette@ici.net" nil "16" "Printing under win32 - my solution" "^From:" nil nil "7" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.7.5/7.2ju) with SMTP id NAA01448 for <voelker@june.cs.washington.edu>; Mon, 22 Jul 1996 13:58:21 -0700
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id NAA40389 for <voelker@joker.cs.washington.edu>; Mon, 22 Jul 1996 13:58:20 -0700
Received: from uhura.ici.net (uhura.ici.net [204.97.252.6]) by june.cs.washington.edu (8.7.5/7.2ju) with ESMTP id NAA24482 for <ntemacs-users@cs.washington.edu>; Mon, 22 Jul 1996 13:17:00 -0700
Received: from Wintermute (pmm2ip1.ici.net [206.231.68.31]) by uhura.ici.net (8.7.5/8.7.3) with SMTP id QAA19222 for <ntemacs-users@cs.washington.edu>; Mon, 22 Jul 1996 16:23:41 -0400 (EDT)
Message-Id: <199607222023.QAA19222@uhura.ici.net>
Comments: Authenticated sender is <paquette@mail.ici.net>
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Priority: normal
X-mailer: Pegasus Mail for Windows (v2.40)
From: "Jeffrey D. Paquette" <paquette@ici.net>
To: ntemacs-users@cs.washington.edu
Subject: Printing under win32 - my solution
Date: Mon, 22 Jul 1996 15:19:06 -5

I've posted a small (20k) utility that can print a pipe to a 
UNC-named printer (or a port or file, for that matter) to my web 
site. It is a win32 console app that works fine from within emacs, as 
long as you use 4NT or another useful shell (4dos on Win95 doesn't 
cut it, as some of us have seen :) )

You can get prwin32.zip at 
http://www.ici.net/customers/paquette/WinProgramming.html along with 
some notes for the elisp hackery needed to get it to work.

Comments / bugs to me, please.

Jeff
--
Jeff Paquette
paquette@ici.net

From owner-ntemacs-users@june  Thu Jan 23 11:48:42 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" "23" "January" "1997" "11:17:27" "-0600" "Brad Haack" "haack@s1001.den.mmc.com" nil "45" "Re: printing, win95, network printer" "^From:" nil nil "1" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with SMTP id LAA13926 for <voelker@june.cs.washington.edu>; Thu, 23 Jan 1997 11:48:41 -0800
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id LAA30567 for <voelker@joker.cs.washington.edu>; Thu, 23 Jan 1997 11:48:40 -0800
Received: from everest.den.mmc.com (everest.den.mmc.com [160.205.27.1]) by june.cs.washington.edu (8.8.3+CSE/7.2ju) with ESMTP id KAA08479 for <ntemacs-users@cs.washington.edu>; Thu, 23 Jan 1997 10:48:18 -0800
Received: from s0101.den.mmc.com (s0101.ast.lmco.com [160.205.6.1]) by everest.den.mmc.com (8.7.5/8.7.3) with SMTP id LAA25898; Thu, 23 Jan 1997 11:48:11 -0700 (MST)
Received: by s0101.den.mmc.com 	(1.38.193.4/16.2) id AA15729; Thu, 23 Jan 1997 11:48:05 -0700
Reply-To: Brad Haack <haack@s1001.den.mmc.com>
In-Reply-To: <85256426.005F8237.00@hqoutbound.ops.3com.com>
Message-Id: <Pine.3.87.9701231014.A15533-0100000@s0101.den.mmc.com>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII
From: Brad Haack <haack@s1001.den.mmc.com>
Sender: Brad Haack <haack@s1001.den.mmc.com>
To: Paul_Koning@3mail.3Com.COM
Cc: ntemacs-users@cs.washington.edu
Subject: Re: printing, win95, network printer
Date: Thu, 23 Jan 1997 11:17:27 -0600 (MDT)

Thanks, this works, almost anyway.  The printer is grabbing paper from the
11x17 tray, altho the output is formatted for 8.5x11.  I tried forcing the
printer tray to the right one (instead of automatic) with the win95
printer driver setup stuff, but it still grabbed the wrong paper (its an
HP5Si). Possibly something wrong in ps-print-prologue ? 

ps-paper-type is ps-letter
ps-lpr-command's value is "lpr"
ps-lpr-switches's value is nil
It looks like ps-lpr-command and ps-lpr-switches don't get used since the 
file is sent with write-region from ps-do-despool.

Brad
haack@ast.lmco.com


On Tue, 21 Jan 1997 Paul_Koning@3mail.3Com.COM wrote:

> I find it easier not to go via a spool file or COPY command at all,
> but rather to have Emacs write directly to the printer.  Here's the
> relevant
> Elisp code.  Note "w95-lpr-buffer"...
> 
>      paul
> 
> ;;; w95-ps-print
> 
> (require 'ps-print)
> (defvar w95-lpr-buffer "\\\\chips1\\syseng"
>   "*Printer to use for PostScript print functions.")
> 
> (defun w95-ps-print-buffer-with-faces ()
>   "Generate and print a PostScript image of the buffer.
> 
> The printout is sent to the printer specified by variable
> w95-lpr-buffer (by default \\\\chips1\\syseng).  If the current
> buffer has font lock active, comments are printed in italics,
> and keywords are bold."
>   (interactive)
>   (ps-print-buffer-with-faces w95-lpr-buffer)
> )

snip snip



