aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii1998-04-15 14:47:47 +0000
committerEli Zaretskii1998-04-15 14:47:47 +0000
commita749e5e5665925f6ae679cdb6d6d10bbb3de61f6 (patch)
treebc07b1b076730ce5030f1f374af64242dee4e229
parent7664e30672e716085fe3453753985ffd66882629 (diff)
downloademacs-a749e5e5665925f6ae679cdb6d6d10bbb3de61f6.tar.gz
emacs-a749e5e5665925f6ae679cdb6d6d10bbb3de61f6.zip
(hexlify-buffer, dehexlify-buffer): Don't bind
binary-process-{in,out}put; setup coding-systems instead.
-rw-r--r--lisp/hexl.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el
index a58798e8cae..6872c12d594 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -590,8 +590,8 @@ This discards the buffer's undo information."
590 (or (y-or-n-p "Converting to hexl format discards undo info; ok? ") 590 (or (y-or-n-p "Converting to hexl format discards undo info; ok? ")
591 (error "Aborted"))) 591 (error "Aborted")))
592 (setq buffer-undo-list nil) 592 (setq buffer-undo-list nil)
593 (let ((binary-process-output nil) ; for Ms-Dos 593 ;; Don't decode text in the ASCII part of `hexl' program output.
594 (binary-process-input buffer-file-type) 594 (let ((coding-system-for-read 'raw-text)
595 ;; If the buffer was read with EOL conversions, be sure to use the 595 ;; If the buffer was read with EOL conversions, be sure to use the
596 ;; same conversions when passing the region to the `hexl' program. 596 ;; same conversions when passing the region to the `hexl' program.
597 (coding-system-for-write 597 (coding-system-for-write
@@ -614,9 +614,16 @@ This discards the buffer's undo information."
614 (or (y-or-n-p "Converting from hexl format discards undo info; ok? ") 614 (or (y-or-n-p "Converting from hexl format discards undo info; ok? ")
615 (error "Aborted"))) 615 (error "Aborted")))
616 (setq buffer-undo-list nil) 616 (setq buffer-undo-list nil)
617 (let ((binary-process-output buffer-file-type) ; for Ms-Dos 617 (let ((coding-system-for-write 'raw-text)
618 (binary-process-input nil) 618 (coding-system-for-read
619 (coding-system-for-read 'raw-text) 619 (let ((eol-type (coding-system-eol-type buffer-file-coding-system)))
620 (cond ((eq eol-type 1)
621 'raw-text-dos)
622 ((eq eol-type 2)
623 'raw-text-mac)
624 ((eq eol-type 0)
625 'raw-text-unix)
626 (t 'no-conversion))))
620 (buffer-undo-list t)) 627 (buffer-undo-list t))
621 (shell-command-on-region (point-min) (point-max) dehexlify-command t))) 628 (shell-command-on-region (point-min) (point-max) dehexlify-command t)))
622 629