Commit 059c2e18 authored by Phillip Rulon's avatar Phillip Rulon
Browse files

* 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.
parent 657f51c4
...@@ -251,6 +251,7 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode. ...@@ -251,6 +251,7 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode.
(run-hooks 'hexl-mode-hook)) (run-hooks 'hexl-mode-hook))
(defun hexl-after-revert-hook () (defun hexl-after-revert-hook ()
(setq hexl-max-address (1- (buffer-size)))
(hexlify-buffer) (hexlify-buffer)
(set-buffer-modified-p nil)) (set-buffer-modified-p nil))
...@@ -349,7 +350,7 @@ Ask the user for confirmation." ...@@ -349,7 +350,7 @@ Ask the user for confirmation."
hexl-address)) hexl-address))
(defun hexl-address-to-marker (address) (defun hexl-address-to-marker (address)
"Return marker for ADDRESS." "Return buffer position for ADDRESS."
(interactive "nAddress: ") (interactive "nAddress: ")
(+ (* (/ address 16) 68) 11 (/ (* (% address 16) 5) 2))) (+ (* (/ address 16) 68) 11 (/ (* (% address 16) 5) 2)))
...@@ -611,7 +612,9 @@ This discards the buffer's undo information." ...@@ -611,7 +612,9 @@ This discards the buffer's undo information."
'raw-text-unix) 'raw-text-unix)
(t 'no-conversion)))) (t 'no-conversion))))
(buffer-undo-list t)) (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 () (defun dehexlify-buffer ()
"Convert a hexl format buffer to binary. "Convert a hexl format buffer to binary.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment