From: Eli Zaretskii <eliz@gnu.org>
To: Evgeny Zajcev <lg.zevlg@gmail.com>, Lars Ingebrigtsen <larsi@gnus.org>
Cc: 47338@debbugs.gnu.org
Subject: bug#47338: 28.0.50; Unexpected error in fill-region
Date: Tue, 23 Mar 2021 20:05:49 +0200 [thread overview]
Message-ID: <83lfad7nk2.fsf@gnu.org> (raw)
In-Reply-To: <CAO=W_ZrxJotV-9oo02AZeHFSDj5Yn-aaT++EZJjaZSF91h-pOg@mail.gmail.com> (message from Evgeny Zajcev on Tue, 23 Mar 2021 12:43:20 +0300)
> From: Evgeny Zajcev <lg.zevlg@gmail.com>
> 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.
next prev parent reply other threads:[~2021-03-23 18:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-23 9:43 bug#47338: 28.0.50; Unexpected error in fill-region Evgeny Zajcev
2021-03-23 15:31 ` bug#47338: [External] : " Drew Adams
2021-03-23 16:44 ` Eli Zaretskii
2021-03-23 17:19 ` Drew Adams
2021-03-23 17:55 ` Gregory Heytings
2021-03-23 19:24 ` Eli Zaretskii
2021-03-23 19:42 ` Gregory Heytings
2021-03-23 18:05 ` Eli Zaretskii [this message]
2021-03-24 9:24 ` Lars Ingebrigtsen
2021-03-25 18:27 ` Evgeny Zajcev
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=83lfad7nk2.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=47338@debbugs.gnu.org \
--cc=larsi@gnus.org \
--cc=lg.zevlg@gmail.com \
/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).