diff options
| author | Richard M. Stallman | 1997-08-04 02:44:42 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-04 02:44:42 +0000 |
| commit | 338992a502d4d51fee5ffb776abc4882ff38b14a (patch) | |
| tree | 525c2033fa708802b5de74e42c13bfa1f50df55c | |
| parent | 8ba1358119b4b264e04691a817d183af89a0ceed (diff) | |
| download | emacs-338992a502d4d51fee5ffb776abc4882ff38b14a.tar.gz emacs-338992a502d4d51fee5ffb776abc4882ff38b14a.zip | |
(hexlify-buffer, dehexlify-buffer):
Pay attention to buffer-file-type.
(hexl-save-buffer): Don't bind buffer-file-type around save-buffer.
| -rw-r--r-- | lisp/hexl.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el index 19de8c04f3b..990d6f476fa 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el | |||
| @@ -255,8 +255,7 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode. | |||
| 255 | (set-buffer name) | 255 | (set-buffer name) |
| 256 | (dehexlify-buffer) | 256 | (dehexlify-buffer) |
| 257 | ;; Prevent infinite recursion. | 257 | ;; Prevent infinite recursion. |
| 258 | (let ((hexl-in-save-buffer t) | 258 | (let ((hexl-in-save-buffer t)) |
| 259 | (buffer-file-type t)) ; for ms-dos | ||
| 260 | (save-buffer)) | 259 | (save-buffer)) |
| 261 | (setq modified (buffer-modified-p)) | 260 | (setq modified (buffer-modified-p)) |
| 262 | (delete-region (point-min) (point-max)) | 261 | (delete-region (point-min) (point-max)) |
| @@ -273,9 +272,7 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode. | |||
| 273 | "Edit file FILENAME in hexl-mode. | 272 | "Edit file FILENAME in hexl-mode. |
| 274 | Switch to a buffer visiting file FILENAME, creating one in none exists." | 273 | Switch to a buffer visiting file FILENAME, creating one in none exists." |
| 275 | (interactive "fFilename: ") | 274 | (interactive "fFilename: ") |
| 276 | (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) | 275 | (find-file-literally filename) |
| 277 | (find-file-binary filename) | ||
| 278 | (find-file filename)) | ||
| 279 | (if (not (eq major-mode 'hexl-mode)) | 276 | (if (not (eq major-mode 'hexl-mode)) |
| 280 | (hexl-mode))) | 277 | (hexl-mode))) |
| 281 | 278 | ||
| @@ -581,7 +578,8 @@ This discards the buffer's undo information." | |||
| 581 | (error "Aborted"))) | 578 | (error "Aborted"))) |
| 582 | (setq buffer-undo-list nil) | 579 | (setq buffer-undo-list nil) |
| 583 | (let ((binary-process-output nil) ; for Ms-Dos | 580 | (let ((binary-process-output nil) ; for Ms-Dos |
| 584 | (binary-process-input t) | 581 | (binary-process-input buffer-file-type) |
| 582 | (coding-system-for-write 'no-conversion) | ||
| 585 | (buffer-undo-list t)) | 583 | (buffer-undo-list t)) |
| 586 | (shell-command-on-region (point-min) (point-max) hexlify-command t))) | 584 | (shell-command-on-region (point-min) (point-max) hexlify-command t))) |
| 587 | 585 | ||
| @@ -593,8 +591,9 @@ This discards the buffer's undo information." | |||
| 593 | (or (y-or-n-p "Converting from hexl format discards undo info; ok? ") | 591 | (or (y-or-n-p "Converting from hexl format discards undo info; ok? ") |
| 594 | (error "Aborted"))) | 592 | (error "Aborted"))) |
| 595 | (setq buffer-undo-list nil) | 593 | (setq buffer-undo-list nil) |
| 596 | (let ((binary-process-output t) ; for Ms-Dos | 594 | (let ((binary-process-output buffer-file-type) ; for Ms-Dos |
| 597 | (binary-process-input nil) | 595 | (binary-process-input nil) |
| 596 | (coding-system-for-read 'no-conversion) | ||
| 598 | (buffer-undo-list t)) | 597 | (buffer-undo-list t)) |
| 599 | (shell-command-on-region (point-min) (point-max) dehexlify-command t))) | 598 | (shell-command-on-region (point-min) (point-max) dehexlify-command t))) |
| 600 | 599 | ||