diff options
author | Katsumi Yamaoka <yamaoka@jpl.org> | 2009-11-17 22:10:40 +0000 |
---|---|---|
committer | Katsumi Yamaoka <yamaoka@jpl.org> | 2009-11-17 22:10:40 +0000 |
commit | 30123838c590128066c5d8b32f41cc8adf38a2a8 (patch) | |
tree | 5b0a4d87433c69feebff92e6fd7a47c420af26b3 /lisp/gnus/rfc2047.el | |
parent | 1b9ac1453d4263d7e3b6cb52a2207163fe2649c8 (diff) | |
download | emacs-30123838c590128066c5d8b32f41cc8adf38a2a8.tar.gz |
(rfc2047-decode-region): Don't quote decoded words containing tspecial
characters if they have been already quoted. -- Synch with Gnus trunk.
Diffstat (limited to 'lisp/gnus/rfc2047.el')
-rw-r--r-- | lisp/gnus/rfc2047.el | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 4ba4bcb5119..78c03b49c5b 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -1026,6 +1026,7 @@ other than `\"' and `\\' in quoted strings." ;; things essentially must not be there. (while (re-search-forward "[\n\r]+" nil t) (replace-match " ")) + (setq end (point-max)) ;; Quote decoded words if there are special characters ;; which might violate RFC2822. (when (and rfc2047-quote-decoded-words-containing-tspecials @@ -1035,10 +1036,15 @@ other than `\"' and `\\' in quoted strings." (when regexp (save-restriction (widen) - (beginning-of-line) - (while (and (memq (char-after) '(? ?\t)) - (zerop (forward-line -1)))) - (looking-at regexp))))) + (and + ;; Don't quote words if already quoted. + (not (and (eq (char-before e) ?\") + (eq (char-after end) ?\"))) + (progn + (beginning-of-line) + (while (and (memq (char-after) '(? ?\t)) + (zerop (forward-line -1)))) + (looking-at regexp))))))) (let (quoted) (goto-char e) (skip-chars-forward " \t") |