aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2002-12-02 16:19:52 +0000
committerRichard M. Stallman <[email protected]>2002-12-02 16:19:52 +0000
commitf601aaf8f8a8d8a1a6899e526a5b4814c4e70335 (patch)
tree169e71c9b57f4589b8dee2b72898c19f26338be4 /lisp
parent15c064363c828cbf12172ad19905f1c29bd2cfb7 (diff)
(fill-indent-to-left-margin): New function.
(fill-newline, fill-region-as-paragraph): Use that.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/fill.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 727e8e1d13..f5712cc0bb 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -540,13 +540,19 @@ The break position will be always after LINEBEG and generally before point."
'(invisible t)))
(if (or fill-prefix
(not fill-indent-according-to-mode))
- (indent-to-left-margin)
+ (fill-indent-to-left-margin)
(indent-according-to-mode))
;; Insert the fill prefix after indentation.
;; Set prefixcol so whitespace in the prefix won't get lost.
(and fill-prefix (not (equal fill-prefix ""))
(insert-and-inherit fill-prefix)))
+(defun fill-indent-to-left-margin ()
+ "Indent current line to the column given by `current-left-margin'."
+ (let ((beg (point)))
+ (indent-line-to (current-left-margin))
+ (put-text-property beg (point) 'face 'default)))
+
(defun fill-region-as-paragraph (from to &optional justify
nosqueeze squeeze-after)
"Fill the region as one paragraph.
@@ -631,7 +637,7 @@ space does not end a sentence, so don't break a line there."
(while (< (point) to)
(if (and (not (eolp))
(< (current-indentation) (current-left-margin)))
- (indent-to-left-margin))
+ (fill-indent-to-left-margin))
(forward-line 1)))
(if use-hard-newlines
@@ -639,7 +645,7 @@ space does not end a sentence, so don't break a line there."
;; Make sure first line is indented (at least) to left margin...
(if (or (memq justify '(right center))
(< (current-indentation) (current-left-margin)))
- (indent-to-left-margin))
+ (fill-indent-to-left-margin))
;; Delete the fill-prefix from every line.
(fill-delete-prefix from to fill-prefix)
(setq from (point))