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: Roland Winkler
Subject: bug#45720: 28.0.50; fill-region-as-paragraph with long unbreakable lines
Date: Thu, 7 Jan 2021 17:52:51 -0600

In emacs -Q evaluate

(defun foo (pos)
  (interactive "d")
  (let* ((beg (line-beginning-position))
         (end (line-end-position))
         (fill-prefix (make-string (- pos beg) ?\s))
         ;; `fill-column' is too small to accomodate the current line
         (fill-column (- end beg 10)))
    (fill-region-as-paragraph beg end nil nil pos)))

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.

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.



In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.18.9, cairo 
version 1.14.6)
 of 2021-01-03 built on regnitz
Repository revision: 20ad0cc03b73f6576ece195bb16878415c313d45
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description: Ubuntu 16.04.7 LTS





reply via email to

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