# HG changeset patch # User Richard M. Stallman # Date 874015995 0 # Node ID 3b008d891adb835d6cdc13282333f520caf0c42a # Parent d3df4031537803f703c5ba52802c49aa43a2b5c4 (hexlify-buffer): Bind coding-system-for-write to raw-text with eol-type derived from the buffer-file-coding-system. diff -r d3df40315378 -r 3b008d891adb lisp/hexl.el --- a/lisp/hexl.el Thu Sep 11 19:05:59 1997 +0000 +++ b/lisp/hexl.el Thu Sep 11 22:13:15 1997 +0000 @@ -579,7 +579,17 @@ (setq buffer-undo-list nil) (let ((binary-process-output nil) ; for Ms-Dos (binary-process-input buffer-file-type) - (coding-system-for-write 'no-conversion) + ;; If the buffer was read with EOL conversions, be sure to use the + ;; same conversions when passing the region to the `hexl' program. + (coding-system-for-write + (let ((eol-type (coding-system-eol-type buffer-file-coding-system))) + (cond ((eq eol-type 1) + 'raw-text-dos) + ((eq eol-type 2) + 'raw-text-mac) + ((eq eol-type 0) + 'raw-text-unix) + (t 'no-conversion)))) (buffer-undo-list t)) (shell-command-on-region (point-min) (point-max) hexlify-command t))) @@ -593,7 +603,7 @@ (setq buffer-undo-list nil) (let ((binary-process-output buffer-file-type) ; for Ms-Dos (binary-process-input nil) - (coding-system-for-read 'no-conversion) + (coding-system-for-read 'raw-text) (buffer-undo-list t)) (shell-command-on-region (point-min) (point-max) dehexlify-command t)))