]> git.eshelyaron.com Git - emacs.git/commitdiff
(handwrite): Require ps-print, and use ps-printer-name and
authorEli Zaretskii <eliz@gnu.org>
Mon, 22 Feb 1999 13:37:10 +0000 (13:37 +0000)
committerEli Zaretskii <eliz@gnu.org>
Mon, 22 Feb 1999 13:37:10 +0000 (13:37 +0000)
ps-lpr-command.  Call ps-print-region-function
if it's defined, instead of forking ps-lpr-command
unconditionally.

lisp/play/handwrite.el

index 758293acf74bb0cfdb7ed30b57ddd329acfd149c..e2e61f16fd3bd2faf2c4ae845dbdbec5642fbf80 100644 (file)
@@ -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 @@ Variables: handwrite-linespace     (default 12)
       (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)