diff options
author | Karl Heuer <kwzh@gnu.org> | 1998-04-09 20:05:58 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1998-04-09 20:05:58 +0000 |
commit | 2f047f6c3a80e3eb9f325a745d51974c218e7ca3 (patch) | |
tree | 8617a30eea6f23009d0725b5d97f857ca3beeadc /lisp/simple.el | |
parent | 34e4751f89aaa88a682924a755656ba40c017c20 (diff) | |
download | emacs-2f047f6c3a80e3eb9f325a745d51974c218e7ca3.tar.gz |
(newline): Mark as hard the newline that was just
typed, not the previous one. Suppress optimization if there's a
marker either before or after the newline.
Diffstat (limited to 'lisp/simple.el')
-rw-r--r-- | lisp/simple.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index ea2e91d5a85..1f547861886 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -62,6 +62,7 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long." (not before-change-functions) ;; Make sure there are no markers here. (not (buffer-has-markers-at (1- (point)))) + (not (buffer-has-markers-at (point))) ;; Make sure no text properties want to know ;; where the change was. (not (get-char-property (1- (point)) 'modification-hooks)) @@ -93,11 +94,13 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long." (self-insert-command (prefix-numeric-value arg)) ;; If we get an error in self-insert-command, put point at right place. (if flag (forward-char 1)))) - ;; If we did *not* get an error, cancel that forward-char. - (if flag (backward-char 1)) + ;; Even if we did *not* get an error, keep that forward-char; + ;; all further processing should apply to the newline that the user + ;; thinks he inserted. + ;; Mark the newline(s) `hard'. (if use-hard-newlines - (set-hard-newline-properties + (set-hard-newline-properties (- (point) (if arg (prefix-numeric-value arg) 1)) (point))) ;; If the newline leaves the previous line blank, ;; and we have a left margin, delete that from the blank line. @@ -108,7 +111,6 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long." (and (looking-at "[ \t]$") (> (current-left-margin) 0) (delete-region (point) (progn (end-of-line) (point)))))) - (if flag (forward-char 1)) ;; Indent the line after the newline, except in one case: ;; when we added the newline at the beginning of a line ;; which starts a page. |