aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2000-10-11 17:08:28 +0000
committerEli Zaretskii2000-10-11 17:08:28 +0000
commit0716afa2de0cf37d46174fb5f0657d53af9b7471 (patch)
tree739d4f58cb74d50738fdc38b88ac8d47e5253a61
parent5c8b7eaf159b50bd07ded0a4ca153fd78d53867c (diff)
downloademacs-0716afa2de0cf37d46174fb5f0657d53af9b7471.tar.gz
emacs-0716afa2de0cf37d46174fb5f0657d53af9b7471.zip
(hexlify-buffer): Bind coding-system-for-write to
buffer-file-coding-system, instead of raw-text. (dehexlify-buffer): Bind coding-system-for-read to buffer-file-coding-system, instead of raw-text.
-rw-r--r--lisp/hexl.el22
1 files changed, 2 insertions, 20 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el
index aca123a0ade..293226a15d2 100644
--- a/lisp/hexl.el
+++ b/lisp/hexl.el
@@ -600,17 +600,7 @@ This discards the buffer's undo information."
600 (setq buffer-undo-list nil) 600 (setq buffer-undo-list nil)
601 ;; Don't decode text in the ASCII part of `hexl' program output. 601 ;; Don't decode text in the ASCII part of `hexl' program output.
602 (let ((coding-system-for-read 'raw-text) 602 (let ((coding-system-for-read 'raw-text)
603 ;; If the buffer was read with EOL conversions, be sure to use the 603 (coding-system-for-write buffer-file-coding-system)
604 ;; same conversions when passing the region to the `hexl' program.
605 (coding-system-for-write
606 (let ((eol-type (coding-system-eol-type buffer-file-coding-system)))
607 (cond ((eq eol-type 1)
608 'raw-text-dos)
609 ((eq eol-type 2)
610 'raw-text-mac)
611 ((eq eol-type 0)
612 'raw-text-unix)
613 (t 'no-conversion))))
614 (buffer-undo-list t)) 604 (buffer-undo-list t))
615 (shell-command-on-region (point-min) (point-max) hexlify-command t) 605 (shell-command-on-region (point-min) (point-max) hexlify-command t)
616 (if (> (point) (hexl-address-to-marker hexl-max-address)) 606 (if (> (point) (hexl-address-to-marker hexl-max-address))
@@ -625,15 +615,7 @@ This discards the buffer's undo information."
625 (error "Aborted"))) 615 (error "Aborted")))
626 (setq buffer-undo-list nil) 616 (setq buffer-undo-list nil)
627 (let ((coding-system-for-write 'raw-text) 617 (let ((coding-system-for-write 'raw-text)
628 (coding-system-for-read 618 (coding-system-for-read buffer-file-coding-system)
629 (let ((eol-type (coding-system-eol-type buffer-file-coding-system)))
630 (cond ((eq eol-type 1)
631 'raw-text-dos)
632 ((eq eol-type 2)
633 'raw-text-mac)
634 ((eq eol-type 0)
635 'raw-text-unix)
636 (t 'no-conversion))))
637 (buffer-undo-list t)) 619 (buffer-undo-list t))
638 (shell-command-on-region (point-min) (point-max) dehexlify-command t))) 620 (shell-command-on-region (point-min) (point-max) dehexlify-command t)))
639 621