aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer1994-03-04 00:05:15 +0000
committerKarl Heuer1994-03-04 00:05:15 +0000
commit176afd04921a6f1de282c9ee4cd573d26f4a2d8e (patch)
tree53d64da9b35f91855d57c9c01e4baf2dd75c55bd /lisp
parentba02c1673c089e29f88c5a71d388c39a5cde1ebc (diff)
downloademacs-176afd04921a6f1de282c9ee4cd573d26f4a2d8e.tar.gz
emacs-176afd04921a6f1de282c9ee4cd573d26f4a2d8e.zip
(c-fill-paragraph): Preserve final sentence boundary.
Diffstat (limited to 'lisp')
-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."
449 (delete-region (point) (+ (point) chars-to-delete))) 449 (delete-region (point) (+ (point) chars-to-delete)))
450 ;; Find the comment ender (should be on last line of buffer, 450 ;; Find the comment ender (should be on last line of buffer,
451 ;; given the narrowing) and don't leave it on its own line. 451 ;; given the narrowing) and don't leave it on its own line.
452 ;; Do this with a fill command, so as to preserve sentence
453 ;; boundaries.
452 (goto-char (point-max)) 454 (goto-char (point-max))
453 (forward-line -1) 455 (forward-line -1)
454 (search-forward "*/" nil 'move) 456 (search-forward "*/" nil 'move)
455 (beginning-of-line) 457 (beginning-of-line)
456 (if (looking-at "[ \t]*\\*/") 458 (if (looking-at "[ \t]*\\*/")
457 (delete-indentation))))) 459 (let ((fill-column (+ fill-column 9999)))
460 (forward-line -1)
461 (fill-region-as-paragraph (point) (point-max)))))))
458 ;; Outside of comments: do ordinary filling. 462 ;; Outside of comments: do ordinary filling.
459 (fill-paragraph arg))))) 463 (fill-paragraph arg)))))
460 464