[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master fc214b66839 1/2: Flow fill texts after the last hard newline
From: |
Eli Zaretskii |
Subject: |
master fc214b66839 1/2: Flow fill texts after the last hard newline |
Date: |
Sat, 12 Oct 2024 08:30:47 -0400 (EDT) |
branch: master
commit fc214b668391abed313920cd44f3d913c8207e0e
Author: Pengji Zhang <me@pengjiz.com>
Commit: Eli Zaretskii <eliz@gnu.org>
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)
---
lisp/mail/flow-fill.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/mail/flow-fill.el b/lisp/mail/flow-fill.el
index 919490ec5aa..d4ad7d45982 100644
--- a/lisp/mail/flow-fill.el
+++ b/lisp/mail/flow-fill.el
@@ -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)))