comparison lisp/vm/vm-mime.el @ 140:585fb297b004 r20-2b4

Import from CVS: tag r20-2b4
author cvs
date Mon, 13 Aug 2007 09:32:43 +0200
parents b980b6286996
children 2af401a6ecca
comparison
equal deleted inserted replaced
139:2b5203979d01 140:585fb297b004
823 ;; scroll in place messes with scroll-up and this loses 823 ;; scroll in place messes with scroll-up and this loses
824 (defvar scroll-in-place) 824 (defvar scroll-in-place)
825 (make-local-variable 'scroll-in-place) 825 (make-local-variable 'scroll-in-place)
826 (setq scroll-in-place nil) 826 (setq scroll-in-place nil)
827 (and vm-xemacs-mule-p 827 (and vm-xemacs-mule-p
828 (set-file-coding-system 'binary t)) 828 (set-buffer-file-coding-system 'binary t))
829 (cond (vm-fsfemacs-19-p 829 (cond (vm-fsfemacs-19-p
830 ;; need to do this outside the let because 830 ;; need to do this outside the let because
831 ;; loading disp-table initializes 831 ;; loading disp-table initializes
832 ;; standard-display-table. 832 ;; standard-display-table.
833 (require 'disp-table) 833 (require 'disp-table)
857 ;; wrong. 857 ;; wrong.
858 (vm-vheaders-of real-m) 858 (vm-vheaders-of real-m)
859 (set-buffer b) 859 (set-buffer b)
860 (widen) 860 (widen)
861 (let ((buffer-read-only nil) 861 (let ((buffer-read-only nil)
862 ;; disable read-only text properties
863 (inhibit-read-only t)
862 (modified (buffer-modified-p))) 864 (modified (buffer-modified-p)))
863 (unwind-protect 865 (unwind-protect
864 (progn 866 (progn
865 (erase-buffer) 867 (erase-buffer)
866 (insert-buffer-substring (vm-buffer-of real-m) 868 (insert-buffer-substring (vm-buffer-of real-m)
888 (setcar vm-message-pointer mm))))) 890 (setcar vm-message-pointer mm)))))
889 891
890 (fset 'vm-presentation-mode 'vm-mode) 892 (fset 'vm-presentation-mode 'vm-mode)
891 (put 'vm-presentation-mode 'mode-class 'special) 893 (put 'vm-presentation-mode 'mode-class 'special)
892 894
893 (defvar file-coding-system) 895 (defvar buffer-file-coding-system)
894 896
895 (defun vm-determine-proper-charset (beg end) 897 (defun vm-determine-proper-charset (beg end)
896 (save-excursion 898 (save-excursion
897 (save-restriction 899 (save-restriction
898 (narrow-to-region beg end) 900 (narrow-to-region beg end)
902 (let ((charsets (delq 'ascii (charsets-in-region beg end)))) 904 (let ((charsets (delq 'ascii (charsets-in-region beg end))))
903 (cond ((null charsets) 905 (cond ((null charsets)
904 "us-ascii") 906 "us-ascii")
905 ((cdr charsets) 907 ((cdr charsets)
906 (or (car (cdr 908 (or (car (cdr
907 (assoc (coding-system-name file-coding-system) 909 (assq (coding-system-name
908 vm-mime-mule-coding-to-charset-alist))) 910 buffer-file-coding-system)
911 vm-mime-mule-coding-to-charset-alist)))
909 "iso-2022-jp")) 912 "iso-2022-jp"))
910 (t 913 (t
911 (or (car (cdr 914 (or (car (cdr
912 (assoc 915 (assoc
913 (car charsets) 916 (car charsets)
1339 (vm-mime-insert-mime-body layout) 1342 (vm-mime-insert-mime-body layout)
1340 (setq end (point-marker)) 1343 (setq end (point-marker))
1341 (vm-mime-transfer-decode-region layout start end) 1344 (vm-mime-transfer-decode-region layout start end)
1342 (setq tempfile (vm-make-tempfile-name)) 1345 (setq tempfile (vm-make-tempfile-name))
1343 (let ((buffer-file-type buffer-file-type) 1346 (let ((buffer-file-type buffer-file-type)
1344 file-coding-system) 1347 buffer-file-coding-system)
1345 ;; Tell DOS/Windows NT whether the file is binary 1348 ;; Tell DOS/Windows NT whether the file is binary
1346 (setq buffer-file-type (not (vm-mime-text-type-p layout))) 1349 (setq buffer-file-type (not (vm-mime-text-type-p layout)))
1347 ;; Tell XEmacs/MULE not to mess with the bits unless 1350 ;; Tell XEmacs/MULE not to mess with the bits unless
1348 ;; this is a text type. 1351 ;; this is a text type.
1349 (if vm-xemacs-mule-p 1352 (if vm-xemacs-mule-p
1350 (if (vm-mime-text-type-p layout) 1353 (if (vm-mime-text-type-p layout)
1351 (set-file-coding-system 'no-conversion nil) 1354 (set-buffer-file-coding-system 'no-conversion nil)
1352 (set-file-coding-system 'binary t))) 1355 (set-buffer-file-coding-system 'binary t)))
1353 (write-region start end tempfile nil 0)) 1356 (write-region start end tempfile nil 0))
1354 (delete-region start end) 1357 (delete-region start end)
1355 (save-excursion 1358 (save-excursion
1356 (vm-select-folder-buffer) 1359 (vm-select-folder-buffer)
1357 (setq vm-folder-garbage-alist 1360 (setq vm-folder-garbage-alist
1530 (fset 'vm-mime-display-button-message/news 1533 (fset 'vm-mime-display-button-message/news
1531 'vm-mime-display-button-message/rfc822) 1534 'vm-mime-display-button-message/rfc822)
1532 1535
1533 (defun vm-mime-display-internal-message/rfc822 (layout) 1536 (defun vm-mime-display-internal-message/rfc822 (layout)
1534 (if (vectorp layout) 1537 (if (vectorp layout)
1535 (vm-mime-display-internal-text/plain layout) 1538 (let ((start (point)))
1539 (vm-mime-insert-mime-headers layout)
1540 (insert ?\n)
1541 (save-restriction
1542 (narrow-to-region start (point))
1543 (vm-decode-mime-encoded-words))
1544 (vm-mime-display-internal-multipart/mixed layout))
1536 (goto-char (vm-extent-start-position layout)) 1545 (goto-char (vm-extent-start-position layout))
1537 (setq layout (vm-extent-property layout 'vm-mime-layout)) 1546 (setq layout (vm-extent-property layout 'vm-mime-layout))
1538 (set-buffer (generate-new-buffer 1547 (set-buffer (generate-new-buffer
1539 (format "message from %s/%s" 1548 (format "message from %s/%s"
1540 (buffer-name vm-mail-buffer) 1549 (buffer-name vm-mail-buffer)
1929 (setq buffer-file-type (not (vm-mime-text-type-p layout))) 1938 (setq buffer-file-type (not (vm-mime-text-type-p layout)))
1930 ;; Tell XEmacs/MULE not to mess with the bits unless 1939 ;; Tell XEmacs/MULE not to mess with the bits unless
1931 ;; this is a text type. 1940 ;; this is a text type.
1932 (if vm-xemacs-mule-p 1941 (if vm-xemacs-mule-p
1933 (if (vm-mime-text-type-p layout) 1942 (if (vm-mime-text-type-p layout)
1934 (set-file-coding-system 'no-conversion nil) 1943 (set-buffer-file-coding-system 'no-conversion nil)
1935 (set-file-coding-system 'binary t))) 1944 (set-buffer-file-coding-system 'binary t)))
1936 (vm-mime-insert-mime-body layout) 1945 (vm-mime-insert-mime-body layout)
1937 (vm-mime-transfer-decode-region layout (point-min) (point-max)) 1946 (vm-mime-transfer-decode-region layout (point-min) (point-max))
1938 (or (not (file-exists-p file)) 1947 (or (not (file-exists-p file))
1939 (y-or-n-p "File exists, overwrite? ") 1948 (y-or-n-p "File exists, overwrite? ")
1940 (error "Aborted")) 1949 (error "Aborted"))
2456 (vm-mime-fsfemacs-encode-composition)) 2465 (vm-mime-fsfemacs-encode-composition))
2457 (t 2466 (t
2458 (error "don't know how to MIME encode composition for %s" 2467 (error "don't know how to MIME encode composition for %s"
2459 (emacs-version))))) 2468 (emacs-version)))))
2460 2469
2470 (defvar enriched-mode)
2471
2461 (defun vm-mime-xemacs-encode-composition () 2472 (defun vm-mime-xemacs-encode-composition ()
2462 (save-restriction 2473 (save-restriction
2463 (widen) 2474 (widen)
2464 (if (not (eq major-mode 'mail-mode)) 2475 (if (not (eq major-mode 'mail-mode))
2465 (error "Command must be used in a VM Mail mode buffer.")) 2476 (error "Command must be used in a VM Mail mode buffer."))
2466 (or (null (vm-mail-mode-get-header-contents "MIME-Version:")) 2477 (or (null (vm-mail-mode-get-header-contents "MIME-Version:"))
2467 (error "Message is already MIME encoded.")) 2478 (error "Message is already MIME encoded."))
2468 (let ((8bit nil) 2479 (let ((8bit nil)
2469 (just-one nil) 2480 (just-one nil)
2470 (boundary-positions nil) 2481 (boundary-positions nil)
2482 (enriched (and (boundp 'enriched-mode) enriched-mode))
2471 already-mimed layout e e-list boundary 2483 already-mimed layout e e-list boundary
2472 type encoding charset params description disposition object 2484 type encoding charset params description disposition object
2473 opoint-min) 2485 opoint-min)
2474 (mail-text) 2486 (mail-text)
2475 (setq e-list (extent-list nil (point) (point-max)) 2487 (setq e-list (extent-list nil (point) (point-max))
2493 (goto-char (extent-end-position (car e-list))) 2505 (goto-char (extent-end-position (car e-list)))
2494 (looking-at "[ \t\n]*\\'")))) 2506 (looking-at "[ \t\n]*\\'"))))
2495 (if (null e-list) 2507 (if (null e-list)
2496 (progn 2508 (progn
2497 (narrow-to-region (point) (point-max)) 2509 (narrow-to-region (point) (point-max))
2510 ;; support enriched-mode for text/enriched composition
2511 (if enriched
2512 (let ((enriched-initial-annotation ""))
2513 (enriched-encode (point-min) (point-max))))
2498 (setq charset (vm-determine-proper-charset (point-min) 2514 (setq charset (vm-determine-proper-charset (point-min)
2499 (point-max))) 2515 (point-max)))
2516 (if vm-xemacs-mule-p
2517 (encode-coding-region (point-min) (point-max)
2518 buffer-file-coding-system))
2500 (setq encoding (vm-determine-proper-content-transfer-encoding 2519 (setq encoding (vm-determine-proper-content-transfer-encoding
2501 (point-min) 2520 (point-min)
2502 (point-max)) 2521 (point-max))
2503 encoding (vm-mime-transfer-encode-region encoding 2522 encoding (vm-mime-transfer-encode-region encoding
2504 (point-min) 2523 (point-min)
2508 (vm-remove-mail-mode-header-separator) 2527 (vm-remove-mail-mode-header-separator)
2509 (goto-char (point-min)) 2528 (goto-char (point-min))
2510 (vm-reorder-message-headers 2529 (vm-reorder-message-headers
2511 nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)") 2530 nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)")
2512 (insert "MIME-Version: 1.0\n") 2531 (insert "MIME-Version: 1.0\n")
2513 (insert "Content-Type: text/plain; charset=" charset "\n") 2532 (if enriched
2533 (insert "Content-Type: text/enriched; charset=" charset "\n")
2534 (insert "Content-Type: text/plain; charset=" charset "\n"))
2514 (insert "Content-Transfer-Encoding: " encoding "\n") 2535 (insert "Content-Transfer-Encoding: " encoding "\n")
2515 (vm-add-mail-mode-header-separator)) 2536 (vm-add-mail-mode-header-separator))
2516 (while e-list 2537 (while e-list
2517 (setq e (car e-list)) 2538 (setq e (car e-list))
2518 (if (or just-one (= (point) (extent-start-position e))) 2539 (if (or just-one (= (point) (extent-start-position e)))
2519 nil 2540 nil
2520 (narrow-to-region (point) (extent-start-position e)) 2541 (narrow-to-region (point) (extent-start-position e))
2542 (if enriched
2543 (let ((enriched-initial-annotation ""))
2544 (enriched-encode (point-min) (point-max))))
2521 (setq charset (vm-determine-proper-charset (point-min) 2545 (setq charset (vm-determine-proper-charset (point-min)
2522 (point-max))) 2546 (point-max)))
2547 (if vm-xemacs-mule-p
2548 (encode-coding-region (point-min) (point-max)
2549 buffer-file-coding-system))
2523 (setq encoding (vm-determine-proper-content-transfer-encoding 2550 (setq encoding (vm-determine-proper-content-transfer-encoding
2524 (point-min) 2551 (point-min)
2525 (point-max)) 2552 (point-max))
2526 encoding (vm-mime-transfer-encode-region encoding 2553 encoding (vm-mime-transfer-encode-region encoding
2527 (point-min) 2554 (point-min)
2528 (point-max) 2555 (point-max)
2529 t)) 2556 t))
2530 (setq boundary-positions (cons (point-marker) boundary-positions)) 2557 (setq boundary-positions (cons (point-marker) boundary-positions))
2531 (insert "Content-Type: text/plain; charset=" charset "\n") 2558 (if enriched
2559 (insert "Content-Type: text/enriched; charset=" charset "\n")
2560 (insert "Content-Type: text/plain; charset=" charset "\n"))
2532 (insert "Content-Transfer-Encoding: " encoding "\n\n") 2561 (insert "Content-Transfer-Encoding: " encoding "\n\n")
2533 (widen)) 2562 (widen))
2534 (goto-char (extent-start-position e)) 2563 (goto-char (extent-start-position e))
2535 (narrow-to-region (point) (point)) 2564 (narrow-to-region (point) (point))
2536 (setq object (extent-property e 'vm-mime-object)) 2565 (setq object (extent-property e 'vm-mime-object))
2537 ;; insert the object 2566 ;; insert the object
2538 (cond ((bufferp object) 2567 (cond ((bufferp object)
2539 (insert-buffer-substring object)) 2568 (insert-buffer-substring object))
2540 ((stringp object) 2569 ((stringp object)
2541 (let ((overriding-file-coding-system 'no-conversion) 2570 (let ((coding-system-for-read 'no-conversion)
2542 ;; don't let file-coding-system be changed 2571 ;; don't let buffer-file-coding-system be changed
2543 ;; by insert-file-contents-literally. The 2572 ;; by insert-file-contents-literally. The
2544 ;; value we bind to it to here isn't important. 2573 ;; value we bind to it to here isn't important.
2545 (file-coding-system 'no-conversion)) 2574 (buffer-file-coding-system 'no-conversion))
2546 (insert-file-contents-literally object)))) 2575 (insert-file-contents-literally object))))
2547 ;; gather information about the object from the extent. 2576 ;; gather information about the object from the extent.
2548 (if (setq already-mimed (extent-property e 'vm-mime-encoded)) 2577 (if (setq already-mimed (extent-property e 'vm-mime-encoded))
2549 (setq layout (vm-mime-parse-entity 2578 (setq layout (vm-mime-parse-entity
2550 nil (list "text/plain" "charset=us-ascii") 2579 nil (list "text/plain" "charset=us-ascii")
2650 (setq e-list (cdr e-list))) 2679 (setq e-list (cdr e-list)))
2651 ;; handle the remaining chunk of text after the last 2680 ;; handle the remaining chunk of text after the last
2652 ;; extent, if any. 2681 ;; extent, if any.
2653 (if (or just-one (= (point) (point-max))) 2682 (if (or just-one (= (point) (point-max)))
2654 nil 2683 nil
2684 (if enriched
2685 (let ((enriched-initial-annotation ""))
2686 (enriched-encode (point) (point-max))))
2655 (setq charset (vm-determine-proper-charset (point) 2687 (setq charset (vm-determine-proper-charset (point)
2656 (point-max))) 2688 (point-max)))
2689 (if vm-xemacs-mule-p
2690 (encode-coding-region (point) (point-max)
2691 buffer-file-coding-system))
2657 (setq encoding (vm-determine-proper-content-transfer-encoding 2692 (setq encoding (vm-determine-proper-content-transfer-encoding
2658 (point) 2693 (point)
2659 (point-max)) 2694 (point-max))
2660 encoding (vm-mime-transfer-encode-region encoding 2695 encoding (vm-mime-transfer-encode-region encoding
2661 (point) 2696 (point)
2662 (point-max) 2697 (point-max)
2663 t)) 2698 t))
2664 (setq 8bit (or 8bit (equal encoding "8bit"))) 2699 (setq 8bit (or 8bit (equal encoding "8bit")))
2665 (setq boundary-positions (cons (point-marker) boundary-positions)) 2700 (setq boundary-positions (cons (point-marker) boundary-positions))
2666 (insert "Content-Type: text/plain; charset=" charset "\n") 2701 (if enriched
2702 (insert "Content-Type: text/enriched; charset=" charset "\n")
2703 (insert "Content-Type: text/plain; charset=" charset "\n"))
2667 (insert "Content-Transfer-Encoding: " encoding "\n\n") 2704 (insert "Content-Transfer-Encoding: " encoding "\n\n")
2668 (goto-char (point-max))) 2705 (goto-char (point-max)))
2669 (setq boundary (vm-mime-make-multipart-boundary)) 2706 (setq boundary (vm-mime-make-multipart-boundary))
2670 (mail-text) 2707 (mail-text)
2671 (while (re-search-forward (concat "^--" 2708 (while (re-search-forward (concat "^--"
2740 (or (null (vm-mail-mode-get-header-contents "MIME-Version:")) 2777 (or (null (vm-mail-mode-get-header-contents "MIME-Version:"))
2741 (error "Message is already MIME encoded.")) 2778 (error "Message is already MIME encoded."))
2742 (let ((8bit nil) 2779 (let ((8bit nil)
2743 (just-one nil) 2780 (just-one nil)
2744 (boundary-positions nil) 2781 (boundary-positions nil)
2782 (enriched (and (boundp 'enriched-mode) enriched-mode))
2745 already-mimed layout o o-list boundary 2783 already-mimed layout o o-list boundary
2746 type encoding charset params description disposition object 2784 type encoding charset params description disposition object
2747 opoint-min) 2785 opoint-min)
2748 (mail-text) 2786 (mail-text)
2749 (setq o-list (vm-mime-fake-attachment-overlays (point) (point-max)) 2787 (setq o-list (vm-mime-fake-attachment-overlays (point) (point-max))
2767 (goto-char (overlay-end (car o-list))) 2805 (goto-char (overlay-end (car o-list)))
2768 (looking-at "[ \t\n]*\\'")))) 2806 (looking-at "[ \t\n]*\\'"))))
2769 (if (null o-list) 2807 (if (null o-list)
2770 (progn 2808 (progn
2771 (narrow-to-region (point) (point-max)) 2809 (narrow-to-region (point) (point-max))
2810 ;; support enriched-mode for text/enriched composition
2811 (if enriched
2812 (let ((enriched-initial-annotation ""))
2813 (enriched-encode (point-min) (point-max))))
2772 (setq charset (vm-determine-proper-charset (point-min) 2814 (setq charset (vm-determine-proper-charset (point-min)
2773 (point-max))) 2815 (point-max)))
2774 (setq encoding (vm-determine-proper-content-transfer-encoding 2816 (setq encoding (vm-determine-proper-content-transfer-encoding
2775 (point-min) 2817 (point-min)
2776 (point-max)) 2818 (point-max))
2782 (vm-remove-mail-mode-header-separator) 2824 (vm-remove-mail-mode-header-separator)
2783 (goto-char (point-min)) 2825 (goto-char (point-min))
2784 (vm-reorder-message-headers 2826 (vm-reorder-message-headers
2785 nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)") 2827 nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)")
2786 (insert "MIME-Version: 1.0\n") 2828 (insert "MIME-Version: 1.0\n")
2787 (insert "Content-Type: text/plain; charset=" charset "\n") 2829 (if enriched
2830 (insert "Content-Type: text/enriched; charset=" charset "\n")
2831 (insert "Content-Type: text/plain; charset=" charset "\n"))
2788 (insert "Content-Transfer-Encoding: " encoding "\n") 2832 (insert "Content-Transfer-Encoding: " encoding "\n")
2789 (vm-add-mail-mode-header-separator)) 2833 (vm-add-mail-mode-header-separator))
2790 (while o-list 2834 (while o-list
2791 (setq o (car o-list)) 2835 (setq o (car o-list))
2792 (if (or just-one (= (point) (overlay-start o))) 2836 (if (or just-one (= (point) (overlay-start o)))
2793 nil 2837 nil
2794 (narrow-to-region (point) (overlay-start o)) 2838 (narrow-to-region (point) (overlay-start o))
2839 ;; support enriched-mode for text/enriched composition
2840 (if enriched
2841 (let ((enriched-initial-annotation ""))
2842 (save-excursion
2843 ;; insert/delete trick needed to avoid
2844 ;; enriched-mode tags from seeping into the
2845 ;; attachment overlays. I really wish
2846 ;; front-advance / rear-aadvance overlay
2847 ;; endpoint properties actually worked.
2848 (goto-char (point-max))
2849 (insert-before-markers "\n")
2850 (enriched-encode (point-min) (1- (point)))
2851 (goto-char (point-max))
2852 (delete-char -1)
2853 '(goto-char (point-min)))))
2795 (setq charset (vm-determine-proper-charset (point-min) 2854 (setq charset (vm-determine-proper-charset (point-min)
2796 (point-max))) 2855 (point-max)))
2797 (setq encoding (vm-determine-proper-content-transfer-encoding 2856 (setq encoding (vm-determine-proper-content-transfer-encoding
2798 (point-min) 2857 (point-min)
2799 (point-max)) 2858 (point-max))
2800 encoding (vm-mime-transfer-encode-region encoding 2859 encoding (vm-mime-transfer-encode-region encoding
2801 (point-min) 2860 (point-min)
2802 (point-max) 2861 (point-max)
2803 t)) 2862 t))
2804 (setq boundary-positions (cons (point-marker) boundary-positions)) 2863 (setq boundary-positions (cons (point-marker) boundary-positions))
2805 (insert "Content-Type: text/plain; charset=" charset "\n") 2864 (if enriched
2865 (insert "Content-Type: text/enriched; charset=" charset "\n")
2866 (insert "Content-Type: text/plain; charset=" charset "\n"))
2806 (insert "Content-Transfer-Encoding: " encoding "\n\n") 2867 (insert "Content-Transfer-Encoding: " encoding "\n\n")
2807 (widen)) 2868 (widen))
2808 (goto-char (overlay-start o)) 2869 (goto-char (overlay-start o))
2809 (narrow-to-region (point) (point)) 2870 (narrow-to-region (point) (point))
2810 (setq object (overlay-get o 'vm-mime-object)) 2871 (setq object (overlay-get o 'vm-mime-object))
2933 (setq o-list (cdr o-list))) 2994 (setq o-list (cdr o-list)))
2934 ;; handle the remaining chunk of text after the last 2995 ;; handle the remaining chunk of text after the last
2935 ;; extent, if any. 2996 ;; extent, if any.
2936 (if (or just-one (= (point) (point-max))) 2997 (if (or just-one (= (point) (point-max)))
2937 nil 2998 nil
2999 ;; support enriched-mode for text/enriched composition
3000 (if enriched
3001 (let ((enriched-initial-annotation ""))
3002 (enriched-encode (point) (point-max))))
2938 (setq charset (vm-determine-proper-charset (point) 3003 (setq charset (vm-determine-proper-charset (point)
2939 (point-max))) 3004 (point-max)))
2940 (setq encoding (vm-determine-proper-content-transfer-encoding 3005 (setq encoding (vm-determine-proper-content-transfer-encoding
2941 (point) 3006 (point)
2942 (point-max)) 3007 (point-max))
2944 (point) 3009 (point)
2945 (point-max) 3010 (point-max)
2946 t)) 3011 t))
2947 (setq 8bit (or 8bit (equal encoding "8bit"))) 3012 (setq 8bit (or 8bit (equal encoding "8bit")))
2948 (setq boundary-positions (cons (point-marker) boundary-positions)) 3013 (setq boundary-positions (cons (point-marker) boundary-positions))
2949 (insert "Content-Type: text/plain; charset=" charset "\n") 3014 (if enriched
3015 (insert "Content-Type: text/enriched; charset=" charset "\n")
3016 (insert "Content-Type: text/plain; charset=" charset "\n"))
2950 (insert "Content-Transfer-Encoding: " encoding "\n\n") 3017 (insert "Content-Transfer-Encoding: " encoding "\n\n")
2951 (goto-char (point-max))) 3018 (goto-char (point-max)))
2952 (setq boundary (vm-mime-make-multipart-boundary)) 3019 (setq boundary (vm-mime-make-multipart-boundary))
2953 (mail-text) 3020 (mail-text)
2954 (while (re-search-forward (concat "^--" 3021 (while (re-search-forward (concat "^--"