home *** CD-ROM | disk | FTP | other *** search
- From: danny@amil.co.il (Danny Bar-Dov)
- Message-ID: <9208130714.AA14302@amil.co.il>
- Subject: printing with different command
- Date: Thu, 13 Aug 1992 07:16:29 GMT
- Newsgroups: alt.lucid-emacs.help
- Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
- Sender: help-lucid-emacs-request@lucid.com
- Lines: 70
-
- Finally we moved to lemacs-19.2. Only not without some problems.
- In 19.1 I hacked lpr.el a bit so that a local package which
- prints using enscript will work.
- Only in 19.2 lpr.el is loaded into lemacs.
- (and I use the supplied sun4 version - no time to compile :-)
-
- Here is what I changed in lpr.el (I added the (provide ...) side
-
- 20d19
- < (provide 'lpr)
- 69c68
- < (setq switches (and (eq lpr-command "lpr") (cons "-p" switches)))))
- ---
- > (setq switches (cons "-p" switches))))
- 73c72
- < (nconc (and (eq lpr-command "lpr")
- ---
- > (nconc (and (eq system-type 'berkeley-unix)
-
- So now (require 'lpr) complains, and removing that then
- changing the lpr-command fails because of the "-p" flag.
-
- Does anybody have a suggestion ?
-
- I add the (short) laser package.
-
- Danny
-
- ------------------- cut here for laser.el -------------------
- ;;;
- ;;; PostScript LASER printer routines.
- ;;; adjusted for lemacs 19.1 by Dan Bar Dov June 18 1992
-
- (require 'lpr)
-
- (defvar *laser-print-user-name* t
- "Specifies whether to include the user name
- in the print buffer / region titles.")
-
- (defvar *enscript-switches* '("-fCourier-Oblique10" "-FTimes-BoldItalic10"))
-
- (defun laser-print (p-what &optional switches)
- "Print buffer / region using the ENSCRIPT command."
- (let ((saved-witches lpr-switches)
- (saved-command lpr-command))
- (set-variable 'lpr-switches (or switches *enscript-switches*))
- (setq lpr-command "/usr/local/bin/enscript")
- (if (equal p-what 'buffer)
- (print-buffer)
- (lpr-region (region-beginning) (region-end)))
- (set-variable 'lpr-switches saved-witches)
- (setq lpr-command saved-command)))
-
- (defun laser-print-region ()
- "Prints region by laser printer."
- (interactive)
- (laser-print 'region))
-
- (defun laser-print-buffer ()
- "Prints region with header by laser printer."
- (interactive)
- (laser-print 'buffer))
-
- (defun read-enscript-switches ()
- (let ((args (read-string "Enter enscript switches: " *enscript-switches*)))
- (list args))
- )
-
-
- (defvar print-command nil)
-