;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1994/08/21 (renamed from mime.el;
;;; 1996/05/24 renamed from tm-edit.el)
-;;; Version: $Revision: 0.0 $
+;;; Version: $Revision: 0.1 $
;;; Keywords: mail, news, MIME, multimedia, multilingual
;;;
-;;; This file is part of mike (MIME Interface Kit for GNU Emacs)
+;;; This file is part of SEMI (September, Emacs MIME Interface)
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;;
(defconst mime-editor/RCS-ID
- "$Id: mime-edit.el,v 0.0 1996-05-24 08:44:56 morioka Exp $")
+ "$Id: mime-edit.el,v 0.1 1996-05-24 13:00:01 morioka Exp $")
(defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
(defvar mime-prefix "\C-c\C-x"
"*Keymap prefix for MIME commands.")
-;; (defvar mime-signature-file "~/.signature.rtf"
-;; "*Signature file to be included as a part of a multipart message.")
-
(defvar mime-ignore-preceding-spaces nil
"*Ignore preceding white spaces if non-nil.")
;;;
(defconst mime-editor/single-part-tag-regexp
- "^--[[][[]\\([^]]*\\)]\\([[]\\([^]]*\\)]\\|\\)]"
+ "--[[][[]\\([^]]*\\)]\\([[]\\([^]]*\\)]\\|\\)]"
"*Regexp of MIME tag in the form of [[CONTENT-TYPE][ENCODING]].")
+(defconst mime-editor/quoted-single-part-tag-regexp
+ (concat "- " (substring mime-editor/single-part-tag-regexp 1)))
+
(defconst mime-editor/multipart-beginning-regexp "^--<<\\([^<>]+\\)>>-{\n")
(defconst mime-editor/multipart-end-regexp "^--}-<<\\([^<>]+\\)>>\n")
Tspecials means any character that matches with it in header must be quoted.")
(defconst mime-editor/mime-version-value
- (format "1.0 (generated by tm-edit %s)" mime-editor/version)
+ (format "1.0 (generated by SEMI composer %s)" mime-editor/version)
"MIME version number.")
(defconst mime-editor/mime-map (make-sparse-keymap)
"Keymap for MIME commands.")
+
;;; @ keymap and menu
;;;
(mime-editor/find-inmost)
)
(widen)
- ;;(delete-region eb ee)
(list type bb be eb)
))))
(not (eobp)))
(insert (concat (mime-make-text-tag) "\n"))
)))
- (cond ((string= type "signed")
+ (cond ((string-equal type "quote")
+ (mime-editor/enquote-region bb eb)
+ )
+ ((string= type "signed")
(cond ((eq mime-editor/signing-type 'pgp-elkins)
(mime-editor/sign-pgp-elkins bb eb boundary)
)
((eq mime-editor/signing-type 'pgp-kazu)
(mime-editor/sign-pgp-kazu bb eb boundary)
- )
- ))
+ ))
+ )
((string= type "encrypted")
(cond ((eq mime-editor/encrypting-type 'pgp-elkins)
(mime-editor/encrypt-pgp-elkins bb eb boundary)
))
boundary))))
+(defun mime-editor/enquote-region (beg end)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char beg)
+ (while (re-search-forward mime-editor/single-part-tag-regexp nil t)
+ (let ((tag (buffer-substring (match-beginning 0)(match-end 0))))
+ (replace-match (concat "- " (substring tag 1)))
+ )))))
+
+(defun mime-editor/dequote-region (beg end)
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char beg)
+ (while (re-search-forward
+ mime-editor/quoted-single-part-tag-regexp nil t)
+ (let ((tag (buffer-substring (match-beginning 0)(match-end 0))))
+ (replace-match (concat "-" (substring tag 2)))
+ )))))
(autoload 'mc-pgp-lookup-key "mc-pgp")
(autoload 'mc-pgp-sign-region "mc-pgp")
beg end
(format "%s-%d" boundary i)))
))
+ (mime-editor/dequote-region (point-min)(point-max))
(let ((contype (car ret)) ;Content-Type
(encoding (nth 1 ret)) ;Content-Transfer-Encoding
)