(let ((fill-paragraph-function
;; Avoid infinite recursion.
(if (not (eq fill-paragraph-function 'c-fill-paragraph))
- fill-paragraph-function))
- (start-point (point-marker)))
- (c-mask-paragraph
- t nil (lambda () (fill-region-as-paragraph (point-min) (point-max) arg)))
- (goto-char start-point))
+ fill-paragraph-function)))
+ (c-mask-paragraph t nil 'fill-paragraph arg))
;; Always return t. This has the effect that if filling isn't done
;; above, it isn't done at all, and it's therefore effectively
;; disabled in normal code.
(make-local-variable 'paragraph-ignore-fill-prefix)
(make-local-variable 'adaptive-fill-mode)
(make-local-variable 'adaptive-fill-regexp)
+ (make-local-variable 'fill-paragraph-handle-comment)
;; now set their values
(set (make-local-variable 'parse-sexp-ignore-comments) t)
(set (make-local-variable 'comment-line-break-function)
'c-indent-new-comment-line)
+ ;; For the benefit of adaptive file, which otherwise mis-fills.
+ (setq fill-paragraph-handle-comment nil)
+
;; Install `c-fill-paragraph' on `fill-paragraph-function' so that a
;; direct call to `fill-paragraph' behaves better. This still
;; doesn't work with filladapt but it's better than nothing.