diff options
author | Eli Zaretskii <[email protected]> | 1998-04-15 14:47:47 +0000 |
---|---|---|
committer | Eli Zaretskii <[email protected]> | 1998-04-15 14:47:47 +0000 |
commit | a749e5e5665925f6ae679cdb6d6d10bbb3de61f6 (patch) | |
tree | bc07b1b076730ce5030f1f374af64242dee4e229 /lisp | |
parent | 7664e30672e716085fe3453753985ffd66882629 (diff) |
(hexlify-buffer, dehexlify-buffer): Don't bind
binary-process-{in,out}put; setup coding-systems instead.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/hexl.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el index a58798e8ca..6872c12d59 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -590,8 +590,8 @@ This discards the buffer's undo information." (or (y-or-n-p "Converting to hexl format discards undo info; ok? ") (error "Aborted"))) (setq buffer-undo-list nil) - (let ((binary-process-output nil) ; for Ms-Dos - (binary-process-input buffer-file-type) + ;; Don't decode text in the ASCII part of `hexl' program output. + (let ((coding-system-for-read 'raw-text) ;; 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 @@ -614,9 +614,16 @@ This discards the buffer's undo information." (or (y-or-n-p "Converting from hexl format discards undo info; ok? ") (error "Aborted"))) (setq buffer-undo-list nil) - (let ((binary-process-output buffer-file-type) ; for Ms-Dos - (binary-process-input nil) - (coding-system-for-read 'raw-text) + (let ((coding-system-for-write 'raw-text) + (coding-system-for-read + (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) dehexlify-command t))) |