summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1992-08-31 20:22:03 +0000
committerRichard M. Stallman <rms@gnu.org>1992-08-31 20:22:03 +0000
commit616ed245e9bc6cca7fb41575193ac6dcf5ea422e (patch)
tree0116ee2c2494f9eeedcae9cd20cbd365e692b287
parente4790daa39c2f368b2b7365043e74ddc63048e9b (diff)
downloademacs-616ed245e9bc6cca7fb41575193ac6dcf5ea422e.tar.gz
*** empty log message ***
-rw-r--r--lisp/simple.el12
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))))