diff options
| author | Eli Zaretskii | 1999-02-22 13:37:10 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 1999-02-22 13:37:10 +0000 |
| commit | 504737d5f65ef070bac4ed9787e23acb52cb032d (patch) | |
| tree | be1853a09ac96142562ca0cb6430f00305250057 | |
| parent | 69bd9c93b7933665aade4c07f92b60003979ffd2 (diff) | |
| download | emacs-504737d5f65ef070bac4ed9787e23acb52cb032d.tar.gz emacs-504737d5f65ef070bac4ed9787e23acb52cb032d.zip | |
(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.
| -rw-r--r-- | lisp/play/handwrite.el | 15 |
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 @@ | |||
| 1 | ;;; handwrite.el --- turns your emacs buffer into a handwritten document. | 1 | ;;; handwrite.el --- turns your emacs buffer into a handwritten document -*- coding: iso-latin-1; -*- |
| 2 | 2 | ||
| 3 | ;; (C) Copyright 1996 Free Software Foundation, Inc. | 3 | ;; (C) Copyright 1996 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -330,8 +330,17 @@ Variables: handwrite-linespace (default 12) | |||
| 330 | (replace-match "" nil t) ) | 330 | (replace-match "" nil t) ) |
| 331 | (untabify textp (point-max)) ; this may result in strange tabs | 331 | (untabify textp (point-max)) ; this may result in strange tabs |
| 332 | (if (y-or-n-p "Send this to the printer? ") | 332 | (if (y-or-n-p "Send this to the printer? ") |
| 333 | (call-process-region (point-min) | 333 | (progn |
| 334 | (point-max) lpr-command nil nil nil)) | 334 | (require 'ps-print) |
| 335 | (let* ((coding-system-for-write 'raw-text-unix) | ||
| 336 | (ps-printer-name (or ps-printer-name | ||
| 337 | (and (boundp 'printer-name) | ||
| 338 | printer-name))) | ||
| 339 | (ps-lpr-switches | ||
| 340 | (if (stringp ps-printer-name) | ||
| 341 | (list (concat "-P" ps-printer-name))))) | ||
| 342 | (apply (or ps-print-region-function 'call-process-region) | ||
| 343 | (point-min) (point-max) ps-lpr-command nil nil nil)))) | ||
| 335 | (message "") | 344 | (message "") |
| 336 | (bury-buffer ()) | 345 | (bury-buffer ()) |
| 337 | (switch-to-buffer cur-buf) | 346 | (switch-to-buffer cur-buf) |