From 5bd3a0247ca55b4f345c247a60a75e1ea286526a Mon Sep 17 00:00:00 2001 From: yamaoka Date: Mon, 12 Jul 2004 02:57:27 +0000 Subject: [PATCH] Synch to No Gnus 200407120257. --- lisp/ChangeLog | 5 +++++ lisp/rfc2047.el | 18 ++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8931a44..bc527ad 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-07-12 Katsumi Yamaoka + + * rfc2047.el (rfc2047-encode-region): Treat backslash-quoted + characters as non-special. + 2004-07-09 Simon Josefsson * gnus-agent.el (gnus-agent-synchronize-flags): Revert to ask. diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index 3b76718..bcbf9ae 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -292,7 +292,7 @@ Dynamically bind `rfc2047-encoding-type' to change that." "[^\000-\177]+\\|=\\?" "[^\000-\177]+")) start ; start of current token - end begin + end begin csyntax ;; Whether there's an encoded word before the current token, ;; either immediately or separated by space. last-encoded @@ -330,7 +330,7 @@ Dynamically bind `rfc2047-encoding-type' to change that." (cond ((not (char-after))) ; eob ;; else token start - ((eq ?\" (char-syntax (char-after))) + ((eq ?\" (setq csyntax (char-syntax (char-after)))) ;; Quoted word. (forward-sexp) (setq end (point)) @@ -357,14 +357,14 @@ Dynamically bind `rfc2047-encoding-type' to change that." (rfc2047-encode start (- end 2)) (setq last-encoded t)) ; record that it was encoded (setq last-encoded nil))) - ((eq ?. (char-syntax (char-after))) + ((eq ?. csyntax) ;; Skip other delimiters, but record that they've ;; potentially separated quoted words. (forward-char) (setq last-encoded nil)) - ((eq ?\) (char-syntax (char-after))) + ((eq ?\) csyntax) (error "Unbalanced parentheses")) - ((eq ?\( (char-syntax (char-after))) + ((eq ?\( csyntax) ;; Look for the end of parentheses. (forward-list) ;; Encode text as an unstructured field. @@ -380,7 +380,13 @@ Dynamically bind `rfc2047-encoding-type' to change that." (when (looking-at "[\000-\177]+") (setq begin (point) end (match-end 0)) - (if (re-search-forward "[ \t\n]\\|\\Sw" end 'move) + (if (progn + (while (and (re-search-forward "[ \t\n]\\|\\Sw" + end 'move) + (eq ?\\ (char-syntax (char-before)))) + ;; Skip backslash-quoted characters. + (forward-char)) + (< (point) end)) (progn (setq end (match-beginning 0)) (if rfc2047-encode-encoded-words -- 1.7.10.4