comparison lisp/progmodes/c-mode.el @ 10544:eeeae6ef626e

(c-forward-conditional): If an apparent conditional is not really a conditional, skip past it. (c-fill-paragraph): If comment terminator is on a separate line, don't include that line in the filling.
author Richard M. Stallman <rms@gnu.org>
date Wed, 25 Jan 1995 00:41:22 +0000
parents 14c7b7749f45
children 3e851e5cab1f
comparison
equal deleted inserted replaced
10543:3b896847b849 10544:eeeae6ef626e
445 (if comment-start-place 445 (if comment-start-place
446 (goto-char (+ comment-start-place 2))) 446 (goto-char (+ comment-start-place 2)))
447 (search-forward "*/" nil 'move) 447 (search-forward "*/" nil 'move)
448 (forward-line 1) 448 (forward-line 1)
449 (point))) 449 (point)))
450 (goto-char (point-max))
451 (forward-line -1)
452 ;; And comment terminator was on a separate line before,
453 ;; keep it that way.
454 ;; This also avoids another problem:
455 ;; if the fill-prefix ends in a *, it could eat up
456 ;; the * of the comment terminator.
457 (if (looking-at "[ \t]*\\*/")
458 (narrow-to-region (point-min) (point)))
450 (fill-paragraph arg) 459 (fill-paragraph arg)
451 (save-excursion 460 (save-excursion
452 ;; Delete the chars we inserted to avoid clobbering 461 ;; Delete the chars we inserted to avoid clobbering
453 ;; the stuff before the comment start. 462 ;; the stuff before the comment start.
454 (goto-char (point-min)) 463 (goto-char (point-min))
1502 ;; When searching forward, start from next line 1511 ;; When searching forward, start from next line
1503 ;; so that we don't find the same line again. 1512 ;; so that we don't find the same line again.
1504 (if forward (forward-line 1)) 1513 (if forward (forward-line 1))
1505 ;; If this line exits a level of conditional, exit inner loop. 1514 ;; If this line exits a level of conditional, exit inner loop.
1506 (if (< depth 0) 1515 (if (< depth 0)
1507 (setq found (point))))))) 1516 (setq found (point))))
1517 ;; If the line is not really a conditional, skip past it.
1518 (if forward (end-of-line)))))
1508 (or found 1519 (or found
1509 (error "No containing preprocessor conditional")) 1520 (error "No containing preprocessor conditional"))
1510 (goto-char (setq new found))) 1521 (goto-char (setq new found)))
1511 (setq count (+ count increment)))) 1522 (setq count (+ count increment))))
1512 (push-mark) 1523 (push-mark)