From: Dmitry Gutov <dmitry@gutov.dev>
To: Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Cc: 67462@debbugs.gnu.org
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 [thread overview]
Message-ID: <dab05a0f-3807-0c9f-2ebe-0c6062dc90fe@gutov.dev> (raw)
In-Reply-To: <87zfyzget1.fsf@sappc2.fritz.box>
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.
next prev parent reply other threads:[~2023-11-27 20:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-26 21:08 bug#67462: 30.0.50; prog-fill-reindent-defun does not respect buffer-local fill-paragraph-function Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-26 21:23 ` Dmitry Gutov
2023-11-26 22:52 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27 12:16 ` Eli Zaretskii
2023-11-27 20:08 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27 20:40 ` Dmitry Gutov
2023-11-28 21:28 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27 20:55 ` Eli Zaretskii
2023-11-28 21:10 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-28 21:41 ` Dmitry Gutov
2023-11-29 12:38 ` Eli Zaretskii
2023-11-29 21:28 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-30 6:39 ` Eli Zaretskii
2023-11-30 20:40 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-30 23:56 ` Dmitry Gutov
2023-11-27 17:02 ` Juri Linkov
2023-11-27 19:46 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-27 20:46 ` Dmitry Gutov [this message]
2023-11-27 12:05 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dab05a0f-3807-0c9f-2ebe-0c6062dc90fe@gutov.dev \
--to=dmitry@gutov.dev \
--cc=67462@debbugs.gnu.org \
--cc=jschmidt4gnu@vodafonemail.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.