GNU bug report logs - #56197
lisp-fill-paragraph behavior changed in Emacs 28

Previous Next

Package: emacs;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Fri, 24 Jun 2022 16:18:01 UTC

Severity: normal

Tags: patch

Found in version 28.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Felix Lechner <felix.lechner <at> lease-up.com>
To: 56197 <at> debbugs.gnu.org
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, Eli Zaretskii <eliz <at> gnu.org>,
 Stefan Kangas <stefankangas <at> gmail.com>,
 Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Subject: 28.1; lisp-fill-paragraph result regressed with Emacs 28
Date: Wed, 25 Dec 2024 12:15:44 -0800
Hi everyone,

> fill the string using fill-column, or [...] fill the text as is in the
> buffer

> It's now filling that string as if it, well, is a string, so that if
> you insert it somewhere, the lines have similar lengths.  The previous
> behaviour was to fill "what you see in the buffer"

> The former sounds more useful, IMO.  I don't want to mess up my strings
> just to have pretty source code

Filling strings in code would be useful, but isn't that a separate,
don't-break-my-strings feature?

Historically, the point of text justification is to make text fit on a
screen.  For example, the documentation for fill-region refers to
columns, which are features of buffers:

    Column beyond which automatic line-wrapping should happen.

Auto-fill-mode is consistent:

    inserting a space at a column beyond current-fill-column
    automatically breaks the line

In a grand sweep, the manual explains what needs to fit where:

    “Filling” text means breaking it up into lines that fit a specified
    width.

Section 26.6.2 ("Explicit Fill Commands") is even more, well, explicit:

    The command ‘M-q’ (‘fill-paragraph’) “fills” the current paragraph.
    It redistributes the line breaks within the paragraph, and deletes
    any excess space and tab characters occurring within the paragraph,
    in such a way that the lines end up fitting within a certain maximum
    width.

How text shows on a screen is clearly a central feature.  The manual
continues:

    The maximum line width for filling is specified by the buffer-local
    variable ‘fill-column’.  The default value (*note Locals::) is 70.
    The easiest way to set ‘fill-column’ in the current buffer is to use
    the command ‘C-x f’ (‘set-fill-column’).  [...]  Note that, by its
    very nature, ‘fill-column’ is measured in column units; the actual
    position of that column on a graphical display depends on the font
    being used.  In particular, using variable-pitch fonts will cause
    the ‘fill-column’ occupy different horizontal positions on display
    in different lines.

In my view, the string interpretation calls for a different, though
related feature.

Maybe there could be (setq fill-strings-instead-of-text t) ?  Thanks!

Kind regards
Felix




This bug report was last modified 109 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.