mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-05 22:20:24 -08:00
Fix bug in semantic linefeed filling
Fix bug in semantic linefeed filling related to wide characters and `sentence-end-without-space'. * lisp/textmodes/fill.el (fill-region-as-paragraph-semlf): Fix the calculation of the maximum column. Do not depend on where `fill-region-as-paragraph-default' leaves point after being called. (Bug#79575)
This commit is contained in:
parent
ef903e0f5a
commit
b208b08371
1 changed files with 11 additions and 7 deletions
|
|
@ -1657,7 +1657,7 @@ For more details about semantic linefeeds, see `https://sembr.org/' and
|
||||||
(to (copy-marker (max from to) t))
|
(to (copy-marker (max from to) t))
|
||||||
pfx)
|
pfx)
|
||||||
(goto-char from)
|
(goto-char from)
|
||||||
(let ((fill-column (point-max)))
|
(let ((fill-column (* 2 (point-max)))) ; Wide characters span up to two columns.
|
||||||
(setq pfx (or (save-excursion
|
(setq pfx (or (save-excursion
|
||||||
(fill-region-as-paragraph-default (point)
|
(fill-region-as-paragraph-default (point)
|
||||||
to
|
to
|
||||||
|
|
@ -1666,14 +1666,18 @@ For more details about semantic linefeeds, see `https://sembr.org/' and
|
||||||
squeeze-after))
|
squeeze-after))
|
||||||
"")))
|
"")))
|
||||||
(while (< (point) to)
|
(while (< (point) to)
|
||||||
(let ((fill-prefix pfx))
|
(let ((fill-to (copy-marker
|
||||||
|
(min to
|
||||||
|
(save-excursion
|
||||||
|
(forward-sentence)
|
||||||
|
(point)))
|
||||||
|
t))
|
||||||
|
(fill-prefix pfx))
|
||||||
(fill-region-as-paragraph-default (point)
|
(fill-region-as-paragraph-default (point)
|
||||||
(min to
|
fill-to
|
||||||
(save-excursion
|
|
||||||
(forward-sentence)
|
|
||||||
(point)))
|
|
||||||
justify
|
justify
|
||||||
t))
|
t)
|
||||||
|
(goto-char fill-to))
|
||||||
(when (and (> (point) (line-beginning-position))
|
(when (and (> (point) (line-beginning-position))
|
||||||
(< (point) (line-end-position))
|
(< (point) (line-end-position))
|
||||||
(< (point) to))
|
(< (point) to))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue