X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=mime-edit.el;h=1aa3c2f558d7a10dbdf0e80ee4c8c0b807270099;hb=25f1c1069ac400f71152d3ea6bc3ed53ed703d22;hp=653ef9ca20003207794ac97b309c069aa20e606d;hpb=8cc728901be23c4a56094dba4bc306c410bf39e3;p=elisp%2Fsemi.git diff --git a/mime-edit.el b/mime-edit.el index 653ef9c..1aa3c2f 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -184,18 +184,11 @@ To insert a signature file automatically, call the function ("plain" ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") ) - ("richtext" - ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") - ) - ("enriched" - ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") - ) - ("x-latex" - ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") - ) - ("html" - ;;("charset" "" "ISO-2022-JP" "US-ASCII" "ISO-8859-1" "ISO-8859-8") - ) + ("enriched") + ("html") + ("css") ; rfc2318 + ("xml") ; rfc2376 + ("x-latex") ("x-rot13-47-48") ) ("message" @@ -214,9 +207,13 @@ To insert a signature file automatically, call the function ("tftp" ("site") ("name")) ("afs" ("site") ("name")) ("local-file" ("site") ("name")) - ("mail-server" ("server" "ftpmail@nic.karrn.ad.jp")) + ("mail-server" + ("server" "ftpmail@nic.karrn.ad.jp") + ("subject")) + ("url" ("url")) )) ("rfc822") + ("news") ) ("application" ("octet-stream" ("type" "" "tar" "shar")) @@ -248,10 +245,6 @@ To insert a signature file automatically, call the function nil "inline" (("filename" . file)) ) - ("\\.rtf$" - "text" "richtext" nil - nil - nil nil) ("\\.html$" "text" "html" nil nil @@ -509,8 +502,11 @@ If it is not specified for a major-mode, (defconst mime-edit-split-ignored-field-regexp "\\(^Content-\\|^Subject:\\|^Mime-Version:\\|Message-Id:\\)") -(defvar mime-edit-split-blind-field-regexp - "\\(^[BDFbdf]cc:\\|^cc:[ \t]*$\\)") +(defcustom mime-edit-split-blind-field-regexp + "\\(^[BDFbdf]cc:\\|^cc:[ \t]*$\\)" + "*Regular expression to match field-name to be ignored when split sending." + :group 'mime-edit + :type 'regexp) (defvar mime-edit-split-message-sender-alist nil) @@ -561,30 +557,54 @@ If it is not specified for a major-mode, ;;; @@ optional header fields ;;; -(defvar mime-edit-insert-x-emacs-field t - "*If non-nil, insert X-Emacs header field.") - -(defvar mime-edit-x-emacs-value - (if (featurep 'xemacs) - (concat emacs-version (if (featurep 'mule) - " with mule" - " without mule")) - (let ((ver (if (string-match "\\.[0-9]+$" emacs-version) - (substring emacs-version 0 (match-beginning 0)) - emacs-version))) - (if (featurep 'mule) - (if (boundp 'enable-multibyte-characters) - (concat "Emacs " ver - (if enable-multibyte-characters - (concat ", MULE " mule-version) - " (with raw setting)") - (if (featurep 'meadow) - (concat ", " (Meadow-version)) - )) - (concat "MULE " mule-version " based on Emacs " ver)) - ver))) - "Body of X-Emacs field. -If variable `mime-edit-insert-x-emacs-field' is not nil, it is +(defvar mime-edit-insert-user-agent-field t + "*If non-nil, insert User-Agent header field.") + +(defvar mime-edit-user-agent-value + (concat (car mime-user-interface-version) + "/" + (mapconcat #'number-to-string + (cddr mime-user-interface-version) ".") + " (" + (cadr mime-user-interface-version) + ") " + (car mime-library-version) + "/" + (mapconcat #'number-to-string + (cddr mime-library-version) ".") + " (" + (cadr mime-library-version) + ") " + (if (featurep 'xemacs) + (concat "XEmacs" + (if (string-match "\\s +\\\"" emacs-version) + (concat "/" + (substring emacs-version 0 + (match-beginning 0)) + " (" xemacs-codename ")") + " (" emacs-version ")") + (if (featurep 'mule) " MULE")) + (let ((ver (if (string-match "\\.[0-9]+$" emacs-version) + (substring emacs-version 0 (match-beginning 0)) + emacs-version))) + (if (featurep 'mule) + (if (boundp 'enable-multibyte-characters) + (concat "Emacs/" ver + (if enable-multibyte-characters + (concat " MULE/" mule-version) + " (with unibyte mode)") + (if (featurep 'meadow) + (let ((mver (Meadow-version))) + (if (string-match "^Meadow-" mver) + (concat " Meadow/" + (substring mver + (match-end 0))) + )))) + (concat "MULE/" mule-version + " (based on Emacs " ver ")")) + ver)))) + "Body of User-Agent field. +If variable `mime-edit-insert-user-agent-field' is not nil, it is inserted into message header.") @@ -697,7 +717,7 @@ Tspecials means any character that matches with it in header must be quoted.") ;; modified by Pekka Marjola ;; 1995/9/5 (c.f. [tm-en:69]) (defun mime-edit-define-menu-for-xemacs () - "Define menu for Emacs 19." + "Define menu for XEmacs." (cond ((featurep 'menubar) (make-local-variable 'current-menubar) (set-buffer-menubar current-menubar) @@ -998,9 +1018,8 @@ If optional argument SUBTYPE is not nil, text/SUBTYPE tag is inserted." (insert "\n") (forward-char -1) )) - (if (and (member (cadr ret) '("enriched" "richtext")) - (fboundp 'enriched-mode) - ) + (if (and (member (cadr ret) '("enriched")) + (fboundp 'enriched-mode)) (enriched-mode t) (if (boundp 'enriched-mode) (enriched-mode -1) @@ -1847,10 +1866,10 @@ Content-Transfer-Encoding: 7bit (let ((contype (car ret)) ;Content-Type (encoding (nth 1 ret)) ;Content-Transfer-Encoding ) - ;; Insert X-Emacs field - (and mime-edit-insert-x-emacs-field - (or (mail-position-on-field "X-Emacs") - (insert mime-edit-x-emacs-value) + ;; Insert User-Agent field + (and mime-edit-insert-user-agent-field + (or (mail-position-on-field "User-Agent") + (insert mime-edit-user-agent-value) )) ;; Make primary MIME headers. (or (mail-position-on-field "MIME-Version") @@ -2047,11 +2066,8 @@ Content-Transfer-Encoding: 7bit (save-restriction (narrow-to-region beg (mime-edit-content-end)) (goto-char beg) - (while (re-search-forward "\\([^\r]\\)\n" nil t) - (replace-match - (concat (buffer-substring (match-beginning 0) - (match-end 1)) "\r\n")) - ))) + (while (re-search-forward "\\(\\=\\|[^\r]\\)\n" nil t) + (replace-match "\\1\r\n")))) (goto-char beg) (mime-encode-region beg (mime-edit-content-end) encoding) (mime-edit-define-encoding encoding) @@ -2481,7 +2497,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n" (concat "^" (regexp-quote separator) "$")) (replace-match "") ) - (mime-view-mode) + (mime-view-buffer) )) (defun mime-edit-quitting-method () @@ -2505,7 +2521,7 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n" (defvar mime-edit-again-ignored-field-regexp (concat "^\\(" "Content-.*\\|Mime-Version" - (if mime-edit-insert-x-emacs-field "\\|X-Emacs") + (if mime-edit-insert-user-agent-field "\\|User-Agent") "\\):") "Regexp for deleted header fields when `mime-edit-again' is called.")