From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Roland Winkler" Newsgroups: gmane.emacs.bugs Subject: bug#45720: 28.0.50; fill-region-as-paragraph with long unbreakable lines Date: Thu, 7 Jan 2021 17:52:51 -0600 Message-ID: <40659.67204.506971.24567@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17290"; mail-complaints-to="usenet@ciao.gmane.io" To: 45720@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 08 00:54:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxf6Y-0004JF-Qh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Jan 2021 00:54:10 +0100 Original-Received: from localhost ([::1]:58116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxf6X-00054m-Bu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jan 2021 18:54:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxf6Q-00054O-Kw for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 18:54:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37361) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxf6Q-00032Q-Dy for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 18:54:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kxf6Q-0008Dd-BP for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 18:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Roland Winkler" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jan 2021 23:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45720 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161006359931540 (code B ref -1); Thu, 07 Jan 2021 23:54:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jan 2021 23:53:19 +0000 Original-Received: from localhost ([127.0.0.1]:48907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxf5i-0008Cd-VV for submit@debbugs.gnu.org; Thu, 07 Jan 2021 18:53:19 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52266) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxf5f-0008CU-GS for submit@debbugs.gnu.org; Thu, 07 Jan 2021 18:53:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxf5f-00051h-6y for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 18:53:15 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42077) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxf5f-0002oX-0P for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 18:53:15 -0500 Original-Received: from [2602:30a:2e52:d720:65b7:1416:12e7:8bfb] (port=36200 helo=regnitz) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1kxf5e-0005zu-LR for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 18:53:14 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197509 Archived-At: 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