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: Jens Schmidt
Subject: bug#67462: 30.0.50; prog-fill-reindent-defun does not respect buffer-local fill-paragraph-function
Date: Mon, 27 Nov 2023 20:46:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

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.





reply via email to

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