X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tm-comp.el;h=8ff815cf0edd9873a16fceedee8e0fd9c085624a;hb=a7110eca79a127b0b627934466375dbf9d49d9a0;hp=bb865e64a052280e1b90bbfbdbe1c42a92de91a3;hpb=374a8f8ba221ac2f714ee0894a02810591f8631e;p=elisp%2Ftm.git diff --git a/tm-comp.el b/tm-comp.el index bb865e6..8ff815c 100644 --- a/tm-comp.el +++ b/tm-comp.el @@ -1,19 +1,24 @@ ;;; -;;; tm-comp.el: attachment for MIME composer +;;; tm-comp.el --- attachment for MIME composer ;;; -;;; by MORIOKA Tomohiko -;;; and OKABE Yasuo -;;; modified by MORITA Masahiro -;;; MORIOKA Tomohiko, -;;; Kazushi (Jam) MARUKAWA , -;;; OKABE Yasuo, -;;; KOBAYASHI Shuhei , -;;; and YAMAOKA Katsumi +;;; Copyright (C) 1995 Free Software Foundation, Inc. +;;; Copyright (C) 1994,1995 MORIOKA Tomohiko +;;; Copyright (C) 1994,1995 OKABE Yasuo +;;; +;;; Author: MORIOKA Tomohiko , +;;; OKABE Yasuo +;;; modified by MORITA Masahiro +;;; Kazushi (Jam) MARUKAWA , +;;; KOBAYASHI Shuhei , +;;; YAMAOKA Katsumi , +;;; and Richard Stanton +;;; Keywords: mail, news, MIME, multimedia +;;; +;;; This file is part of tm (Tools for MIME). ;;; -(require 'tm-misc) (require 'tm-view) -(require 'tl-header) +(require 'tl-822) (require 'tl-list) (require 'mail-utils) @@ -22,7 +27,7 @@ ;;; (defconst mime/composer-RCS-ID - "$Id: tm-comp.el,v 6.10 1995/08/30 05:37:50 morioka Exp $") + "$Id: tm-comp.el,v 7.2 1995/10/08 09:31:05 morioka Exp $") (defconst mime/composer-version (get-version-string mime/composer-RCS-ID)) @@ -166,7 +171,9 @@ Optional argument ENCODING specifies an encoding method such as base64." (let ((mc-flag nil) ;Mule (file-coding-system-for-read (if (featurep 'mule) *noconv*)) - (kanji-flag nil)) ;NEmacs + (kanji-flag nil) ;NEmacs + (emx-binary-mode t) ;Stop CRLF to LF conversion in OS/2 + ) (let (jka-compr-compression-info-list jam-zcat-filename-list) (insert-file-contents file)))) @@ -197,7 +204,8 @@ Optional argument ENCODING specifies an encoding method such as base64." ) (save-restriction (narrow-to-region (1- (point)) (point)) - (let ((start (point))) + (let ((start (point)) + (emx-binary-mode t)) ;Stop LF to CRLF conversion in OS/2 (insert-buffer-substring buffer) ;; Encode binary message if necessary. (if encoding @@ -252,9 +260,9 @@ Optional argument ENCODING specifies an encoding method such as base64." (let ((hook (cdr (assq major-mode mime/message-before-send-hook-alist)))) (run-hooks hook)) - (let* ((header (message/get-header-string-except - mime/message-nuke-headers separator)) - (orig-header (message/get-header-string-except + (let* ((header (rfc822/get-header-string-except + mime/message-nuke-headers separator)) + (orig-header (rfc822/get-header-string-except mime/message-blind-headers separator)) (subject (mail-fetch-field "subject")) (total (+ (/ lines mime/message-max-length) @@ -434,27 +442,28 @@ Optional argument ENCODING specifies an encoding method such as base64." ;;; @ etc ;;; -(defun message/get-header-string-except (pat boundary) - (save-excursion - (save-restriction - (narrow-to-region (goto-char (point-min)) - (progn - (re-search-forward - (concat "^\\(" (regexp-quote boundary) "\\)?$") - nil t) - (match-beginning 0) - )) - (goto-char (point-min)) - (let (field header) - (while (re-search-forward message/field-regexp nil t) - (setq field (buffer-substring (match-beginning 0) - (match-end 0) - )) - (if (not (string-match pat field)) - (setq header (concat header field "\n")) - )) - header) - ))) +(defun rfc822/get-header-string-except (pat boundary) + (let ((case-fold-search t)) + (save-excursion + (save-restriction + (narrow-to-region (goto-char (point-min)) + (progn + (re-search-forward + (concat "^\\(" (regexp-quote boundary) "\\)?$") + nil t) + (match-beginning 0) + )) + (goto-char (point-min)) + (let (field header) + (while (re-search-forward rfc822/field-top-regexp nil t) + (setq field (buffer-substring (match-beginning 0) + (rfc822/field-end) + )) + (if (not (string-match pat field)) + (setq header (concat header field "\n")) + )) + header) + )))) (defun replace-space-with-underline (str) (mapconcat (function @@ -466,6 +475,9 @@ Optional argument ENCODING specifies an encoding method such as base64." ) +;;; @ end +;;; + (provide 'tm-comp) (run-hooks 'tm-comp-load-hook)