mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-22 07:09:54 +00:00
(c-fill-paragraph): Don't alter point
when deciding to narrow at the end for the sake of a comment ender.
This commit is contained in:
parent
193c3837a1
commit
58ac467ee7
@ -458,15 +458,16 @@ preserving the comment indentation or line-starting decorations."
|
||||
(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
|
||||
|
Loading…
Reference in New Issue
Block a user