changeset 25927:776bf3692d9d

* 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.
author Phillip Rulon <pjr@gnu.org>
date Fri, 08 Oct 1999 15:42:32 +0000
parents 21ae9c3947c9
children bd1d7d04426c
files lisp/hexl.el
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/hexl.el	Fri Oct 08 15:39:20 1999 +0000
+++ b/lisp/hexl.el	Fri Oct 08 15:42:32 1999 +0000
@@ -251,6 +251,7 @@
   (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 @@
     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 @@
 		  '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.