+2000-10-10 Yoshiki Hayashi <yoshiki@xemacs.org>
+
+ * mime-edit.el (mime-edit-insert-place): Barf if on invisible region.
+ (mime-edit-insert-tag): Ditto.
+
+ * mime-edit.el (mime-edit-insert-file): Use
+ detect-mime-charset-region.
+
2000-09-29 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
* mime-edit.el (mime-file-types): Fix to use application/msword
(defmacro mime-edit-insert-place (type-list &rest body)
`(save-excursion
+ (if (get-text-property (point) 'invisible)
+ (error "Can't split invisible region"))
(if (or (member (intern (concat (car ,type-list) "/" (cadr ,type-list)))
mime-edit-attach-at-end-type)
(member (intern (car ,type-list))
(setq candidate (if (listp candidates)
(car candidates)
candidates))
- (if (memq (static-if (featurep 'xemacs)
- (coding-system-name candidate)
- candidate)
- '(undecided undecided-unix
- undecided-dos undecided-mac))
- (setq candidate 'raw-text))
(setq eol (coding-system-eol-type candidate))
(cond ((eq eol
(static-if (featurep 'xemacs)
(while (search-forward eol-string nil t)
(replace-match "\r\n")))
(setq string (buffer-string))
+ ;; ####
+ (set-buffer-multibyte t)
+ (erase-buffer)
+ (insert (decode-coding-string string candidate))
(setq parameters
(concat parameters "; charset="
- (symbol-name
- (coding-system-to-mime-charset
- candidate)))))))
+ (symbol-name (detect-mime-charset-region
+ (point-min) (point-max))))))))
(while rest
(setq cell (car rest))
(setq attribute (car cell))
"Insert new MIME tag and return a list of PRITYPE, SUBTYPE, and PARAMETERS.
If nothing is inserted, return nil."
(interactive)
+ (if (get-text-property (point) 'invisible)
+ (error "Can't split invisible region"))
(let ((p (point)))
(mime-edit-goto-tag)
(if (and (re-search-forward mime-edit-tag-regexp nil t)