From: Phillip Rulon Date: Fri, 8 Oct 1999 15:42:32 +0000 (+0000) Subject: * hexl.el (hexlify-buffer): Move point in proper range X-Git-Tag: emacs-pretest-21.0.90~6518 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=059c2e18d12aa6cb1978a2e49dfd55a9ca205c3c;p=emacs.git * 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. --- 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.