diff options
| author | Karl Heuer | 1995-05-17 20:44:36 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-05-17 20:44:36 +0000 |
| commit | 58ac467ee734a08adc2bea34e49a2b512119417d (patch) | |
| tree | ef406cebe1e484704564309ade1287f6c5364b34 | |
| parent | 193c3837a17f1bac7daaefdd9eec5cd203ff28a2 (diff) | |
| download | emacs-58ac467ee734a08adc2bea34e49a2b512119417d.tar.gz emacs-58ac467ee734a08adc2bea34e49a2b512119417d.zip | |
(c-fill-paragraph): Don't alter point
when deciding to narrow at the end for the sake of a comment ender.
| -rw-r--r-- | lisp/progmodes/c-mode.el | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/progmodes/c-mode.el b/lisp/progmodes/c-mode.el index e8f060b1251..959bb9f06b1 100644 --- a/lisp/progmodes/c-mode.el +++ b/lisp/progmodes/c-mode.el | |||
| @@ -458,15 +458,16 @@ preserving the comment indentation or line-starting decorations." | |||
| 458 | (search-forward "*/" nil 'move) | 458 | (search-forward "*/" nil 'move) |
| 459 | (forward-line 1) | 459 | (forward-line 1) |
| 460 | (point))) | 460 | (point))) |
| 461 | (goto-char (point-max)) | 461 | (save-excursion |
| 462 | (forward-line -1) | 462 | (goto-char (point-max)) |
| 463 | ;; And comment terminator was on a separate line before, | 463 | (forward-line -1) |
| 464 | ;; keep it that way. | 464 | ;; And comment terminator was on a separate line before, |
| 465 | ;; This also avoids another problem: | 465 | ;; keep it that way. |
| 466 | ;; if the fill-prefix ends in a *, it could eat up | 466 | ;; This also avoids another problem: |
| 467 | ;; the * of the comment terminator. | 467 | ;; if the fill-prefix ends in a *, it could eat up |
| 468 | (if (looking-at "[ \t]*\\*/") | 468 | ;; the * of the comment terminator. |
| 469 | (narrow-to-region (point-min) (point))) | 469 | (if (looking-at "[ \t]*\\*/") |
| 470 | (narrow-to-region (point-min) (point)))) | ||
| 470 | (fill-paragraph arg) | 471 | (fill-paragraph arg) |
| 471 | (save-excursion | 472 | (save-excursion |
| 472 | ;; Delete the chars we inserted to avoid clobbering | 473 | ;; Delete the chars we inserted to avoid clobbering |