From 3aa15bbcf1a1eab227654af53f974e700ad8eb15 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 17 Nov 2004 03:29:55 +0000 Subject: [PATCH] Synch to No Gnus 200411170329. --- lisp/ChangeLog | 4 ++++ lisp/rfc2047.el | 24 +++++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6107491..cb8c1d2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2004-11-17 Katsumi Yamaoka + + * rfc2047.el (rfc2047-encode-region): Encode bogus delimiters. + 2004-11-15 Jesper Harder * pop3.el (pop3-leave-mail-on-server): Don't quote nil in diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 8bf7040..f417aa4 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -422,7 +422,9 @@ Dynamically bind `rfc2047-encoding-type' to change that." ;; to be encoded so that MTAs may parse ;; them safely. (cond ((= end (point))) - ((looking-at encodable-regexp) + ((looking-at (concat "\\sw*\\(" + encodable-regexp + "\\)")) (setq end nil)) (t (goto-char (1- (match-end 0))) @@ -442,12 +444,20 @@ Dynamically bind `rfc2047-encoding-type' to change that." (goto-char start) (if (re-search-forward encodable-regexp end 'move) (progn - (goto-char start) - (unless (memq (char-before) '(nil ?\t ? )) - ;; Separate encodable text and delimiter. - (insert " ") - (setq end (1+ end))) - (rfc2047-encode (point) end) + (unless (memq (char-before start) '(nil ?\t ? )) + (if (progn + (goto-char start) + (skip-chars-backward "^ \t\n") + (and (looking-at "\\Sw+") + (= (match-end 0) start))) + ;; Also encode bogus delimiters. + (setq start (point)) + ;; Separate encodable text and delimiter. + (goto-char start) + (insert " ") + (setq start (1+ start) + end (1+ end)))) + (rfc2047-encode start end) (setq last-encoded t)) (setq last-encoded nil))))) (error -- 1.7.10.4