From 78c1663295530854895397fe2ef477381a1e7351 Mon Sep 17 00:00:00 2001 From: ShengHuo ZHU Date: Wed, 10 May 2000 16:23:28 +0000 Subject: [PATCH] * qp.el (quoted-printable-encode-region): Bind tab-width to 1. Set limit to 76. --- lisp/ChangeLog | 5 +++++ lisp/qp.el | 35 ++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 936ba0167..a7238c616 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2000-05-10 12:17:58 Shenghuo ZHU + + * qp.el (quoted-printable-encode-region): Bind tab-width to 1. Set + limit to 76. + 2000-05-10 09:11:48 Lars Magne Ingebrigtsen * nnslashdot.el (nnslashdot-sid-strip): New function. diff --git a/lisp/qp.el b/lisp/qp.el index 93c3f7e19..ea2a81836 100644 --- a/lisp/qp.el +++ b/lisp/qp.el @@ -115,23 +115,24 @@ encode lines starting with \"From\"." (delete-char 1))))) (when (or fold mm-use-ultra-safe-encoding) ;; Fold long lines. - (goto-char (point-min)) - (while (not (eobp)) - ;; In ultra-safe mode, encode "From " at the beginning of a - ;; line. - (when mm-use-ultra-safe-encoding - (beginning-of-line) - (when (looking-at "From ") - (replace-match "From=20" nil t))) - (end-of-line) - (while (> (current-column) 72) - (beginning-of-line) - (forward-char 71);; 71 char plus an "=" - (search-backward "=" (- (point) 2) t) - (insert "=\n") - (end-of-line)) - (unless (eobp) - (forward-line))))))) + (let ((tab-width 1)) ;; HTAB is one character. + (goto-char (point-min)) + (while (not (eobp)) + ;; In ultra-safe mode, encode "From " at the beginning of a + ;; line. + (when mm-use-ultra-safe-encoding + (beginning-of-line) + (when (looking-at "From ") + (replace-match "From=20" nil t))) + (end-of-line) + (while (> (current-column) 76) ;; tab-width must be 1. + (beginning-of-line) + (forward-char 75);; 75 chars plus an "=" + (search-backward "=" (- (point) 2) t) + (insert "=\n") + (end-of-line)) + (unless (eobp) + (forward-line)))))))) (defun quoted-printable-encode-string (string) "QP-encode STRING and return the results." -- 2.25.1