From 576e92ae3a7a1074e415907f5f8a180a31f6744c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 20 Nov 1995 05:33:16 +0000 Subject: [PATCH] (hexl-mode): Set require-final-newline to nil. If point was at end of buffer, move it back one byte. --- lisp/hexl.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/hexl.el b/lisp/hexl.el index ce13f52f372..123d23e46d2 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -182,9 +182,14 @@ You can use \\[hexl-find-file] to visit a file in hexl-mode. (make-local-variable 'change-major-mode-hook) (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer) + (make-local-variable 'require-final-newline) + (setq require-final-newline nil) + (let ((modified (buffer-modified-p)) (inhibit-read-only t) (original-point (1- (point)))) + (and (eobp) (not (bobp)) + (setq original-point (1- original-point))) (if (not (or (eq arg 1) (not arg))) ;; if no argument then we guess at hexl-max-address (setq hexl-max-address (+ (* (/ (1- (buffer-size)) 68) 16) 15)) @@ -292,7 +297,6 @@ Ask the user for confirmation." (defun hexl-goto-address (address) "Goto hexl-mode (decimal) address ADDRESS. - Signal error if ADDRESS out of range." (interactive "nAddress: ") (if (or (< address 0) (> address hexl-max-address)) @@ -301,7 +305,6 @@ Signal error if ADDRESS out of range." (defun hexl-goto-hex-address (hex-address) "Go to hexl-mode address (hex string) HEX-ADDRESS. - Signal error if HEX-ADDRESS is out of range." (interactive "sHex Address: ") (hexl-goto-address (hexl-hex-string-to-integer hex-address))) -- 2.39.2