1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-28 07:45:00 +00:00

Flow fill texts after the last hard newline

* lisp/mail/flow-fill.el (fill-flowed-encode): Use `(point-max)'
as `end' if there are no remaining hard newlines in buffer.
This ensures that the last paragraph will always be encoded,
even without a trailing hard newline.  (Bug#72870)
This commit is contained in:
Pengji Zhang 2024-08-28 18:57:35 +08:00 committed by Eli Zaretskii
parent a724a49708
commit fc214b6683

View File

@ -78,7 +78,9 @@ RFC 2646 suggests 66 characters for readability."
(let ((start (point-min)) end)
;; Go through each paragraph, filling it and adding SPC
;; as the last character on each line.
(while (setq end (text-property-any start (point-max) 'hard 't))
(while (and (< start (point-max))
(setq end (or (text-property-any start (point-max) 'hard 't)
(point-max))))
(save-restriction
(narrow-to-region start end)
(let ((fill-column (eval fill-flowed-encode-column t)))