diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-12 15:59:27 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-07-12 15:59:27 +0200 |
commit | 4c4ff9d90aa040ef3e1e474b3aa6a29f54c88e2e (patch) | |
tree | 7e6582f588f85620bc579be4a3e001d56996f208 /lisp/mail | |
parent | 4438459eaa6cccdac2cfcc8f7d5f248bfe8d1edf (diff) | |
download | emacs-4c4ff9d90aa040ef3e1e474b3aa6a29f54c88e2e.tar.gz |
Fix breaking of rfc2047 headers with long words
* lisp/mail/rfc2047.el (rfc2047-fold-region): Don't break lines
right after the Header: field, but wait until the next
whitespace. (This only makes a difference for words that are very
long (i.e., longer than, say, 60 characters, depending on the
header name length.)
Diffstat (limited to 'lisp/mail')
-rw-r--r-- | lisp/mail/rfc2047.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el index 9de6f02edfb..e3315120d82 100644 --- a/lisp/mail/rfc2047.el +++ b/lisp/mail/rfc2047.el @@ -765,7 +765,9 @@ Point moves to the end of the region." ;; Whitespace -- possible break point. ((memq (char-after) '(? ?\t)) (skip-chars-forward " \t") - (unless first ;; Don't break just after the header name. + ;; Don't break just after the header name. + (if first + (setq first nil) (setq break (point)))) ;; If the header has been encoded (with RFC2047 encoding, ;; which looks like "=?utf-8?Q?F=C3=B3?=". @@ -780,8 +782,7 @@ Point moves to the end of the region." (skip-chars-forward "^ \t\n\r"))) ;; Look for the next LWSP (i.e., whitespace character). (t - (skip-chars-forward "^ \t\n\r"))) - (setq first nil)) + (skip-chars-forward "^ \t\n\r")))) (when (and (or break qword-break) (> (- (point) bol) 76)) ;; Finally, after the loop, we have a line longer than 76 |