Mercurial > emacs
changeset 11839:70e05c1afba7
(c-fill-paragraph): Don't alter point
when deciding to narrow at the end for the sake of a comment ender.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 17 May 1995 20:44:36 +0000 |
parents | 92a61e91ec05 |
children | 8902ebe369bd |
files | lisp/progmodes/c-mode.el |
diffstat | 1 files changed, 10 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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