aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-04-02 00:11:19 +0000
committerRichard M. Stallman1995-04-02 00:11:19 +0000
commit24aac19dbb7230a7a395ace89f2f700ea743bce1 (patch)
treed6d0f7cca38fc68b57fe70b0fb4b4aaadfc23087
parentefde113229106bb98b96855f71169eadab3426a4 (diff)
downloademacs-24aac19dbb7230a7a395ace89f2f700ea743bce1.tar.gz
emacs-24aac19dbb7230a7a395ace89f2f700ea743bce1.zip
(fill-region-as-paragraph): Remove fill-prefix first, then remove indentation.
-rw-r--r--lisp/textmodes/fill.el10
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
index 00267fdae79..f1bcadd7565 100644
--- a/lisp/textmodes/fill.el
+++ b/lisp/textmodes/fill.el
@@ -211,9 +211,6 @@ space does not end a sentence, so don't break a line there."
211 (if (or (memq justify '(right center)) 211 (if (or (memq justify '(right center))
212 (< (current-indentation) (current-left-margin))) 212 (< (current-indentation) (current-left-margin)))
213 (indent-to-left-margin)) 213 (indent-to-left-margin))
214 ;; and remove indentation from other lines.
215 (beginning-of-line 2)
216 (indent-region (point) (point-max) 0)
217 ;; Delete the fill prefix from every line except the first. 214 ;; Delete the fill prefix from every line except the first.
218 ;; The first line may not even have a fill prefix. 215 ;; The first line may not even have a fill prefix.
219 (goto-char from) 216 (goto-char from)
@@ -235,7 +232,12 @@ space does not end a sentence, so don't break a line there."
235 (goto-char from) 232 (goto-char from)
236 (and (looking-at fpre) (goto-char (match-end 0))) 233 (and (looking-at fpre) (goto-char (match-end 0)))
237 (setq from (point))))) 234 (setq from (point)))))
238 ;; "from" is now before the text to fill, 235 ;; Remove indentation from lines other than the first.
236 (beginning-of-line 2)
237 (indent-region (point) (point-max) 0)
238 (goto-char from)
239
240 ;; FROM, and point, are now before the text to fill,
239 ;; but after any fill prefix on the first line. 241 ;; but after any fill prefix on the first line.
240 242
241 ;; Make sure sentences ending at end of line get an extra space. 243 ;; Make sure sentences ending at end of line get an extra space.