summaryrefslogtreecommitdiff
path: root/lisp/hexl.el
diff options
context:
space:
mode:
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.