From 5fc5b7e842f10fca77536a1a7742ef76ec224023 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 9 Jul 2006 05:20:42 +0000 Subject: (fill-region-as-paragraph): Refine last change. --- lisp/textmodes/fill.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lisp/textmodes/fill.el') diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 409e9117674..95f73b56952 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -628,10 +628,13 @@ space does not end a sentence, so don't break a line there." (let ((from-plus-indent (point)) (oneleft nil)) + (beginning-of-line) ;; We used to round up to whole line, but that prevents us from - ;; correctly handling filling of mixed code-and-comment where we - ;; do want to fill the comment but not the code. - ;; (beginning-of-line) (setq from (point)) + ;; correctly handling filling of mixed code-and-comment where we do want + ;; to fill the comment but not the code. So only use (point) if it's + ;; further than `from', which means that `from' is followed by some + ;; number of empty lines. + (setq from (max (point) from)) ;; Delete all but one soft newline at end of region. ;; And leave TO before that one. -- cgit v1.2.1