From: hayashi Date: Tue, 10 Oct 2000 04:57:32 +0000 (+0000) Subject: * mime-edit.el (mime-edit-insert-place): Barf if on invisible region. X-Git-Tag: emy-1_13_9~2 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0d4fd9b9fbdfda48f76777c66860133e6a7a554;p=elisp%2Fsemi.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 0f370f6..b741067 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2000-10-10 Yoshiki Hayashi + + * 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 * mime-edit.el (mime-file-types): Fix to use application/msword diff --git a/mime-edit.el b/mime-edit.el index a02af71..8e60b9b 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -816,6 +816,8 @@ Tspecials means any character that matches with it in header must be quoted.") (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)) @@ -1164,12 +1166,6 @@ Content-Transfer-Encoding and Content-Disposition headers." (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) @@ -1186,11 +1182,14 @@ Content-Transfer-Encoding and Content-Disposition headers." (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)) @@ -1281,6 +1280,8 @@ Content-Transfer-Encoding and Content-Disposition headers." "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)