comparison lisp/dos-fns.el @ 19314:860783b225b9

(dos-print-region-function): Force EOL conversion to DOS CR-LF pairs.
author Richard M. Stallman <rms@gnu.org>
date Tue, 12 Aug 1997 05:47:05 +0000
parents 727cf56647a4
children ac1673121774
comparison
equal deleted inserted replaced
19313:04175c55c49b 19314:860783b225b9
137 "MS-DOS-specific function to print the region on a printer. 137 "MS-DOS-specific function to print the region on a printer.
138 Writes the region to the device or file which is a value of 138 Writes the region to the device or file which is a value of
139 `dos-printer' \(which see\). Ignores any arguments beyond 139 `dos-printer' \(which see\). Ignores any arguments beyond
140 START and END." 140 START and END."
141 141
142 (write-region start end dos-printer t 0) 142 ;; DOS printers need the lines to end with CR-LF pairs, so make
143 ;; Make each print-out start on a new page, but don't waste 143 ;; sure it always happens that way.
144 ;; paper if there was a form-feed at the end of this file. 144 (let ((coding-system-for-write 'undecided-dos))
145 (if (not (char-equal (char-after (1- end)) ?\C-l)) 145 (write-region start end dos-printer t 0)
146 (write-region "\f" nil dos-printer t 0))) 146 ;; Make each print-out start on a new page, but don't waste
147 ;; paper if there was a form-feed at the end of this file.
148 (if (not (char-equal (char-after (1- end)) ?\C-l))
149 (write-region "\f" nil dos-printer t 0))))
147 150
148 ;; Set this to nil if you have a port of the `lpr' program and 151 ;; Set this to nil if you have a port of the `lpr' program and
149 ;; you want to use it for printing. If the default setting is 152 ;; you want to use it for printing. If the default setting is
150 ;; in effect, `lpr-command' and its switches are ignored when 153 ;; in effect, `lpr-command' and its switches are ignored when
151 ;; printing with `lpr-xxx' and `print-xxx'. 154 ;; printing with `lpr-xxx' and `print-xxx'.