Mercurial > emacs
changeset 48621:2cf7301b2f52
(fill-indent-to-left-margin): New function.
(fill-newline, fill-region-as-paragraph): Use that.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 02 Dec 2002 16:19:52 +0000 |
parents | 37b9b1f18615 |
children | 759019dacc3f |
files | lisp/textmodes/fill.el |
diffstat | 1 files changed, 9 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/textmodes/fill.el Mon Dec 02 16:18:33 2002 +0000 +++ b/lisp/textmodes/fill.el Mon Dec 02 16:19:52 2002 +0000 @@ -540,13 +540,19 @@ '(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 @@ (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 @@ ;; 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))