summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-03-04 00:05:15 +0000
committerKarl Heuer <kwzh@gnu.org>1994-03-04 00:05:15 +0000
commit741c91a7936f8887233fbcadf1ca62e50828b682 (patch)
treed0bdce5e6b8a398593d02900f772d3b258f05f79 /lisp/progmodes
parent94bf1825e4186f6a6a3b29bf4a34ad5d3da90860 (diff)
downloademacs-741c91a7936f8887233fbcadf1ca62e50828b682.tar.gz
(c-fill-paragraph): Preserve final sentence boundary.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/c-mode.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el
index 964f566f2d9..0ceb173a0b2 100644
--- a/lisp/progmodes/c-mode.el
+++ b/lisp/progmodes/c-mode.el
@@ -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)))))