;;; mime-edit.el --- Simple MIME Composer for GNU Emacs
-;; Copyright (C) 1993,1994,1995,1996,1997 Free Software Foundation, Inc.
+;; Copyright (C) 1993,1994,1995,1996,1997,1998 Free Software Foundation, Inc.
;; Author: UMEDA Masanobu <umerin@mse.kyutech.ac.jp>
;; MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1994/08/21 renamed from mime.el
;; Renamed: 1997/2/21 from tm-edit.el
-;; Version: $Revision: 0.87 $
;; Keywords: MIME, multimedia, multilingual, mail, news
-;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
+;; This file is part of SEMI (Sophisticated Emacs MIME Interfaces).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;;
;; This is a conventional plain text. It should be translated into
;; text/plain.
-;;
+;;
;;--[[text/plain]]
;; This is also a plain text. But, it is explicitly specified as is.
;;--[[text/plain; charset=ISO-8859-1]]
;;; @ version
;;;
-(defconst mime-edit-RCS-ID
- "$Id: mime-edit.el,v 0.87 1997-09-03 04:53:10 morioka Exp $")
-
-(defconst mime-edit-version `,(get-version-string mime-edit-RCS-ID))
-
-(defconst mime-edit-version-name
- `,(concat "SEMI MIME-Edit " mime-edit-version
- " \"" semi-version-name "\""))
+(defconst mime-edit-version-string
+ `,(concat (car mime-module-version) " "
+ (mapconcat #'number-to-string (cddr mime-module-version) ".")
+ " - \"" (cadr mime-module-version) "\""))
;;; @ variables
;;;
-(defvar mime-ignore-preceding-spaces nil
- "*Ignore preceding white spaces if non-nil.")
+(defgroup mime-edit nil
+ "MIME edit mode"
+ :group 'mime)
+
+(defcustom mime-ignore-preceding-spaces nil
+ "*Ignore preceding white spaces if non-nil."
+ :group 'mime-edit
+ :type 'boolean)
-(defvar mime-ignore-trailing-spaces nil
- "*Ignore trailing white spaces if non-nil.")
+(defcustom mime-ignore-trailing-spaces nil
+ "*Ignore trailing white spaces if non-nil."
+ :group 'mime-edit
+ :type 'boolean)
-(defvar mime-ignore-same-text-tag t
+(defcustom mime-ignore-same-text-tag t
"*Ignore preceding text content-type tag that is same with new one.
-If non-nil, the text tag is not inserted unless something different.")
+If non-nil, the text tag is not inserted unless something different."
+ :group 'mime-edit
+ :type 'boolean)
-(defvar mime-auto-hide-body t
- "*Hide non-textual body encoded in base64 after insertion if non-nil.")
+(defcustom mime-auto-hide-body t
+ "*Hide non-textual body encoded in base64 after insertion if non-nil."
+ :group 'mime-edit
+ :type 'boolean)
-(defvar mime-edit-voice-recorder
+(defcustom mime-edit-voice-recorder
(function mime-edit-voice-recorder-for-sun)
- "*Function to record a voice message and encode it.")
+ "*Function to record a voice message and encode it."
+ :group 'mime-edit
+ :type 'function)
-(defvar mime-edit-mode-hook nil
- "*Hook called when enter MIME mode.")
+(defcustom mime-edit-mode-hook nil
+ "*Hook called when enter MIME mode."
+ :group 'mime-edit
+ :type 'hook)
-(defvar mime-edit-translate-hook nil
+(defcustom mime-edit-translate-hook nil
"*Hook called before translating into a MIME compliant message.
To insert a signature file automatically, call the function
-`mime-edit-insert-signature' from this hook.")
+`mime-edit-insert-signature' from this hook."
+ :group 'mime-edit
+ :type 'hook)
-(defvar mime-edit-exit-hook nil
- "*Hook called when exit MIME mode.")
+(defcustom mime-edit-exit-hook nil
+ "*Hook called when exit MIME mode."
+ :group 'mime-edit
+ :type 'hook)
(defvar mime-content-types
'(("text"
)
"*Alist of content-type, subtype, parameters and its values.")
-(defvar mime-file-types
- '(("\\.rtf$"
+(defcustom mime-file-types
+ '(("\\.txt$"
+ "text" "plain" nil
+ nil
+ "inline" (("filename" . file))
+ )
+ ("\\.pln$"
+ "text" "plain" nil
+ nil
+ "inline" (("filename" . file))
+ )
+ ("\\.rtf$"
"text" "richtext" nil
nil
nil nil)
"attachment" (("filename" . file))
)
("\\.signature"
- "text" "plain" nil nil)
+ "text" "plain" nil nil nil nil)
(".*"
"application" "octet-stream" nil
nil
- "attachment" (("filename" . file))
- )
+ "attachment" (("filename" . file)))
)
"*Alist of file name, types, parameters, and default encoding.
-If encoding is nil, it is determined from its contents.")
+If encoding is nil, it is determined from its contents."
+ :type `(repeat
+ (list regexp
+ ;; primary-type
+ (choice :tag "Primary-Type"
+ ,@(nconc (mapcar (lambda (cell)
+ (list 'item (car cell))
+ )
+ mime-content-types)
+ '(string)))
+ ;; subtype
+ (choice :tag "Sub-Type"
+ ,@(nconc
+ (apply #'nconc
+ (mapcar (lambda (cell)
+ (mapcar (lambda (cell)
+ (list 'item (car cell))
+ )
+ (cdr cell)))
+ mime-content-types))
+ '(string)))
+ ;; parameters
+ (repeat :tag "Parameters of Content-Type field"
+ (cons string (choice string symbol)))
+ ;; content-transfer-encoding
+ (choice :tag "Encoding"
+ ,@(cons
+ '(const nil)
+ (mapcar (lambda (cell)
+ (list 'item (car cell))
+ )
+ mime-file-encoding-method-alist)))
+ ;; disposition-type
+ (choice :tag "Disposition-Type"
+ (item nil)
+ (item "inline")
+ (item "attachment")
+ string)
+ ;; parameters
+ (repeat :tag "Parameters of Content-Disposition field"
+ (cons string (choice string symbol)))
+ ))
+ :group 'mime-edit)
;;; @@ about charset, encoding and transfer-level
;;; @@ about message splitting
;;;
-(defvar mime-edit-split-message t
- "*Split large message if it is non-nil.")
+(defcustom mime-edit-split-message t
+ "*Split large message if it is non-nil."
+ :group 'mime-edit
+ :type 'boolean)
-(defvar mime-edit-message-default-max-lines 1000
- "*Default maximum lines of a message.")
+(defcustom mime-edit-message-default-max-lines 1000
+ "*Default maximum lines of a message."
+ :group 'mime-edit
+ :type 'integer)
-(defvar mime-edit-message-max-lines-alist
+(defcustom mime-edit-message-max-lines-alist
'((news-reply-mode . 500))
"Alist of major-mode vs maximum lines of a message.
If it is not specified for a major-mode,
-`mime-edit-message-default-max-lines' is used.")
+`mime-edit-message-default-max-lines' is used."
+ :group 'mime-edit
+ :type 'list)
(defconst mime-edit-split-ignored-field-regexp
- "\\(^Content-\\|^Subject:\\|^Mime-Version:\\)")
+ "\\(^Content-\\|^Subject:\\|^Mime-Version:\\|Message-Id:\\)")
(defvar mime-edit-split-blind-field-regexp
"\\(^[BDFbdf]cc:\\|^cc:[ \t]*$\\)")
"*If non-nil, insert X-Emacs header field.")
(defvar mime-edit-x-emacs-value
- (if running-xemacs
- (concat emacs-version
- (if (featurep 'mule)
- " with mule"
- " without mule"))
+ (if (featurep 'xemacs)
+ (concat emacs-version (if (featurep 'mule)
+ " with mule"
+ " without mule"))
(let ((ver (if (string-match "\\.[0-9]+$" emacs-version)
(substring emacs-version 0 (match-beginning 0))
emacs-version)))
(if (featurep 'mule)
- (concat "Emacs " ver ", MULE " mule-version)
- ver))))
+ (concat "Emacs " ver
+ (if enable-multibyte-characters
+ (concat ", MULE " mule-version)
+ " (with raw setting)")
+ (if (featurep 'meadow)
+ (concat ", " (Meadow-version))
+ ))
+ ver)))
+ "Body of X-Emacs field.
+If variable `mime-edit-insert-x-emacs-field' is not nil, it is
+inserted into message header.")
\f
;;; @ constants
Tspecials means any character that matches with it in header must be quoted.")
(defconst mime-edit-mime-version-value
- (concat "1.0 (generated by " mime-edit-version-name ")")
+ (concat "1.0 (generated by " mime-edit-version-string ")")
"MIME version number.")
+(defconst mime-edit-mime-version-field-for-message/partial
+ (concat "MIME-Version: 1.0 (split by " mime-edit-version-string ")\n")
+ "MIME version field for message/partial.")
+
;;; @ keymap and menu
;;;
(defvar mime-edit-mode-flag nil)
(make-variable-buffer-local 'mime-edit-mode-flag)
+(defvar mime-edit-mode-entity-prefix "\C-c\C-x"
+ "Keymap prefix for MIME-Edit mode commands to insert entity or set status.")
+(defvar mime-edit-mode-entity-map (make-sparse-keymap)
+ "Keymap for MIME-Edit mode commands to insert entity or set status.")
+
+(define-key mime-edit-mode-entity-map "\C-t" 'mime-edit-insert-text)
+(define-key mime-edit-mode-entity-map "\C-i" 'mime-edit-insert-file)
+(define-key mime-edit-mode-entity-map "\C-e" 'mime-edit-insert-external)
+(define-key mime-edit-mode-entity-map "\C-v" 'mime-edit-insert-voice)
+(define-key mime-edit-mode-entity-map "\C-y" 'mime-edit-insert-message)
+(define-key mime-edit-mode-entity-map "\C-m" 'mime-edit-insert-mail)
+(define-key mime-edit-mode-entity-map "\C-w" 'mime-edit-insert-signature)
+(define-key mime-edit-mode-entity-map "\C-s" 'mime-edit-insert-signature)
+(define-key mime-edit-mode-entity-map "\C-k" 'mime-edit-insert-key)
+(define-key mime-edit-mode-entity-map "t" 'mime-edit-insert-tag)
+
+(define-key mime-edit-mode-entity-map "7" 'mime-edit-set-transfer-level-7bit)
+(define-key mime-edit-mode-entity-map "8" 'mime-edit-set-transfer-level-8bit)
+(define-key mime-edit-mode-entity-map "/" 'mime-edit-set-split)
+(define-key mime-edit-mode-entity-map "s" 'mime-edit-set-sign)
+(define-key mime-edit-mode-entity-map "v" 'mime-edit-set-sign)
+(define-key mime-edit-mode-entity-map "e" 'mime-edit-set-encrypt)
+(define-key mime-edit-mode-entity-map "h" 'mime-edit-set-encrypt)
+(define-key mime-edit-mode-entity-map "p" 'mime-edit-preview-message)
+(define-key mime-edit-mode-entity-map "\C-z" 'mime-edit-exit)
+(define-key mime-edit-mode-entity-map "?" 'mime-edit-help)
+
+(defvar mime-edit-mode-enclosure-prefix "\C-c\C-m"
+ "Keymap prefix for MIME-Edit mode commands about enclosure.")
+(defvar mime-edit-mode-enclosure-map (make-sparse-keymap)
+ "Keymap for MIME-Edit mode commands about enclosure.")
+
+(define-key mime-edit-mode-enclosure-map
+ "\C-a" 'mime-edit-enclose-alternative-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-p" 'mime-edit-enclose-parallel-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-m" 'mime-edit-enclose-mixed-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-d" 'mime-edit-enclose-digest-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-s" 'mime-edit-enclose-signed-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-e" 'mime-edit-enclose-encrypted-region)
+(define-key mime-edit-mode-enclosure-map
+ "\C-q" 'mime-edit-enclose-quote-region)
+
(defvar mime-edit-mode-map (make-sparse-keymap)
"Keymap for MIME-Edit mode commands.")
-
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-t" 'mime-edit-insert-text)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-i" 'mime-edit-insert-file)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-e" 'mime-edit-insert-external)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-v" 'mime-edit-insert-voice)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-y" 'mime-edit-insert-message)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-m" 'mime-edit-insert-mail)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-w" 'mime-edit-insert-signature)
(define-key mime-edit-mode-map
- "\C-c\C-x\C-s" 'mime-edit-insert-signature)
+ mime-edit-mode-entity-prefix mime-edit-mode-entity-map)
(define-key mime-edit-mode-map
- "\C-c\C-x\C-k" 'mime-edit-insert-key)
-(define-key mime-edit-mode-map
- "\C-c\C-xt" 'mime-edit-insert-tag)
-
-(define-key mime-edit-mode-map
- "\C-c\C-m\C-a" 'mime-edit-enclose-alternative-region)
-(define-key mime-edit-mode-map
- "\C-c\C-m\C-p" 'mime-edit-enclose-parallel-region)
-(define-key mime-edit-mode-map
- "\C-c\C-m\C-m" 'mime-edit-enclose-mixed-region)
-(define-key mime-edit-mode-map
- "\C-c\C-m\C-d" 'mime-edit-enclose-digest-region)
-(define-key mime-edit-mode-map
- "\C-c\C-m\C-s" 'mime-edit-enclose-signed-region)
-(define-key mime-edit-mode-map
- "\C-c\C-m\C-e" 'mime-edit-enclose-encrypted-region)
-(define-key mime-edit-mode-map
- "\C-c\C-m\C-q" 'mime-edit-enclose-quote-region)
-
-(define-key mime-edit-mode-map
- "\C-c\C-x7" 'mime-edit-set-transfer-level-7bit)
-(define-key mime-edit-mode-map
- "\C-c\C-x8" 'mime-edit-set-transfer-level-8bit)
-(define-key mime-edit-mode-map
- "\C-c\C-x/" 'mime-edit-set-split)
-(define-key mime-edit-mode-map
- "\C-c\C-xs" 'mime-edit-set-sign)
-(define-key mime-edit-mode-map
- "\C-c\C-xv" 'mime-edit-set-sign)
-(define-key mime-edit-mode-map
- "\C-c\C-xe" 'mime-edit-set-encrypt)
-(define-key mime-edit-mode-map
- "\C-c\C-xh" 'mime-edit-set-encrypt)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-p" 'mime-edit-preview-message)
-(define-key mime-edit-mode-map
- "\C-c\C-x\C-z" 'mime-edit-exit)
-(define-key mime-edit-mode-map
- "\C-c\C-x?" 'mime-edit-help)
+ mime-edit-mode-enclosure-prefix mime-edit-mode-enclosure-map)
(defconst mime-edit-menu-title "MIME-Edit")
))
mime-edit-menu-list)))
)))
-
+
;; modified by Steven L. Baur <steve@miranova.com>
;; 1995/12/6 (c.f. [tm-en:209])
(or (boundp 'mime-edit-popup-menu-for-xemacs)
(if mime-edit-mode-flag
(error "You are already editing a MIME message.")
(setq mime-edit-mode-flag t)
-
+
;; Set transfer level into mode line
;;
(setq mime-transfer-level-string
(mime-encoding-name mime-transfer-level 'not-omit))
(force-mode-line-update)
-
+
;; Define menu for XEmacs.
(if running-xemacs
(mime-edit-define-menu-for-xemacs)
)
-
+
(enable-invisible)
-
+
;; I don't care about saving these.
(setq paragraph-start
(regexp-or mime-edit-single-part-tag-regexp
(princ (documentation 'mime-edit-mode))
(print-help-return-message)))
-(defun mime-edit-insert-text ()
+(defun mime-edit-insert-text (&optional subtype)
"Insert a text message.
-Charset is automatically obtained from the `charsets-mime-charset-alist'."
+Charset is automatically obtained from the `charsets-mime-charset-alist'.
+If optional argument SUBTYPE is not nil, text/SUBTYPE tag is inserted."
(interactive)
- (let ((ret (mime-edit-insert-tag "text" nil nil)))
- (if ret
- (progn
- (if (looking-at mime-edit-single-part-tag-regexp)
- (progn
- ;; Make a space between the following message.
- (insert "\n")
- (forward-char -1)
- ))
- (if (and (member (second ret) '("enriched" "richtext"))
- (fboundp 'enriched-mode)
- )
- (enriched-mode t)
- (if (boundp 'enriched-mode)
- (enriched-mode nil)
- ))))))
+ (let ((ret (mime-edit-insert-tag "text" subtype nil)))
+ (when ret
+ (if (looking-at mime-edit-single-part-tag-regexp)
+ (progn
+ ;; Make a space between the following message.
+ (insert "\n")
+ (forward-char -1)
+ ))
+ (if (and (member (cadr ret) '("enriched" "richtext"))
+ (fboundp 'enriched-mode)
+ )
+ (enriched-mode t)
+ (if (boundp 'enriched-mode)
+ (enriched-mode -1)
+ ))
+ )))
(defun mime-edit-insert-file (file &optional verbose)
"Insert a message from a file."
(let ((signature-insert-hook
(function
(lambda ()
- (apply (function mime-edit-insert-tag)
- (mime-find-file-type signature-file-name))
+ (let ((items (mime-find-file-type signature-file-name)))
+ (apply (function mime-edit-insert-tag)
+ (car items) (cadr items) (list (caddr items))))
)))
)
(insert-signature arg)
(t
(goto-char (point-max))
))
- ;; Then search for the beginning.
+ ;; Then search for the beginning.
(re-search-backward mime-edit-end-tag-regexp nil t)
(or (looking-at mime-edit-beginning-tag-regexp)
;; Restore previous point.
(insert mime-edit-x-emacs-value)
))
;; Make primary MIME headers.
- (or (mail-position-on-field "Mime-Version")
+ (or (mail-position-on-field "MIME-Version")
(insert mime-edit-mime-version-value))
;; Remove old Content-Type and other fields.
(save-restriction
(save-restriction
(narrow-to-region beg (mime-edit-content-end))
(goto-char beg)
- (if (re-search-forward "^From " nil t)
- (unless encoding
- (if (memq charset '(iso-2022-jp
- iso-2022-jp-2
- iso-2022-int-1
- x-ctext))
- (while (progn
- (replace-match "\e(BFrom ")
- (re-search-forward "^From " nil t)
- ))
- (setq encoding "quoted-printable")
- ))))
+ (let (case-fold-search)
+ (if (re-search-forward "^From " nil t)
+ (unless encoding
+ (if (memq charset '(iso-2022-jp
+ iso-2022-jp-2
+ iso-2022-int-1
+ x-ctext))
+ (while (progn
+ (replace-match "\e(BFrom ")
+ (re-search-forward "^From " nil t)
+ ))
+ (setq encoding "quoted-printable")
+ )))))
;; canonicalize line break code
(or (member encoding '(nil "7bit" "8bit" "quoted-printable"))
(save-restriction
;;; @ multipart enclosure
;;;
-(defun mime-edit-enclose-region (type beg end)
+(defun mime-edit-enclose-region-internal (type beg end)
(save-excursion
(goto-char beg)
(let ((current (point)))
(defun mime-edit-enclose-quote-region (beg end)
(interactive "*r")
- (mime-edit-enclose-region "quote" beg end)
+ (mime-edit-enclose-region-internal 'quote beg end)
)
(defun mime-edit-enclose-mixed-region (beg end)
(interactive "*r")
- (mime-edit-enclose-region "mixed" beg end)
+ (mime-edit-enclose-region-internal 'mixed beg end)
)
(defun mime-edit-enclose-parallel-region (beg end)
(interactive "*r")
- (mime-edit-enclose-region "parallel" beg end)
+ (mime-edit-enclose-region-internal 'parallel beg end)
)
(defun mime-edit-enclose-digest-region (beg end)
(interactive "*r")
- (mime-edit-enclose-region "digest" beg end)
+ (mime-edit-enclose-region-internal 'digest beg end)
)
(defun mime-edit-enclose-alternative-region (beg end)
(interactive "*r")
- (mime-edit-enclose-region "alternative" beg end)
+ (mime-edit-enclose-region-internal 'alternative beg end)
)
(defun mime-edit-enclose-signed-region (beg end)
(interactive "*r")
(if mime-edit-signing-type
- (mime-edit-enclose-region "signed" beg end)
+ (mime-edit-enclose-region-internal 'signed beg end)
(message "Please specify signing type.")
))
(defun mime-edit-enclose-encrypted-region (beg end)
(interactive "*r")
(if mime-edit-signing-type
- (mime-edit-enclose-region "encrypted" beg end)
+ (mime-edit-enclose-region-internal 'encrypted beg end)
(message "Please specify encrypting type.")
))
(defun mime-edit-set-split (arg)
(interactive
(list
- (y-or-n-p "Do you want to enable split?")
+ (y-or-n-p "Do you want to enable split? ")
))
(setq mime-edit-split-message arg)
(if arg
(defun mime-edit-set-sign (arg)
(interactive
(list
- (y-or-n-p "Do you want to sign?")
+ (y-or-n-p "Do you want to sign? ")
))
(if arg
(if mime-edit-signing-type
(defun mime-edit-set-encrypt (arg)
(interactive
(list
- (y-or-n-p "Do you want to encrypt?")
+ (y-or-n-p "Do you want to encrypt? ")
))
(if arg
(if mime-edit-encrypting-type
;;; @ split
;;;
-(defun mime-edit-insert-partial-header
- (fields subject id number total separator)
+(defun mime-edit-insert-partial-header (fields subject
+ id number total separator)
(insert fields)
(insert (format "Subject: %s (%d/%d)\n" subject number total))
- (insert (format "Mime-Version: 1.0 (split by %s)\n"
- mime-edit-version-name))
+ (insert mime-edit-mime-version-field-for-message/partial)
(insert (format "\
Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
id number total separator))
(or (cdr (assq major-mode mime-edit-message-max-lines-alist))
mime-edit-message-default-max-lines))
)
- (let* ((mime-edit-draft-file-name
+ (let* ((mime-edit-draft-file-name
(or (buffer-file-name)
(make-temp-name
(expand-file-name "mime-draft" mime-temp-directory))))
(setq mail-header-separator separator)
(make-local-variable 'mime-edit-buffer)
(setq mime-edit-buffer the-buf)
-
+
(run-hooks 'mime-edit-translate-hook)
(mime-edit-translate-buffer)
(goto-char (point-min))
"Quitting method for mime-view."
(let ((temp mime-raw-buffer)
buf)
- (mime-view-kill-buffer)
+ (mime-preview-kill-buffer)
(set-buffer temp)
(setq buf mime-edit-buffer)
(kill-buffer temp)
(switch-to-buffer buf)
))
-(set-alist 'mime-view-quitting-method-alist
+(set-alist 'mime-preview-quitting-method-alist
'mime-temp-message-mode
- (function mime-edit-quitting-method)
- )
+ #'mime-edit-quitting-method)
;;; @ edit again
(goto-char (point-min))
(let ((ctl (mime-read-Content-Type)))
(if ctl
- (let ((ctype (car ctl))
- (params (cdr ctl))
- type stype)
- (if (string-match "/" ctype)
- (progn
- (setq type (substring ctype 0 (match-beginning 0)))
- (setq stype (substring ctype (match-end 0)))
- )
- (setq type ctype)
- )
+ (let ((type (car ctl))
+ (stype (car (cdr ctl)))
+ (params (cdr (cdr ctl)))
+ )
(cond
- ((string= ctype "application/pgp-signature")
+ ((and (eq type 'application)(eq stype 'pgp-signature))
(delete-region (point-min)(point-max))
)
- ((string= type "multipart")
+ ((eq type 'multipart)
(let* ((boundary (cdr (assoc "boundary" params)))
(boundary-pat
(concat "\n--" (regexp-quote boundary) "[ \t]*\n"))
)))
))
(t
- (let* (charset
+ (let* ((ctype (format "%s/%s" type stype))
+ charset
(pstr
(let ((bytes (+ 14 (length ctype))))
(mapconcat (function
(lambda (attr)
- (if (string-equal (car attr) "charset")
+ (if (string= (car attr) "charset")
(progn
(setq charset (cdr attr))
"")
(eliminate-top-spaces
(std11-unfold-string
(buffer-substring hbeg end))))
- (if (or charset (string-equal type "text"))
+ (if (or charset (eq type 'text))
(progn
(delete-region beg (1+ end))
(goto-char (point-min))
(insert
(concat "\n"
(mime-create-tag
- (concat type "/" stype pstr) encoding)))
+ (format "%s/%s%s" type stype pstr)
+ encoding)))
)
(delete-region (point-min) he)
(insert
(mime-create-tag
- (concat type "/" stype pstr) encoding))
+ (format "%s/%s%s" type stype pstr)
+ encoding))
))
))))
(or not-decode-text