;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; Created: 1994/08/21 renamed from mime.el by UMEDA Masanobu;
;;; 1996/05/24 renamed from tm-edit.el
-;;; Version: $Revision: 0.14 $
+;;; Version: $Revision: 0.15 $
;;; Keywords: mail, news, MIME, multimedia, multilingual
;;;
;;; This file is part of SEMI (September, Emacs MIME Interface)
;;;
(defconst mime-editor/RCS-ID
- "$Id: mime-edit.el,v 0.14 1996-05-26 05:04:20 morioka Exp $")
+ "$Id: mime-edit.el,v 0.15 1996-05-28 02:52:49 morioka Exp $")
(defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
(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-beginning-regexp "--<<\\([^<>]+\\)>>-{\n")
-(defconst mime-editor/multipart-end-regexp "^--}-<<\\([^<>]+\\)>>\n")
+(defconst mime-editor/multipart-end-regexp "--}-<<\\([^<>]+\\)>>\n")
(defconst mime-editor/beginning-tag-regexp
(regexp-or mime-editor/single-part-tag-regexp
(be (match-end 0))
(type (buffer-substring (match-beginning 1)(match-end 1)))
end-exp eb ee)
- (setq end-exp (format "^--}-<<%s>>\n" type))
+ (setq end-exp (format "--}-<<%s>>\n" type))
(widen)
(if (re-search-forward end-exp nil t)
(progn
(setq encoding "7bit")
;; Insert the trailer.
(goto-char (point-max))
- (if multipart
- (insert "--" boundary "--\n")
- (insert "\n--" boundary "--\n")
- )))
+ (insert "\n--" boundary "--\n")
+ ))
(list contype encoding boundary nparts)
))))
(defun mime-editor/enclose-region (type beg end)
(save-excursion
(goto-char beg)
- (let ((current (point))
- need-new-line)
- (or (bolp)
- (setq need-new-line t))
+ (let ((current (point)))
(save-restriction
(narrow-to-region beg end)
- (if need-new-line
- (insert "\n")
- )
(insert (format "--<<%s>>-{\n" type))
(goto-char (point-max))
- (insert (format "\n--}-<<%s>>\n" type))
+ (insert (format "--}-<<%s>>\n" type))
(goto-char (point-max))
)
- (if (and (not (looking-at mime-editor/single-part-tag-regexp))
- (not (eobp)))
+ (or (looking-at mime-editor/beginning-tag-regexp)
+ (eobp)
(insert (mime-make-text-tag) "\n")
- )
+ )
)))
(defun mime-editor/enclose-quote-region (beg end)