X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mime-edit.el;h=26938e93f7e347af89afed1837876efb6db81a9a;hb=309a7f5d32f628d292c2adbf042c58ac0ee34132;hp=0548f0f4c256635a2eeafdceec056801999d6ace;hpb=3ea27f9865396d57c7823a4c4ea0fc9fbab6167f;p=elisp%2Fsemi.git diff --git a/mime-edit.el b/mime-edit.el index 0548f0f..26938e9 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -24,8 +24,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Commentary: @@ -236,6 +236,9 @@ To insert a signature file automatically, call the function ("application" ("octet-stream" ("type" "" "tar" "shar")) ("postscript") + ("pdf") + ("msword") + ("vnd.ms-excel") ("vnd.ms-powerpoint") ("x-kiss" ("x-cnf"))) ("image" @@ -321,6 +324,11 @@ To insert a signature file automatically, call the function "base64" "attachment" (("filename" . file)) ) + ("\\.xls$" ; MS Excel + "application" "vnd.ms-excel" nil + "base64" + "attachment" (("filename" . file)) + ) ("\\.ppt$" ; MS Power Point "application" "vnd.ms-powerpoint" nil "base64" @@ -334,7 +342,12 @@ To insert a signature file automatically, call the function ) ("\\.ps$" "application" "postscript" nil - "quoted-printable" + "base64" + "attachment" (("filename" . file)) + ) + ("\\.pdf$" + "application" "pdf" nil + "base64" "attachment" (("filename" . file)) ) @@ -725,7 +738,7 @@ Tspecials means any character that matches with it in header must be quoted.") (concat "MIME-Version:" (mime-encode-field-body (concat " 1.0 (split by " mime-edit-version ")\n") - "MIME-Version:")) + "MIME-Version")) "MIME version field for message/partial.") @@ -1720,6 +1733,7 @@ Parameter must be '(PROMPT CHOICE1 (CHOICE2...))." ) (delete-region beg end) (or (looking-at mime-edit-beginning-tag-regexp) + (looking-at mime-edit-multipart-end-regexp) (eobp) (insert (concat (mime-make-text-tag) "\n")) ))) @@ -1779,6 +1793,13 @@ Parameter must be '(PROMPT CHOICE1 (CHOICE2...))." (defvar mime-edit-pgp-user-id nil) +(defun mime-edit-delete-trailing-whitespace () + (save-match-data + (save-excursion + (goto-char (point-min)) + (while (re-search-forward "[ \t]+$" nil t) + (delete-region (match-beginning 0) (match-end 0)))))) + (defun mime-edit-sign-pgp-mime (beg end boundary) (save-excursion (save-restriction @@ -1790,6 +1811,7 @@ Parameter must be '(PROMPT CHOICE1 (CHOICE2...))." (encoding (nth 1 ret)) (pgp-boundary (concat "pgp-sign-" boundary)) micalg) + (mime-edit-delete-trailing-whitespace) ; RFC3156 (goto-char beg) (insert (format "Content-Type: %s\n" ctype)) (if encoding @@ -1800,7 +1822,8 @@ Parameter must be '(PROMPT CHOICE1 (CHOICE2...))." (or mime-edit-pgp-user-id (if from (nth 1 (std11-extract-address-components from)) - pgg-default-user-id)))) + pgg-default-user-id))) + (pgg-text-mode t)) (pgg-sign-region (point-min)(point-max))) (throw 'mime-edit-error 'pgp-error) ) @@ -1891,7 +1914,8 @@ Content-Transfer-Encoding: 7bit (or mime-edit-pgp-user-id (if from (nth 1 (std11-extract-address-components from)) - pgg-default-user-id)))) + pgg-default-user-id))) + (pgg-text-mode t)) (pgg-encrypt-region (point-min) (point-max) (mapcar (lambda (recipient) @@ -2302,7 +2326,13 @@ Content-Description: S/MIME Encrypted Message][base64]]\n") (narrow-to-region beg (mime-edit-content-end)) (goto-char beg) (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) - (replace-match "\\1\r\n")))) + ;; In a certain period, `replace-match' with "\\N" + ;; converted 8-bit characters into multibyte string, + ;; but it has been fixed at 2004-01-15. + ;;(replace-match "\\1\r\n")))) + (backward-char 1) + (insert "\r") + (forward-char 1)))) (goto-char beg) (mime-encode-region beg (mime-edit-content-end) (or encoding "7bit")) @@ -2612,10 +2642,10 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n" (or (cdr (assq major-mode mime-edit-message-max-lines-alist)) mime-edit-message-default-max-lines)) ) - (let* ((separator mail-header-separator) - (id (concat "\"" - (replace-space-with-underline (current-time-string)) - "@" (system-name) "\""))) + (let ((separator mail-header-separator) + (id (concat "\"" + (replace-space-with-underline (current-time-string)) + "@" (system-name) "\""))) (run-hooks 'mime-edit-before-split-hook) (let ((the-buf (current-buffer)) (copy-buf (get-buffer-create " *Original Message*")) @@ -2714,6 +2744,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n" ;;; (defvar mime-edit-buffer nil) ; buffer local variable +(defvar mime-edit-temp-message-buffer nil) ; buffer local variable (defun mime-edit-preview-message () "preview editing MIME message."