* 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)
(cherry picked from commit
fc214b668391abed313920cd44f3d913c8207e0e)
(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)))