]> git.eshelyaron.com Git - emacs.git/commitdiff
(c-fill-paragraph): Preserve final sentence boundary.
authorKarl Heuer <kwzh@gnu.org>
Fri, 4 Mar 1994 00:05:15 +0000 (00:05 +0000)
committerKarl Heuer <kwzh@gnu.org>
Fri, 4 Mar 1994 00:05:15 +0000 (00:05 +0000)
lisp/progmodes/c-mode.el

index 964f566f2d9fcdcafbbcb6207dba8b30a30db211..0ceb173a0b2990e8654fa47295253bea21121473 100644 (file)
@@ -449,12 +449,16 @@ preserving the comment indentation or line-starting decorations."
                    (delete-region (point) (+ (point) chars-to-delete)))
                ;; Find the comment ender (should be on last line of buffer,
                ;; given the narrowing) and don't leave it on its own line.
+               ;; Do this with a fill command, so as to preserve sentence
+               ;; boundaries.
                (goto-char (point-max))
                (forward-line -1)
                (search-forward "*/" nil 'move)
                (beginning-of-line)
                (if (looking-at "[ \t]*\\*/")
-                   (delete-indentation)))))
+                   (let ((fill-column (+ fill-column 9999)))
+                     (forward-line -1)
+                     (fill-region-as-paragraph (point) (point-max)))))))
        ;; Outside of comments: do ordinary filling.
        (fill-paragraph arg)))))