From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#47338: 28.0.50; Unexpected error in fill-region Date: Tue, 23 Mar 2021 20:05:49 +0200 Message-ID: <83lfad7nk2.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1464"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 47338@debbugs.gnu.org To: Evgeny Zajcev , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 23 19:58:35 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 1lOmEd-0000Gr-1E for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Mar 2021 19:58:35 +0100 Original-Received: from localhost ([::1]:59672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOmEb-0007Vp-Up for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Mar 2021 14:58:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lOlQm-00048a-3V for bug-gnu-emacs@gnu.org; Tue, 23 Mar 2021 14:07:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49637) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lOlQk-00009d-UY for bug-gnu-emacs@gnu.org; Tue, 23 Mar 2021 14:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lOlQk-0005jV-Ql for bug-gnu-emacs@gnu.org; Tue, 23 Mar 2021 14:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Mar 2021 18:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47338 X-GNU-PR-Package: emacs Original-Received: via spool by 47338-submit@debbugs.gnu.org id=B47338.161652276621946 (code B ref 47338); Tue, 23 Mar 2021 18:07:02 +0000 Original-Received: (at 47338) by debbugs.gnu.org; 23 Mar 2021 18:06:06 +0000 Original-Received: from localhost ([127.0.0.1]:32945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOlPb-0005hM-U7 for submit@debbugs.gnu.org; Tue, 23 Mar 2021 14:06:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOlPZ-0005h9-MB for 47338@debbugs.gnu.org; Tue, 23 Mar 2021 14:05:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:33113) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lOlPU-00080L-BD; Tue, 23 Mar 2021 14:05:44 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2290 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lOlPS-00027w-Pg; Tue, 23 Mar 2021 14:05:43 -0400 In-Reply-To: (message from Evgeny Zajcev on Tue, 23 Mar 2021 12:43:20 +0300) 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:202919 Archived-At: > From: Evgeny Zajcev > Date: Tue, 23 Mar 2021 12:43:20 +0300 > > Evaluating next sexp results in error: > (with-temp-buffer > (let ((fill-column 66)) > (insert " :action (lambda (docid msg target)") > (fill-region (point-min) (point-max) 'left t) > (buffer-string))) > > Here is the backtrace: > Debugger entered--Lisp error: (error "Invalid search bound (wrong side of point)") > re-search-backward("[ \11]\\|\\c|.\\|.\\c|" 71 0) > fill-move-to-break-point(71) > fill-region-as-paragraph(1 70 left t) > fill-region(1 70 left t) > (let ((fill-column 66)) (insert " :action (lambda...") (fill-region (point-min) (point-max) > 'left t) (buffer-string)) > ... This is the result of fixing bug#45720. In the above scenario, the first time through the loop LINEBEG in the fragment below is set to EOB+1 instead of the point where the fill-prefix ends: (let ((first t) linebeg) (while (< (point) to) ;; On the first line, there may be text in the fill prefix ;; zone. In that case, don't consider that area when ;; trying to find a place to put a line break (bug#45720). (if (not first) (setq linebeg (point)) (setq first nil linebeg (+ (point) (length fill-prefix)))) <<<<<<<<<< CC'ing Lars who made that change.