# HG changeset patch # User Eli Zaretskii # Date 919690630 0 # Node ID 6ef51f9beabc21541786c0ebc7cc1d2d6fe1426c # Parent 18002ef8ce0da0d9888bdf175a12c3b4baccb62c (handwrite): Require ps-print, and use ps-printer-name and ps-lpr-command. Call ps-print-region-function if it's defined, instead of forking ps-lpr-command unconditionally. diff -r 18002ef8ce0d -r 6ef51f9beabc lisp/play/handwrite.el --- a/lisp/play/handwrite.el Mon Feb 22 12:46:52 1999 +0000 +++ b/lisp/play/handwrite.el Mon Feb 22 13:37:10 1999 +0000 @@ -1,4 +1,4 @@ -;;; handwrite.el --- turns your emacs buffer into a handwritten document. +;;; handwrite.el --- turns your emacs buffer into a handwritten document -*- coding: iso-latin-1; -*- ;; (C) Copyright 1996 Free Software Foundation, Inc. @@ -330,8 +330,17 @@ (replace-match "" nil t) ) (untabify textp (point-max)) ; this may result in strange tabs (if (y-or-n-p "Send this to the printer? ") - (call-process-region (point-min) - (point-max) lpr-command nil nil nil)) + (progn + (require 'ps-print) + (let* ((coding-system-for-write 'raw-text-unix) + (ps-printer-name (or ps-printer-name + (and (boundp 'printer-name) + printer-name))) + (ps-lpr-switches + (if (stringp ps-printer-name) + (list (concat "-P" ps-printer-name))))) + (apply (or ps-print-region-function 'call-process-region) + (point-min) (point-max) ps-lpr-command nil nil nil)))) (message "") (bury-buffer ()) (switch-to-buffer cur-buf)