summaryrefslogtreecommitdiff
path: root/lisp/dos-fns.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-08-12 05:47:05 +0000
committerRichard M. Stallman <rms@gnu.org>1997-08-12 05:47:05 +0000
commit7c96c058a6c1bbfc516d6f49fefd714f5bdab754 (patch)
treece8195a687459bd00e8429cbbb55676f7f1f4cc7 /lisp/dos-fns.el
parent0cdbb11dee301e1537bcdab1f4ae53f2515db274 (diff)
downloademacs-7c96c058a6c1bbfc516d6f49fefd714f5bdab754.tar.gz
(dos-print-region-function): Force EOL conversion to DOS CR-LF pairs.
Diffstat (limited to 'lisp/dos-fns.el')
-rw-r--r--lisp/dos-fns.el13
1 files changed, 8 insertions, 5 deletions
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el
index c640633000c..e3ae53bd070 100644
--- a/lisp/dos-fns.el
+++ b/lisp/dos-fns.el
@@ -139,11 +139,14 @@ Writes the region to the device or file which is a value of
`dos-printer' \(which see\). Ignores any arguments beyond
START and END."
- (write-region start end dos-printer t 0)
- ;; Make each print-out start on a new page, but don't waste
- ;; paper if there was a form-feed at the end of this file.
- (if (not (char-equal (char-after (1- end)) ?\C-l))
- (write-region "\f" nil dos-printer t 0)))
+ ;; DOS printers need the lines to end with CR-LF pairs, so make
+ ;; sure it always happens that way.
+ (let ((coding-system-for-write 'undecided-dos))
+ (write-region start end dos-printer t 0)
+ ;; Make each print-out start on a new page, but don't waste
+ ;; paper if there was a form-feed at the end of this file.
+ (if (not (char-equal (char-after (1- end)) ?\C-l))
+ (write-region "\f" nil dos-printer t 0))))
;; Set this to nil if you have a port of the `lpr' program and
;; you want to use it for printing. If the default setting is