comparison lisp/gnus/mml.el @ 40757:bc2025610176

2001-11-05 ShengHuo ZHU <zsh@cs.rochester.edu> * mml.el (mml-generate-mime-1): Use mm-with-unibyte-current-buffer. Suggested by Dave Love <fx@gnu.org>.
author ShengHuo ZHU <zsh@cs.rochester.edu>
date Tue, 06 Nov 2001 04:28:29 +0000
parents a26d9b55abb6
children 00382536d185
comparison
equal deleted inserted replaced
40756:4c885d1ac450 40757:bc2025610176
303 (let ((raw (cdr (assq 'raw cont))) 303 (let ((raw (cdr (assq 'raw cont)))
304 coded encoding charset filename type) 304 coded encoding charset filename type)
305 (setq type (or (cdr (assq 'type cont)) "text/plain")) 305 (setq type (or (cdr (assq 'type cont)) "text/plain"))
306 (if (and (not raw) 306 (if (and (not raw)
307 (member (car (split-string type "/")) '("text" "message"))) 307 (member (car (split-string type "/")) '("text" "message")))
308 (progn
308 (with-temp-buffer 309 (with-temp-buffer
309 (cond 310 (cond
310 ((cdr (assq 'buffer cont)) 311 ((cdr (assq 'buffer cont))
311 (insert-buffer-substring (cdr (assq 'buffer cont)))) 312 (insert-buffer-substring (cdr (assq 'buffer cont))))
312 ((and (setq filename (cdr (assq 'filename cont))) 313 ((and (setq filename (cdr (assq 'filename cont)))
340 (t 341 (t
341 (setq charset (mm-encode-body)) 342 (setq charset (mm-encode-body))
342 (setq encoding (mm-body-encoding 343 (setq encoding (mm-body-encoding
343 charset (cdr (assq 'encoding cont)))))) 344 charset (cdr (assq 'encoding cont))))))
344 (setq coded (buffer-string))) 345 (setq coded (buffer-string)))
346 (mml-insert-mime-headers cont type charset encoding)
347 (insert "\n")
348 (insert coded))
345 (mm-with-unibyte-buffer 349 (mm-with-unibyte-buffer
346 (cond 350 (cond
347 ((cdr (assq 'buffer cont)) 351 ((cdr (assq 'buffer cont))
348 (insert-buffer-substring (cdr (assq 'buffer cont)))) 352 (insert-buffer-substring (cdr (assq 'buffer cont))))
349 ((and (setq filename (cdr (assq 'filename cont))) 353 ((and (setq filename (cdr (assq 'filename cont)))
351 (let ((coding-system-for-read mm-binary-coding-system)) 355 (let ((coding-system-for-read mm-binary-coding-system))
352 (mm-insert-file-contents filename nil nil nil nil t))) 356 (mm-insert-file-contents filename nil nil nil nil t)))
353 (t 357 (t
354 (insert (cdr (assq 'contents cont))))) 358 (insert (cdr (assq 'contents cont)))))
355 (setq encoding (mm-encode-buffer type) 359 (setq encoding (mm-encode-buffer type)
356 coded (buffer-string)))) 360 coded (buffer-string)))
357 (mml-insert-mime-headers cont type charset encoding) 361 (mml-insert-mime-headers cont type charset encoding)
358 (insert "\n") 362 (insert "\n")
359 (insert coded))) 363 (mm-with-unibyte-current-buffer
364 (insert coded)))))
360 ((eq (car cont) 'external) 365 ((eq (car cont) 'external)
361 (insert "Content-Type: message/external-body") 366 (insert "Content-Type: message/external-body")
362 (let ((parameters (mml-parameter-string 367 (let ((parameters (mml-parameter-string
363 cont '(expiration size permission))) 368 cont '(expiration size permission)))
364 (name (cdr (assq 'name cont)))) 369 (name (cdr (assq 'name cont))))