From: morioka Date: Fri, 24 May 1996 13:00:01 +0000 (+0000) Subject: (mime-editor/single-part-tag-regexp): It allows any column. X-Git-Tag: Hokutetsu-Ishikawa-new~402 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81daaf3e466f1715706935aaed44b759dfa5cdfd;p=elisp%2Fsemi.git (mime-editor/single-part-tag-regexp): It allows any column. (mime-editor/quoted-single-part-tag-regexp): New constant. (mime-editor/enquote-region): New function. (mime-editor/dequote-region): New function. (mime-editor/process-multipart-1): Processing for ``quote'' enclosure was added. (mime-editor/translate-body): Use function `mime-editor/dequote-region'. (mime-editor/mime-version-value): Comment was renamed. --- diff --git a/mime-edit.el b/mime-edit.el index 0eb188b..79027c6 100644 --- a/mime-edit.el +++ b/mime-edit.el @@ -9,10 +9,10 @@ ;;; Maintainer: MORIOKA Tomohiko ;;; 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 @@ -123,7 +123,7 @@ ;;; (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)) @@ -134,9 +134,6 @@ (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.") @@ -472,9 +469,12 @@ Each elements are regexp of field-name. [tm-edit.el]") ;;; (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") @@ -521,12 +521,13 @@ Each elements are regexp of field-name. [tm-edit.el]") 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 ;;; @@ -1446,7 +1447,6 @@ while if FLAG is `\\^M' (control-M) the text is hidden." (mime-editor/find-inmost) ) (widen) - ;;(delete-region eb ee) (list type bb be eb) )))) @@ -1472,14 +1472,17 @@ while if FLAG is `\\^M' (control-M) the text is hidden." (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) @@ -1499,6 +1502,26 @@ while if FLAG is `\\^M' (control-M) the text is hidden." )) 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") @@ -1830,6 +1853,7 @@ Content-Transfer-Encoding: 7bit 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 )