# HG changeset patch # User Karl Heuer # Date 800743476 0 # Node ID 70e05c1afba75148837a87950434b02f44ba673d # Parent 92a61e91ec057f8b3769e969ecf9943fb25707dd (c-fill-paragraph): Don't alter point when deciding to narrow at the end for the sake of a comment ender. diff -r 92a61e91ec05 -r 70e05c1afba7 lisp/progmodes/c-mode.el --- a/lisp/progmodes/c-mode.el Wed May 17 20:41:36 1995 +0000 +++ b/lisp/progmodes/c-mode.el Wed May 17 20:44:36 1995 +0000 @@ -458,15 +458,16 @@ (search-forward "*/" nil 'move) (forward-line 1) (point))) - (goto-char (point-max)) - (forward-line -1) - ;; And comment terminator was on a separate line before, - ;; keep it that way. - ;; This also avoids another problem: - ;; if the fill-prefix ends in a *, it could eat up - ;; the * of the comment terminator. - (if (looking-at "[ \t]*\\*/") - (narrow-to-region (point-min) (point))) + (save-excursion + (goto-char (point-max)) + (forward-line -1) + ;; And comment terminator was on a separate line before, + ;; keep it that way. + ;; This also avoids another problem: + ;; if the fill-prefix ends in a *, it could eat up + ;; the * of the comment terminator. + (if (looking-at "[ \t]*\\*/") + (narrow-to-region (point-min) (point)))) (fill-paragraph arg) (save-excursion ;; Delete the chars we inserted to avoid clobbering