diff options
| author | Richard M. Stallman | 1996-04-03 17:22:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-04-03 17:22:11 +0000 |
| commit | aa3757b85f2d31eee0c0c40f99d252854e2417cc (patch) | |
| tree | 726e58d1a3dcc44f8e841f4bf22b9c3628c039c2 | |
| parent | 4e2f59f652ebb37f67de4ca51a1e372504226da1 (diff) | |
| download | emacs-aa3757b85f2d31eee0c0c40f99d252854e2417cc.tar.gz emacs-aa3757b85f2d31eee0c0c40f99d252854e2417cc.zip | |
(hexlify-buffer, dehexlify-buffer): Clear out the undo
info, and don't record undo info for the conversion.
| -rw-r--r-- | lisp/hexl.el | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el index 9cf768248c3..d804d5b514f 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el | |||
| @@ -554,17 +554,29 @@ You may also type up to 3 octal digits, to insert a character with that code" | |||
| 554 | 554 | ||
| 555 | ;;;###autoload | 555 | ;;;###autoload |
| 556 | (defun hexlify-buffer () | 556 | (defun hexlify-buffer () |
| 557 | "Convert a binary buffer to hexl format." | 557 | "Convert a binary buffer to hexl format. |
| 558 | This discards the buffer's undo information." | ||
| 558 | (interactive) | 559 | (interactive) |
| 560 | (and buffer-undo-list | ||
| 561 | (or (y-or-n-p "Converting to hexl format discards undo info; ok? ") | ||
| 562 | (error "Aborted"))) | ||
| 563 | (setq buffer-undo-list nil) | ||
| 559 | (let ((binary-process-output nil) ; for Ms-Dos | 564 | (let ((binary-process-output nil) ; for Ms-Dos |
| 560 | (binary-process-input t)) | 565 | (binary-process-input t) |
| 566 | (buffer-undo-list t)) | ||
| 561 | (shell-command-on-region (point-min) (point-max) hexlify-command t))) | 567 | (shell-command-on-region (point-min) (point-max) hexlify-command t))) |
| 562 | 568 | ||
| 563 | (defun dehexlify-buffer () | 569 | (defun dehexlify-buffer () |
| 564 | "Convert a hexl format buffer to binary." | 570 | "Convert a hexl format buffer to binary. |
| 571 | This discards the buffer's undo information." | ||
| 565 | (interactive) | 572 | (interactive) |
| 573 | (and buffer-undo-list | ||
| 574 | (or (y-or-n-p "Converting from hexl format discards undo info; ok? ") | ||
| 575 | (error "Aborted"))) | ||
| 576 | (setq buffer-undo-list nil) | ||
| 566 | (let ((binary-process-output t) ; for Ms-Dos | 577 | (let ((binary-process-output t) ; for Ms-Dos |
| 567 | (binary-process-input nil)) | 578 | (binary-process-input nil) |
| 579 | (buffer-undo-list t)) | ||
| 568 | (shell-command-on-region (point-min) (point-max) dehexlify-command t))) | 580 | (shell-command-on-region (point-min) (point-max) dehexlify-command t))) |
| 569 | 581 | ||
| 570 | (defun hexl-char-after-point () | 582 | (defun hexl-char-after-point () |