comparison lisp/mail/rmail.el @ 88123:375f2633d815

New directory
author Kenichi Handa <handa@m17n.org>
date Mon, 08 Sep 2003 11:56:09 +0000
parents 695cf19ef79e
children 5caa5e061a07
comparison
equal deleted inserted replaced
52428:27bc8b966642 88123:375f2633d815
1650 ;; will be treated properly. 1650 ;; will be treated properly.
1651 (delete-region (point) 1651 (delete-region (point)
1652 (save-excursion 1652 (save-excursion
1653 (skip-chars-forward " \t\n") 1653 (skip-chars-forward " \t\n")
1654 (point))) 1654 (point)))
1655 (save-excursion 1655 (setq last-coding-system-used nil)
1656 (let* ((header-end 1656 (or rmail-enable-mime
1657 (progn 1657 (not rmail-enable-multibyte)
1658 (save-excursion 1658 (decode-coding-region start (point)
1659 (goto-char start) 1659 (or rmail-file-coding-system
1660 (forward-line 1) 1660 'undecided)))
1661 (if (looking-at "0")
1662 (forward-line 1)
1663 (forward-line 2))
1664 (save-restriction
1665 (narrow-to-region (point) (point-max))
1666 (rfc822-goto-eoh)
1667 (point)))))
1668 (case-fold-search t)
1669 (quoted-printable-header-field-end
1670 (save-excursion
1671 (goto-char start)
1672 (re-search-forward
1673 "^content-transfer-encoding:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*"
1674 header-end t)))
1675 (base64-header-field-end
1676 (save-excursion
1677 (goto-char start)
1678 (re-search-forward
1679 "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
1680 header-end t))))
1681 (if quoted-printable-header-field-end
1682 (save-excursion
1683 (rmail-decode-quoted-printable header-end (point))
1684 ;; Change "quoted-printable" to "8bit",
1685 ;; to reflect the decoding we just did.
1686 (goto-char quoted-printable-header-field-end)
1687 (delete-region (point) (search-backward ":"))
1688 (insert ": 8bit")))
1689 (if base64-header-field-end
1690 (save-excursion
1691 (base64-decode-region (1+ header-end)
1692 (- (point) 2))
1693 ;; Change "base64" to "8bit", to reflect the
1694 ;; decoding we just did.
1695 (goto-char (1+ header-end))
1696 (while (search-forward "\r\n" (point-max) t)
1697 (replace-match "\n"))
1698 (goto-char base64-header-field-end)
1699 (delete-region (point) (search-backward ":"))
1700 (insert ": 8bit")))
1701 (setq last-coding-system-used nil)
1702 (or rmail-enable-mime
1703 (not rmail-enable-multibyte)
1704 (let ((mime-charset
1705 (if (and rmail-decode-mime-charset
1706 (save-excursion
1707 (goto-char start)
1708 (search-forward "\n\n" nil t)
1709 (let ((case-fold-search t))
1710 (re-search-backward
1711 rmail-mime-charset-pattern
1712 start t))))
1713 (intern (downcase (match-string 1))))))
1714 (rmail-decode-region start (point) mime-charset)))))
1715 ;; Add an X-Coding-System: header if we don't have one. 1661 ;; Add an X-Coding-System: header if we don't have one.
1716 (save-excursion 1662 (save-excursion
1717 (goto-char start) 1663 (goto-char start)
1718 (forward-line 1) 1664 (forward-line 1)
1719 (if (looking-at "0") 1665 (if (looking-at "0")
1766 (quoted-printable-header-field-end 1712 (quoted-printable-header-field-end
1767 (save-excursion 1713 (save-excursion
1768 (re-search-forward 1714 (re-search-forward
1769 "^content-transfer-encoding:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*" 1715 "^content-transfer-encoding:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*"
1770 header-end t))) 1716 header-end t)))
1771 (base64-header-field-end
1772 (save-excursion
1773 (re-search-forward
1774 "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
1775 header-end t)))
1776 (size 1717 (size
1777 ;; Get the numeric value from the Content-Length field. 1718 ;; Get the numeric value from the Content-Length field.
1778 (save-excursion 1719 (save-excursion
1779 ;; Back up to end of prev line, 1720 ;; Back up to end of prev line,
1780 ;; in case the Content-Length field comes first. 1721 ;; in case the Content-Length field comes first.
1818 (save-excursion 1759 (save-excursion
1819 (rmail-decode-quoted-printable header-end (point)) 1760 (rmail-decode-quoted-printable header-end (point))
1820 ;; Change "quoted-printable" to "8bit", 1761 ;; Change "quoted-printable" to "8bit",
1821 ;; to reflect the decoding we just did. 1762 ;; to reflect the decoding we just did.
1822 (goto-char quoted-printable-header-field-end) 1763 (goto-char quoted-printable-header-field-end)
1823 (delete-region (point) (search-backward ":"))
1824 (insert ": 8bit")))
1825 (if base64-header-field-end
1826 (save-excursion
1827 (base64-decode-region header-end (point))
1828 ;; Change "base64" to "8bit", to reflect the
1829 ;; decoding we just did.
1830 (goto-char base64-header-field-end)
1831 (delete-region (point) (search-backward ":")) 1764 (delete-region (point) (search-backward ":"))
1832 (insert ": 8bit")))) 1765 (insert ": 8bit"))))
1833 1766
1834 (save-excursion 1767 (save-excursion
1835 (save-restriction 1768 (save-restriction
3820 (setq i (1+ i))) 3753 (setq i (1+ i)))
3821 (concat string-vector))) 3754 (concat string-vector)))
3822 3755
3823 (provide 'rmail) 3756 (provide 'rmail)
3824 3757
3825 ;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c
3826 ;;; rmail.el ends here 3758 ;;; rmail.el ends here