diff options
| author | Richard M. Stallman | 1995-06-27 18:58:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-06-27 18:58:26 +0000 |
| commit | 4cc9d0dcf0632369488c176c4860dad3414752f5 (patch) | |
| tree | 034181e974c93d28668ae9e52aa03a1079a088ae | |
| parent | 9cb2482e93ce66b2e0ff1a551dc208f76ea33429 (diff) | |
| download | emacs-4cc9d0dcf0632369488c176c4860dad3414752f5.tar.gz emacs-4cc9d0dcf0632369488c176c4860dad3414752f5.zip | |
(newline): Put point at right place if insert gets error.
| -rw-r--r-- | lisp/simple.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index abe742152b4..60244e59a4f 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -50,7 +50,12 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long." | |||
| 50 | ;; Also not if flag is true (it would fill wrong line); | 50 | ;; Also not if flag is true (it would fill wrong line); |
| 51 | ;; there is no need to since we're at BOL. | 51 | ;; there is no need to since we're at BOL. |
| 52 | (auto-fill-function (if (or arg flag) nil auto-fill-function))) | 52 | (auto-fill-function (if (or arg flag) nil auto-fill-function))) |
| 53 | (self-insert-command (prefix-numeric-value arg))) | 53 | (unwind-protect |
| 54 | (self-insert-command (prefix-numeric-value arg)) | ||
| 55 | ;; If we get an error in self-insert-command, put point at right place. | ||
| 56 | (if flag (forward-char 1)))) | ||
| 57 | ;; If we did *not* get an error, cancel that forward-char. | ||
| 58 | (if flag (backward-char 1)) | ||
| 54 | ;; Mark the newline(s) `hard'. | 59 | ;; Mark the newline(s) `hard'. |
| 55 | (if use-hard-newlines | 60 | (if use-hard-newlines |
| 56 | (let* ((from (- (point) (if arg (prefix-numeric-value arg) 1))) | 61 | (let* ((from (- (point) (if arg (prefix-numeric-value arg) 1))) |