bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67462: 30.0.50; prog-fill-reindent-defun does not respect buffer-loc


From: Dmitry Gutov
Subject: 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
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

On 27/11/2023 21:46, Jens Schmidt wrote:
Jens Schmidt<jschmidt4gnu@vodafonemail.de>  writes:

Dmitry Gutov<dmitry@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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]