# HG changeset patch # User Stefan Monnier # Date 1152422442 0 # Node ID 125374685aecd530d3dec591acbbc91a14796426 # Parent 900fce46427923b4dd87602aef2e078abe1c750f (fill-region-as-paragraph): Refine last change. diff -r 900fce464279 -r 125374685aec lisp/ChangeLog --- 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 + + * textmodes/fill.el (fill-region-as-paragraph): Refine last change. + 2006-07-08 Richard Stallman * 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. diff -r 900fce464279 -r 125374685aec lisp/textmodes/fill.el --- 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.