mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-30 11:09:23 +00:00
Fix filling for when filladapt mode is enabled.
This commit is contained in:
parent
e517eda4d0
commit
b493658e2c
@ -4382,11 +4382,8 @@ Optional prefix ARG means justify paragraph as well."
|
||||
(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.
|
||||
|
@ -490,6 +490,7 @@ that requires a literal mode spec at compile time."
|
||||
(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)
|
||||
@ -500,6 +501,9 @@ that requires a literal mode spec at compile time."
|
||||
(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.
|
||||
|
Loading…
Reference in New Issue
Block a user