diff options
author | Eli Zaretskii <eliz@gnu.org> | 1998-04-15 15:10:03 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 1998-04-15 15:10:03 +0000 |
commit | 08160b08aca60768b21bffa9c943f798e2d8b4c3 (patch) | |
tree | feef1b07b70aa863d392f228da862b9242baeac1 /lisp/dos-fns.el | |
parent | 0b61968932a7d3424ad716a048abc71259092b09 (diff) | |
download | emacs-08160b08aca60768b21bffa9c943f798e2d8b4c3.tar.gz |
(dos-print-region-function): Except for binary files,
force conversion to DOS EOLs, but leave text conversions alone.
Diffstat (limited to 'lisp/dos-fns.el')
-rw-r--r-- | lisp/dos-fns.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el index 2ecdea4668e..4293ecbc939 100644 --- a/lisp/dos-fns.el +++ b/lisp/dos-fns.el @@ -148,8 +148,14 @@ Writes the region to the device or file which is a value of START and END." ;; 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)) + ;; sure it always happens that way, unless the buffer is binary. + (let* ((coding coding-system-for-write) + (coding-base + (if (null coding) 'undecided (coding-system-base coding))) + (eol-type (coding-system-eol-type coding-base))) + (or (eq coding-system-for-write 'no-conversion) + (setq coding-system-for-write + (aref eol-type 1))) ; force conversion to DOS EOLs (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. |