summaryrefslogtreecommitdiff
path: root/lisp/hexl.el
diff options
context:
space:
mode:
authorPhillip Rulon <pjr@gnu.org>1999-10-08 15:42:32 +0000
committerPhillip Rulon <pjr@gnu.org>1999-10-08 15:42:32 +0000
commit059c2e18d12aa6cb1978a2e49dfd55a9ca205c3c (patch)
tree0567fb9a7766a242708c8d6ae30706ddd89f0285 /lisp/hexl.el
parent657f51c4d655ebd71e18564625e53c356fef3619 (diff)
downloademacs-059c2e18d12aa6cb1978a2e49dfd55a9ca205c3c.tar.gz
* 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.el7
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.
(run-hooks 'hexl-mode-hook))
(defun hexl-after-revert-hook ()
+ (setq hexl-max-address (1- (buffer-size)))
(hexlify-buffer)
(set-buffer-modified-p nil))
@@ -349,7 +350,7 @@ Ask the user for confirmation."
hexl-address))
(defun hexl-address-to-marker (address)
- "Return marker for ADDRESS."
+ "Return buffer position for ADDRESS."
(interactive "nAddress: ")
(+ (* (/ address 16) 68) 11 (/ (* (% address 16) 5) 2)))
@@ -611,7 +612,9 @@ This discards the buffer's undo information."
'raw-text-unix)
(t 'no-conversion))))
(buffer-undo-list t))
- (shell-command-on-region (point-min) (point-max) hexlify-command t)))
+ (shell-command-on-region (point-min) (point-max) hexlify-command t)
+ (if (> (point) (hexl-address-to-marker hexl-max-address))
+ (hexl-goto-address hexl-max-address))))
(defun dehexlify-buffer ()
"Convert a hexl format buffer to binary.