diff options
| author | Phillip Rulon | 1999-10-08 15:42:32 +0000 |
|---|---|---|
| committer | Phillip Rulon | 1999-10-08 15:42:32 +0000 |
| commit | 059c2e18d12aa6cb1978a2e49dfd55a9ca205c3c (patch) | |
| tree | 0567fb9a7766a242708c8d6ae30706ddd89f0285 /lisp/hexl.el | |
| parent | 657f51c4d655ebd71e18564625e53c356fef3619 (diff) | |
| download | emacs-059c2e18d12aa6cb1978a2e49dfd55a9ca205c3c.tar.gz emacs-059c2e18d12aa6cb1978a2e49dfd55a9ca205c3c.zip | |
* hexl.el (hexlify-buffer): Move point in proper range
if it is too large.
(hexl-after-revert-hook): Update hexl-max-address.
(hexl-address-to-marker): Doc fix.
Diffstat (limited to 'lisp/hexl.el')
| -rw-r--r-- | lisp/hexl.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/hexl.el b/lisp/hexl.el index e4c80c68c79..4a5d12c28e9 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el | |||
| @@ -251,6 +251,7 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode. | |||
| 251 | (run-hooks 'hexl-mode-hook)) | 251 | (run-hooks 'hexl-mode-hook)) |
| 252 | 252 | ||
| 253 | (defun hexl-after-revert-hook () | 253 | (defun hexl-after-revert-hook () |
| 254 | (setq hexl-max-address (1- (buffer-size))) | ||
| 254 | (hexlify-buffer) | 255 | (hexlify-buffer) |
| 255 | (set-buffer-modified-p nil)) | 256 | (set-buffer-modified-p nil)) |
| 256 | 257 | ||
| @@ -349,7 +350,7 @@ Ask the user for confirmation." | |||
| 349 | hexl-address)) | 350 | hexl-address)) |
| 350 | 351 | ||
| 351 | (defun hexl-address-to-marker (address) | 352 | (defun hexl-address-to-marker (address) |
| 352 | "Return marker for ADDRESS." | 353 | "Return buffer position for ADDRESS." |
| 353 | (interactive "nAddress: ") | 354 | (interactive "nAddress: ") |
| 354 | (+ (* (/ address 16) 68) 11 (/ (* (% address 16) 5) 2))) | 355 | (+ (* (/ address 16) 68) 11 (/ (* (% address 16) 5) 2))) |
| 355 | 356 | ||
| @@ -611,7 +612,9 @@ This discards the buffer's undo information." | |||
| 611 | 'raw-text-unix) | 612 | 'raw-text-unix) |
| 612 | (t 'no-conversion)))) | 613 | (t 'no-conversion)))) |
| 613 | (buffer-undo-list t)) | 614 | (buffer-undo-list t)) |
| 614 | (shell-command-on-region (point-min) (point-max) hexlify-command t))) | 615 | (shell-command-on-region (point-min) (point-max) hexlify-command t) |
| 616 | (if (> (point) (hexl-address-to-marker hexl-max-address)) | ||
| 617 | (hexl-goto-address hexl-max-address)))) | ||
| 615 | 618 | ||
| 616 | (defun dehexlify-buffer () | 619 | (defun dehexlify-buffer () |
| 617 | "Convert a hexl format buffer to binary. | 620 | "Convert a hexl format buffer to binary. |