aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-07-13 01:09:19 +0200
committerLars Ingebrigtsen2019-07-13 01:09:25 +0200
commitebd3f61a569f256f926828017f500cc74e6878bc (patch)
treecca320097c91903e23419cff0ea70b63d89585ea
parent38e420af451c61dd0e77c7d73adf6fd1f6a021a9 (diff)
downloademacs-ebd3f61a569f256f926828017f500cc74e6878bc.tar.gz
emacs-ebd3f61a569f256f926828017f500cc74e6878bc.zip
Fold rfc2047 headers correctly when narrowed to header value
* lisp/mail/rfc2047.el (rfc2047-fold-region): Fold headers correctly if narrowed to the header value.
-rw-r--r--lisp/mail/rfc2047.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/mail/rfc2047.el b/lisp/mail/rfc2047.el
index e3315120d82..a02201ec323 100644
--- a/lisp/mail/rfc2047.el
+++ b/lisp/mail/rfc2047.el
@@ -732,12 +732,19 @@ Point moves to the end of the region."
732 (save-restriction 732 (save-restriction
733 (narrow-to-region b e) 733 (narrow-to-region b e)
734 (goto-char (point-min)) 734 (goto-char (point-min))
735 (let ((break nil) 735 (let* ((break nil)
736 (qword-break nil) 736 (qword-break nil)
737 (first t) 737 (bol (save-restriction
738 (bol (save-restriction 738 (widen)
739 (widen) 739 (line-beginning-position)))
740 (point-at-bol)))) 740 ;; This function is either called with the Header: name in
741 ;; the region or not. If it's not in the region, then we
742 ;; may already have a space.
743 (first (or (= bol (point))
744 (save-restriction
745 (widen)
746 (save-excursion
747 (not (re-search-backward "[ \t]" bol t)))))))
741 (while (not (eobp)) 748 (while (not (eobp))
742 (when (and (or break qword-break) 749 (when (and (or break qword-break)
743 (> (- (point) bol) 76)) 750 (> (- (point) bol) 76))