aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-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.
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.