From: Stefan Monnier Date: Sun, 9 Jul 2006 05:20:42 +0000 (+0000) Subject: (fill-region-as-paragraph): Refine last change. X-Git-Tag: emacs-pretest-22.0.90~1595 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5fc5b7e842f10fca77536a1a7742ef76ec224023;p=emacs.git (fill-region-as-paragraph): Refine last change. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9732a3f5432..08832bd613e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -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 --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.