GNU bug report logs - #67462
30.0.50; prog-fill-reindent-defun does not respect buffer-local fill-paragraph-function

Previous Next

Package: emacs;

Reported by: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>

Date: Sun, 26 Nov 2023 21:10:02 UTC

Severity: normal

Found in version 30.0.50

Full log


Message #32 received at 67462 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
Cc: 67462 <at> debbugs.gnu.org
Subject: Re: bug#67462: 30.0.50; prog-fill-reindent-defun does not respect
 buffer-local fill-paragraph-function
Date: Mon, 27 Nov 2023 22:46:32 +0200
On 27/11/2023 21:46, Jens Schmidt wrote:
> 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.

Fair counterpoint.

We can take instead emacs-lisp-mode as an example: it has 
fill-paragraph-function defined (lisp-fill-paragraph) which only works 
in strings and comments.




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.