diff options
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index f8375d7fe36..4f9e1947738 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -4238,6 +4238,7 @@ If a fill prefix is specified, it overrides all the above." | |||
| 4238 | (c-collect-line-comments c-lit-limits)) | 4238 | (c-collect-line-comments c-lit-limits)) |
| 4239 | c-lit-type))) | 4239 | c-lit-type))) |
| 4240 | (pos (point)) | 4240 | (pos (point)) |
| 4241 | (start-col (current-column)) | ||
| 4241 | (comment-text-end | 4242 | (comment-text-end |
| 4242 | (or (and (eq c-lit-type 'c) | 4243 | (or (and (eq c-lit-type 'c) |
| 4243 | (save-excursion | 4244 | (save-excursion |
| @@ -4254,6 +4255,11 @@ If a fill prefix is specified, it overrides all the above." | |||
| 4254 | ;; | 4255 | ;; |
| 4255 | ;; If point is on the 'B' then the line will be | 4256 | ;; If point is on the 'B' then the line will be |
| 4256 | ;; broken after "Bla b". | 4257 | ;; broken after "Bla b". |
| 4258 | ;; | ||
| 4259 | ;; If we have an empty comment, /* */, the next | ||
| 4260 | ;; lot of code pushes point to the */. We fix | ||
| 4261 | ;; this by never allowing point to end up to the | ||
| 4262 | ;; right of where it started. | ||
| 4257 | (while (and (< (current-column) (cdr fill)) | 4263 | (while (and (< (current-column) (cdr fill)) |
| 4258 | (not (eolp))) | 4264 | (not (eolp))) |
| 4259 | (forward-char 1)) | 4265 | (forward-char 1)) |
| @@ -4276,7 +4282,10 @@ If a fill prefix is specified, it overrides all the above." | |||
| 4276 | ((< (point) (+ (car c-lit-limits) 2)) | 4282 | ((< (point) (+ (car c-lit-limits) 2)) |
| 4277 | (goto-char (+ (car c-lit-limits) 2)))) | 4283 | (goto-char (+ (car c-lit-limits) 2)))) |
| 4278 | (funcall do-line-break) | 4284 | (funcall do-line-break) |
| 4279 | (insert-and-inherit (car fill)))) | 4285 | (insert-and-inherit (car fill)) |
| 4286 | (if (> (current-column) start-col) | ||
| 4287 | (move-to-column start-col)))) ; can this hit the | ||
| 4288 | ; middle of a TAB? | ||
| 4280 | ;; Inside a comment that should be broken. | 4289 | ;; Inside a comment that should be broken. |
| 4281 | (let ((comment-start comment-start) | 4290 | (let ((comment-start comment-start) |
| 4282 | (comment-end comment-end) | 4291 | (comment-end comment-end) |