diff options
| author | Richard M. Stallman | 1997-09-11 22:13:15 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-09-11 22:13:15 +0000 |
| commit | ce1364815efc5fc861b659cbfb98c7a2b2038ad0 (patch) | |
| tree | 8310c54e64da1d9b4099e865ca44df5ea29bd0f6 | |
| parent | ca6e03c2852f431ee5fc0d4b9e529539024e6eea (diff) | |
| download | emacs-ce1364815efc5fc861b659cbfb98c7a2b2038ad0.tar.gz emacs-ce1364815efc5fc861b659cbfb98c7a2b2038ad0.zip | |
(hexlify-buffer): Bind coding-system-for-write to
raw-text with eol-type derived from the buffer-file-coding-system.
| -rw-r--r-- | lisp/hexl.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el index 990d6f476fa..daa4dc79c9c 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el | |||
| @@ -579,7 +579,17 @@ This discards the buffer's undo information." | |||
| 579 | (setq buffer-undo-list nil) | 579 | (setq buffer-undo-list nil) |
| 580 | (let ((binary-process-output nil) ; for Ms-Dos | 580 | (let ((binary-process-output nil) ; for Ms-Dos |
| 581 | (binary-process-input buffer-file-type) | 581 | (binary-process-input buffer-file-type) |
| 582 | (coding-system-for-write 'no-conversion) | 582 | ;; If the buffer was read with EOL conversions, be sure to use the |
| 583 | ;; same conversions when passing the region to the `hexl' program. | ||
| 584 | (coding-system-for-write | ||
| 585 | (let ((eol-type (coding-system-eol-type buffer-file-coding-system))) | ||
| 586 | (cond ((eq eol-type 1) | ||
| 587 | 'raw-text-dos) | ||
| 588 | ((eq eol-type 2) | ||
| 589 | 'raw-text-mac) | ||
| 590 | ((eq eol-type 0) | ||
| 591 | 'raw-text-unix) | ||
| 592 | (t 'no-conversion)))) | ||
| 583 | (buffer-undo-list t)) | 593 | (buffer-undo-list t)) |
| 584 | (shell-command-on-region (point-min) (point-max) hexlify-command t))) | 594 | (shell-command-on-region (point-min) (point-max) hexlify-command t))) |
| 585 | 595 | ||
| @@ -593,7 +603,7 @@ This discards the buffer's undo information." | |||
| 593 | (setq buffer-undo-list nil) | 603 | (setq buffer-undo-list nil) |
| 594 | (let ((binary-process-output buffer-file-type) ; for Ms-Dos | 604 | (let ((binary-process-output buffer-file-type) ; for Ms-Dos |
| 595 | (binary-process-input nil) | 605 | (binary-process-input nil) |
| 596 | (coding-system-for-read 'no-conversion) | 606 | (coding-system-for-read 'raw-text) |
| 597 | (buffer-undo-list t)) | 607 | (buffer-undo-list t)) |
| 598 | (shell-command-on-region (point-min) (point-max) dehexlify-command t))) | 608 | (shell-command-on-region (point-min) (point-max) dehexlify-command t))) |
| 599 | 609 | ||