Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!shelby!apple!gem.mps.ohio-state.edu!wuarchive!uwm.edu!mrsvr.UUCP!pet3.uucp!hallett From: hallett@pet3.uucp (Jeff Hallett x5163 ) Newsgroups: gnu.emacs Subject: Re: substituting enscript for lpr Message-ID: <1142@mrsvr.UUCP> Date: 6 Oct 89 15:03:30 GMT References: <27809@shemp.CS.UCLA.EDU> Sender: news@mrsvr.UUCP Reply-To: hallett@gemed.ge.com (Jeffrey A. Hallett (414) 548-5163) Organization: GE Medical Systems, Milwaukee, WI Lines: 28 In article <27809@shemp.CS.UCLA.EDU> wine@retina.cs.ucla.edu (David Wine) writes: >What's the best way to use enscript instead of lpr? >Simply setting lpr-command isn't good enough because >emacs sends along some switches (in print-buffer and >print-region) that enscript doesn't interpret as lpr >does. Simple. You rewrite print-region (since print-buffer just calls print-region) to use enscript rather than lpr. It will look basically like this (with miscellaneous stuff omitted): (defun print-region (start end switches) (let ((width tab-width)) (save-excursion (message "Spooling...") (apply 'call-process-region (nconc (list start end "enscript" nil nil nil (concat "-J\"" (buffer-name) "\"") switches)) (message "Spooling...done")))) -- Jeffrey A. Hallett, PET Software Engineering GE Medical Systems, W641, PO Box 414, Milwaukee, WI 53201 (414) 548-5163 : EMAIL - hallett@gemed.ge.com "Your logic was impeccable Captain. We are in grave danger."