summaryrefslogtreecommitdiff
path: root/lisp/play/handwrite.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>1999-02-22 13:37:10 +0000
committerEli Zaretskii <eliz@gnu.org>1999-02-22 13:37:10 +0000
commit504737d5f65ef070bac4ed9787e23acb52cb032d (patch)
treebe1853a09ac96142562ca0cb6430f00305250057 /lisp/play/handwrite.el
parent69bd9c93b7933665aade4c07f92b60003979ffd2 (diff)
downloademacs-504737d5f65ef070bac4ed9787e23acb52cb032d.tar.gz
(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.
Diffstat (limited to 'lisp/play/handwrite.el')
-rw-r--r--lisp/play/handwrite.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el
index 758293acf74..e2e61f16fd3 100644
--- a/lisp/play/handwrite.el
+++ b/lisp/play/handwrite.el
@@ -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)