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

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

bug#45720: 28.0.50; fill-region-as-paragraph with long unbreakable lines


From: Lars Ingebrigtsen
Subject: bug#45720: 28.0.50; fill-region-as-paragraph with long unbreakable lines
Date: Sun, 10 Jan 2021 15:06:49 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"Roland Winkler" <winkler@gnu.org> writes:

> Then put point on letter `b' of the following line and run M-x foo
>
> aaa =   baaaaaaaaaaaaaaaaaaaaaaaaaaaa
>
> This fills the line as
>
> aaa =
>         baaaaaaaaaaaaaaaaaaaaaaaaaaaa
>
> The line break introduced here does not make sense.  The line should
> be kept what it was.

Yup.  Looking at the code, this looked suspiciously easy to fix.
However, there's absolutely no tests for this stuff, so my confidence
that I didn't break anything here is pretty low.  I've added a couple
tests (based on your test case) and pushed it to the trunk, though.  Let
me know whether it works in your real cases or not:

> Command `foo' is really the essence of bibtex-fill-field-bounds in
> textmodes/bibtex.el that uses fill-region-as-paragraph to fill the
> fields of BibTeX entries.  If the field holds a URL, it may happen
> more easily that the value of the field is a string that goes beyond
> fill-column and that fill-region-as-paragraph cannot break into
> words.  I haven't tried to construct a yet more minimalistic version
> of this problem.

Or whether this breaks something else, and if it does, please do feel
free to add more tests to test/lisp/textmodes/fill-tests.el.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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