diff options
| author | Richard M. Stallman | 1995-11-20 05:33:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-11-20 05:33:16 +0000 |
| commit | 576e92ae3a7a1074e415907f5f8a180a31f6744c (patch) | |
| tree | f6a12a40ea78482f615de50a2d2c82e5f7b95d97 | |
| parent | 0d43a5d9ec3d815dc6a9e2058a6b6c3c14fcee37 (diff) | |
| download | emacs-576e92ae3a7a1074e415907f5f8a180a31f6744c.tar.gz emacs-576e92ae3a7a1074e415907f5f8a180a31f6744c.zip | |
(hexl-mode): Set require-final-newline to nil.
If point was at end of buffer, move it back one byte.
| -rw-r--r-- | lisp/hexl.el | 7 |
1 files 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. | |||
| 182 | (make-local-variable 'change-major-mode-hook) | 182 | (make-local-variable 'change-major-mode-hook) |
| 183 | (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer) | 183 | (add-hook 'change-major-mode-hook 'hexl-maybe-dehexlify-buffer) |
| 184 | 184 | ||
| 185 | (make-local-variable 'require-final-newline) | ||
| 186 | (setq require-final-newline nil) | ||
| 187 | |||
| 185 | (let ((modified (buffer-modified-p)) | 188 | (let ((modified (buffer-modified-p)) |
| 186 | (inhibit-read-only t) | 189 | (inhibit-read-only t) |
| 187 | (original-point (1- (point)))) | 190 | (original-point (1- (point)))) |
| 191 | (and (eobp) (not (bobp)) | ||
| 192 | (setq original-point (1- original-point))) | ||
| 188 | (if (not (or (eq arg 1) (not arg))) | 193 | (if (not (or (eq arg 1) (not arg))) |
| 189 | ;; if no argument then we guess at hexl-max-address | 194 | ;; if no argument then we guess at hexl-max-address |
| 190 | (setq hexl-max-address (+ (* (/ (1- (buffer-size)) 68) 16) 15)) | 195 | (setq hexl-max-address (+ (* (/ (1- (buffer-size)) 68) 16) 15)) |
| @@ -292,7 +297,6 @@ Ask the user for confirmation." | |||
| 292 | 297 | ||
| 293 | (defun hexl-goto-address (address) | 298 | (defun hexl-goto-address (address) |
| 294 | "Goto hexl-mode (decimal) address ADDRESS. | 299 | "Goto hexl-mode (decimal) address ADDRESS. |
| 295 | |||
| 296 | Signal error if ADDRESS out of range." | 300 | Signal error if ADDRESS out of range." |
| 297 | (interactive "nAddress: ") | 301 | (interactive "nAddress: ") |
| 298 | (if (or (< address 0) (> address hexl-max-address)) | 302 | (if (or (< address 0) (> address hexl-max-address)) |
| @@ -301,7 +305,6 @@ Signal error if ADDRESS out of range." | |||
| 301 | 305 | ||
| 302 | (defun hexl-goto-hex-address (hex-address) | 306 | (defun hexl-goto-hex-address (hex-address) |
| 303 | "Go to hexl-mode address (hex string) HEX-ADDRESS. | 307 | "Go to hexl-mode address (hex string) HEX-ADDRESS. |
| 304 | |||
| 305 | Signal error if HEX-ADDRESS is out of range." | 308 | Signal error if HEX-ADDRESS is out of range." |
| 306 | (interactive "sHex Address: ") | 309 | (interactive "sHex Address: ") |
| 307 | (hexl-goto-address (hexl-hex-string-to-integer hex-address))) | 310 | (hexl-goto-address (hexl-hex-string-to-integer hex-address))) |