GNU bug report logs -
#67462
30.0.50; prog-fill-reindent-defun does not respect buffer-local fill-paragraph-function
Previous Next
Full log
Message #23 received at 67462 <at> debbugs.gnu.org (full text, mbox):
Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> writes:
> Dmitry Gutov <dmitry <at> gutov.dev> writes:
>
>> I'm not sure this is going to work well because c-mode (for
>> example) also has a buffer-local value of
>> fill-paragraph-function.
>
> Uh. Good point.
Actually, I have to correct myself here: `c-mode', even though deriving
from `prog-mode', goes at lengths to not use the derived binding of M-q,
but rather binds it directly:
;; It doesn't suffice to put `c-fill-paragraph' on
;; `fill-paragraph-function' since `c-fill-paragraph' must be called
;; before any fill prefix adaption is done. E.g. `filladapt-mode'
;; replaces `fill-paragraph' and does the adaption before calling
;; `fill-paragraph-function', and we have to mask comments etc
;; before that. Also, `c-fill-paragraph' chains on to
;; `fill-paragraph' and the value on `fill-paragraph-function' to
;; do the actual filling work.
(substitute-key-definition 'fill-paragraph 'c-fill-paragraph
c-mode-base-map global-map)
So `prog-fill-reindent-defun' wouldn't be bound in `c-mode' buffers,
anyway. The same seems to hold for `awk-mode', `c++-mode' and probably
other modes in that family.
This bug report was last modified 1 year and 199 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.