aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Goldowsky1995-02-23 18:38:42 +0000
committerBoris Goldowsky1995-02-23 18:38:42 +0000
commit3db1e3b5d69fac6b0ac6da61237eb277049a7729 (patch)
treeb50a951151f65613645b4c1000534a26d00ddade
parent34c3f2b8d9037d24d2f0af21926f8b478f7d9702 (diff)
downloademacs-3db1e3b5d69fac6b0ac6da61237eb277049a7729.tar.gz
emacs-3db1e3b5d69fac6b0ac6da61237eb277049a7729.zip
(open-line): indent when inserting fil-prefix.
(do-auto-fill): Use unjustify-current-line when necessary. (indent-new-comment-line): Indent before fill-prefix.
-rw-r--r--lisp/simple.el20
1 files changed, 9 insertions, 11 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 194c9740cac..1a4a245af19 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -27,13 +27,15 @@
27 27
28(defun open-line (arg) 28(defun open-line (arg)
29 "Insert a newline and leave point before it. 29 "Insert a newline and leave point before it.
30If there is a fill prefix, insert the fill prefix on the new line 30If there is a fill prefix and/or a left-margin, insert them on the new line
31if the line would have been empty. 31if the line would have been empty.
32With arg N, insert N newlines." 32With arg N, insert N newlines."
33 (interactive "*p") 33 (interactive "*p")
34 (let* ((do-fill-prefix (and fill-prefix (bolp))) 34 (let* ((do-fill-prefix (and fill-prefix (bolp)))
35 (do-left-margin (and (bolp) (> (current-left-margin) 0)))
35 (loc (point))) 36 (loc (point)))
36 (while (> arg 0) 37 (while (> arg 0)
38 (if do-left-margin (indent-to (current-left-margin)))
37 (if do-fill-prefix (insert-and-inherit fill-prefix)) 39 (if do-fill-prefix (insert-and-inherit fill-prefix))
38 (newline 1) 40 (newline 1)
39 (setq arg (1- arg))) 41 (setq arg (1- arg)))
@@ -2185,13 +2187,8 @@ Setting this variable automatically makes it local to the current buffer.")
2185 (and auto-fill-inhibit-regexp 2187 (and auto-fill-inhibit-regexp
2186 (looking-at auto-fill-inhibit-regexp)))) 2188 (looking-at auto-fill-inhibit-regexp))))
2187 nil ;; Auto-filling not required 2189 nil ;; Auto-filling not required
2188 ;; Remove justification-introduced whitespace before filling 2190 (if (memq justify '(full center right))
2189 (cond ((eq 'left justify) nil) 2191 (save-excursion (unjustify-current-line)))
2190 ((eq 'full justify) ; full justify: remove extra spaces
2191 (canonically-space-region
2192 (point) (save-excursion (end-of-line) (point))))
2193 ;; right or center justify: remove extra indentation.
2194 (t (save-excursion (indent-according-to-mode))))
2195 (while (and (not give-up) (> (current-column) fc)) 2192 (while (and (not give-up) (> (current-column) fc))
2196 ;; Determine where to split the line. 2193 ;; Determine where to split the line.
2197 (let ((fill-point 2194 (let ((fill-point
@@ -2359,9 +2356,10 @@ unless optional argument SOFT is non-nil."
2359 ;; Make sure we delete the newline inserted above. 2356 ;; Make sure we delete the newline inserted above.
2360 (end-of-line) 2357 (end-of-line)
2361 (delete-char 1))) 2358 (delete-char 1)))
2362 (if fill-prefix 2359 (if (null fill-prefix)
2363 (insert-and-inherit fill-prefix) 2360 (indent-according-to-mode)
2364 (indent-according-to-mode))))) 2361 (indent-to-left-margin)
2362 (insert-and-inherit fill-prefix)))))
2365 2363
2366(defun set-selective-display (arg) 2364(defun set-selective-display (arg)
2367 "Set `selective-display' to ARG; clear it if no arg. 2365 "Set `selective-display' to ARG; clear it if no arg.