Commit 504737d5 authored by Eli Zaretskii's avatar Eli Zaretskii

(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.
parent 69bd9c93
;;; 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment