GNU bug report logs -
#47338
28.0.50; Unexpected error in fill-region
Previous Next
Reported by: Evgeny Zajcev <lg.zevlg <at> gmail.com>
Date: Tue, 23 Mar 2021 09:44:02 UTC
Severity: normal
Tags: fixed
Found in version 28.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Evgeny Zajcev <lg.zevlg <at> 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.
This bug report was last modified 4 years and 116 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.