diff options
| author | Richard M. Stallman <rms@gnu.org> | 1992-08-31 20:22:03 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1992-08-31 20:22:03 +0000 |
| commit | 616ed245e9bc6cca7fb41575193ac6dcf5ea422e (patch) | |
| tree | 0116ee2c2494f9eeedcae9cd20cbd365e692b287 /lisp | |
| parent | e4790daa39c2f368b2b7365043e74ddc63048e9b (diff) | |
| download | emacs-616ed245e9bc6cca7fb41575193ac6dcf5ea422e.tar.gz | |
*** empty log message ***
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/simple.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 69414a3cb11..3499fbd5549 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -22,15 +22,17 @@ (defun open-line (arg) "Insert a newline and leave point before it. -If there is a fill prefix, insert the fill prefix after the newline -that it inserts. With arg N, insert N newlines." +If there is a fill prefix, insert the fill prefix on the new line +if the line would have been empty. +With arg N, insert N newlines." (interactive "*p") - (let ((flag (and (bolp) (not (bobp))))) + (let* ((do-fill-prefix (and fill-prefix (bolp))) + (flag (and (null do-fill-prefix) (bolp) (not (bobp))))) (if flag (forward-char -1)) (while (> arg 0) (save-excursion - (insert ?\n) - (if fill-prefix (insert fill-prefix))) + (insert ?\n)) + (if do-fill-prefix (insert fill-prefix)) (setq arg (1- arg))) (if flag (forward-char 1)))) |
