diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-07-09 05:20:42 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-07-09 05:20:42 +0000 |
commit | 5fc5b7e842f10fca77536a1a7742ef76ec224023 (patch) | |
tree | b1187fc1bf4d34fd538249aae16c1612344b22af /lisp/textmodes/fill.el | |
parent | bf88ca63905ad2afc61fae92e8fba048819d4521 (diff) | |
download | emacs-5fc5b7e842f10fca77536a1a7742ef76ec224023.tar.gz |
(fill-region-as-paragraph): Refine last change.
Diffstat (limited to 'lisp/textmodes/fill.el')
-rw-r--r-- | lisp/textmodes/fill.el | 9 |
1 files changed, 6 insertions, 3 deletions
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. |