unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Roland Winkler" <winkler@gnu.org>
To: 45720@debbugs.gnu.org
Subject: bug#45720: 28.0.50; fill-region-as-paragraph with long unbreakable lines
Date: Thu, 7 Jan 2021 17:52:51 -0600	[thread overview]
Message-ID: <40659.67204.506971.24567@gargle.gargle.HOWL> (raw)


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	other threads:[~2021-01-07 23:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07 23:52 Roland Winkler [this message]
2021-01-10 14:06 ` bug#45720: 28.0.50; fill-region-as-paragraph with long unbreakable lines Lars Ingebrigtsen
     [not found] <87y232r0ee.fsf@gnus.org>
2022-06-07 14:54 ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40659.67204.506971.24567@gargle.gargle.HOWL \
    --to=winkler@gnu.org \
    --cc=45720@debbugs.gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).