(require 'mm-bodies)
(require 'mm-encode)
(require 'mm-decode)
-(eval-when-compile 'cl)
+(eval-when-compile (require 'cl))
(eval-and-compile
(autoload 'message-make-message-id "message")
warn t))
(setq raw (cdr (assq 'raw tag))
point (point)
- contents (if raw
- (mm-with-unibyte-current-buffer
- (mml-read-part (eq 'mml (car tag))))
- (mml-read-part (eq 'mml (car tag))))
+ contents (mml-read-part (eq 'mml (car tag)))
charsets (if raw nil
(mm-find-mime-charset-region point (point))))
(when (and (not raw) (memq nil charsets))
(if (or (memq 'unknown-encoding mml-confirmation-set)
(y-or-n-p
- "Warning: You message contains characters with unknown encoding. Really send?"))
+ "Message contains characters with unknown encoding. Really send?"))
(if (setq use-ascii
(or (memq 'use-ascii mml-confirmation-set)
(y-or-n-p "Use ASCII as charset?")))
coded (buffer-string))))
(mml-insert-mime-headers cont type charset encoding)
(insert "\n")
- (mm-with-unibyte-current-buffer
- (insert coded))))
+ (insert coded)))
((eq (car cont) 'external)
(insert "Content-Type: message/external-body")
(let ((parameters (mml-parameter-string
"")
mml-base-boundary))
-(defun mml-make-string (num string)
- (let ((out ""))
- (while (not (zerop (decf num)))
- (setq out (concat out string)))
- out))
-
(defun mml-insert-mime-headers (cont type charset encoding)
(let (parameters disposition description)
(setq parameters
file))
(defun mml-minibuffer-read-type (name &optional default)
+ (mailcap-parse-mimetypes)
(let* ((default (or default
(mm-default-file-encoding name)
;; Perhaps here we should check what the file
"application/octet-stream"))
(string (completing-read
(format "Content type (default %s): " default)
- (mapcar
- 'list
- (mm-delete-duplicates
- (nconc
- (mapcar 'cdr mailcap-mime-extensions)
- (apply
- 'nconc
- (mapcar
- (lambda (l)
- (delq nil
- (mapcar
- (lambda (m)
- (let ((type (cdr (assq 'type (cdr m)))))
- (if (equal (cadr (split-string type "/"))
- "*")
- nil
- type)))
- (cdr l))))
- mailcap-mime-data))))))))
+ (mapcar 'list (mailcap-mime-types)))))
(if (not (equal string ""))
string
default)))
(goto-char (point-min))
;; Quote parts.
(while (re-search-forward
- "<#/?!*\\(multipart\\|part\\|external\\|mml\\)" nil t)
+ "<#!*/?\\(multipart\\|part\\|external\\|mml\\)" nil t)
;; Insert ! after the #.
(goto-char (+ (match-beginning 0) 2))
(insert "!")))))
(replace-match "\n"))
(mml-to-mime)
(if raw
- (mm-disable-multibyte)
+ (when (fboundp 'set-buffer-multibyte)
+ (let ((s (buffer-string)))
+ ;; Insert the content into unibyte buffer.
+ (erase-buffer)
+ (mm-disable-multibyte)
+ (insert s)))
(let ((gnus-newsgroup-charset (car message-posting-charset)))
(run-hooks 'gnus-article-decode-hook)
(let ((gnus-newsgroup-name "dummy"))