aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/gnus/mm-encode.el
diff options
context:
space:
mode:
authorKatsumi Yamaoka2009-09-09 09:28:43 +0000
committerKatsumi Yamaoka2009-09-09 09:28:43 +0000
commitde0bdfe7aa97030b6174aba37f245c2bbf2d4ee5 (patch)
treed7955a763d1bb94432682f813ee6cc4eedb76bf5 /lisp/gnus/mm-encode.el
parentf9b7b5acb56f3d7a785d079eb13318e33bca9047 (diff)
downloademacs-de0bdfe7aa97030b6174aba37f245c2bbf2d4ee5.tar.gz
emacs-de0bdfe7aa97030b6174aba37f245c2bbf2d4ee5.zip
2009-09-09 Katsumi Yamaoka <yamaoka@jpl.org>
* gnus-util.el (gnus-float-time): Alias to float-time if it exists. * ecomplete.el (with-no-warnings): Define it for old Emacsen. (ecomplete-add-item): Don't use (featurep 'xemacs) to check if float-time is available; suppress compile warning for time-to-seconds. 2009-09-07 Katsumi Yamaoka <yamaoka@jpl.org> * mm-encode.el (mm-encode-buffer): Don't force 7bit encoding since MTA may break data. Suggested by Dmitri Paduchikh <dpaduch@k66.ru>. Add the optional argument `encoding' that overrides the default. * mml.el (mml-generate-mime-1): Pass encoding defined by a user to mm-encode-buffer. 2009-09-02 Karl Kleinpaste <karl@kleinpaste.org> * gnus-art.el (gnus-article-read-summary-keys): Fix gnus-buffer-configuration's value temporarily used.
Diffstat (limited to 'lisp/gnus/mm-encode.el')
-rw-r--r--lisp/gnus/mm-encode.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/gnus/mm-encode.el b/lisp/gnus/mm-encode.el
index 39b83ff1c3c..0d41caaf484 100644
--- a/lisp/gnus/mm-encode.el
+++ b/lisp/gnus/mm-encode.el
@@ -137,22 +137,19 @@ ENCODING can be: nil (do nothing); one of `quoted-printable', `base64';
137 (t 137 (t
138 (error "Unknown encoding %s" encoding)))) 138 (error "Unknown encoding %s" encoding))))
139 139
140(defun mm-encode-buffer (type) 140(defun mm-encode-buffer (type &optional encoding)
141 "Encode the buffer which contains data of MIME type TYPE. 141 "Encode the buffer which contains data of MIME type TYPE by ENCODING.
142TYPE is a string or a list of the components. 142TYPE is a string or a list of the components.
143The optional ENCODING overrides the encoding determined according to
144TYPE and `mm-content-transfer-encoding-defaults'.
143The encoding used is returned." 145The encoding used is returned."
144 (let* ((mime-type (if (stringp type) type (car type))) 146 (let ((mime-type (if (stringp type) type (car type))))
145 (encoding 147 (mm-encode-content-transfer-encoding
146 (or (and (listp type) 148 (or encoding
147 (cadr (assq 'encoding type))) 149 (setq encoding (or (and (listp type)
148 (mm-content-transfer-encoding mime-type))) 150 (cadr (assq 'encoding type)))
149 (bits (mm-body-7-or-8))) 151 (mm-content-transfer-encoding mime-type))))
150 ;; We force buffers that are 7bit to be unencoded, no matter 152 mime-type)
151 ;; what the preferred encoding is.
152 ;; Only if the buffers don't contain lone lines.
153 (when (and (eq bits '7bit) (not (mm-long-lines-p 76)))
154 (setq encoding bits))
155 (mm-encode-content-transfer-encoding encoding mime-type)
156 encoding)) 153 encoding))
157 154
158(defun mm-insert-headers (type encoding &optional file) 155(defun mm-insert-headers (type encoding &optional file)