aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus
diff options
context:
space:
mode:
authorVibhav Pant2017-02-13 17:07:36 +0530
committerVibhav Pant2017-02-13 17:07:36 +0530
commitcb410433e069b5bb450193353c3fea8593a643a9 (patch)
treed2f4269781b4841e5a0c27ec57a5a4fbcec386c0 /lisp/gnus
parente742450427007cdde242c11380dfe32a950fab61 (diff)
parent4b18ef7ba3dd8aae4f3c3bf931365ef7da883baf (diff)
downloademacs-feature/byte-switch.tar.gz
emacs-feature/byte-switch.zip
Merge branch 'master' into feature/byte-switchfeature/byte-switch
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/mm-bodies.el22
1 files changed, 15 insertions, 7 deletions
diff --git a/lisp/gnus/mm-bodies.el b/lisp/gnus/mm-bodies.el
index 66b9ebd0cfc..d773289722f 100644
--- a/lisp/gnus/mm-bodies.el
+++ b/lisp/gnus/mm-bodies.el
@@ -68,14 +68,14 @@ Valid encodings are `7bit', `8bit', `quoted-printable' and `base64'."
68(declare-function message-options-set "message" (symbol value)) 68(declare-function message-options-set "message" (symbol value))
69 69
70(defun mm-encode-body (&optional charset) 70(defun mm-encode-body (&optional charset)
71 "Encode a body. 71 "Encode whole buffer's contents.
72Should be called narrowed to the body that is to be encoded. 72Buffer's multibyteness will be turned off when encoding takes place.
73If there is more than one non-ASCII MULE charset in the body, then the 73If there is more than one non-ASCII MULE charset in the body, then the
74list of MULE charsets found is returned. 74list of MULE charsets found is returned.
75If CHARSET is non-nil, it is used as the MIME charset to encode the body. 75If CHARSET is non-nil, it is used as the MIME charset to encode the body.
76If successful, the MIME charset is returned. 76If successful, the MIME charset is returned.
77If no encoding was done, nil is returned." 77If no encoding was done, nil is returned."
78 (if (not (mm-multibyte-p)) 78 (if (not enable-multibyte-characters)
79 ;; In the non-Mule case, we search for non-ASCII chars and 79 ;; In the non-Mule case, we search for non-ASCII chars and
80 ;; return the value of `mail-parse-charset' if any are found. 80 ;; return the value of `mail-parse-charset' if any are found.
81 (or charset 81 (or charset
@@ -93,8 +93,12 @@ If no encoding was done, nil is returned."
93 (save-excursion 93 (save-excursion
94 (if charset 94 (if charset
95 (progn 95 (progn
96 (encode-coding-region (point-min) (point-max) 96 (insert
97 (mm-charset-to-coding-system charset)) 97 (prog1
98 (encode-coding-string (buffer-string)
99 (mm-charset-to-coding-system charset))
100 (erase-buffer)
101 (set-buffer-multibyte nil)))
98 charset) 102 charset)
99 (goto-char (point-min)) 103 (goto-char (point-min))
100 (let ((charsets (mm-find-mime-charset-region (point-min) (point-max) 104 (let ((charsets (mm-find-mime-charset-region (point-min) (point-max)
@@ -110,8 +114,12 @@ If no encoding was done, nil is returned."
110 (t 114 (t
111 (prog1 115 (prog1
112 (setq charset (car charsets)) 116 (setq charset (car charsets))
113 (encode-coding-region (point-min) (point-max) 117 (insert
114 (mm-charset-to-coding-system charset)))) 118 (prog1
119 (encode-coding-string (buffer-string)
120 (mm-charset-to-coding-system charset))
121 (erase-buffer)
122 (set-buffer-multibyte nil)))))
115 )))))) 123 ))))))
116 124
117(defun mm-long-lines-p (length) 125(defun mm-long-lines-p (length)