changeset 71736:125374685aec

(fill-region-as-paragraph): Refine last change.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sun, 09 Jul 2006 05:20:42 +0000
parents 900fce464279
children efe1646601d6
files lisp/ChangeLog lisp/textmodes/fill.el
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Jul 09 03:33:14 2006 +0000
+++ b/lisp/ChangeLog	Sun Jul 09 05:20:42 2006 +0000
@@ -1,11 +1,15 @@
+2006-07-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/fill.el (fill-region-as-paragraph): Refine last change.
+
 2006-07-08  Richard Stallman  <rms@gnu.org>
 
 	* term/x-win.el (x-handle-display): Add doc string.
 
 	* emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix.
 
-	* subr.el (def-edebug-spec): Moved here.
-	* emacs-lisp/edebug.el (def-edebug-spec): Moved to subr.el.
+	* subr.el (def-edebug-spec): Move here.
+	* emacs-lisp/edebug.el (def-edebug-spec): Move to subr.el.
 
 	* imenu.el (imenu-choose-buffer-index): Doc fix.
 
--- a/lisp/textmodes/fill.el	Sun Jul 09 03:33:14 2006 +0000
+++ b/lisp/textmodes/fill.el	Sun Jul 09 05:20:42 2006 +0000
@@ -628,10 +628,13 @@
   (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.