;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1994/08/21 renamed from mime.el
;; Renamed: 1997/2/21 from tm-edit.el
-;; Version: $Revision: 0.49 $
+;; Version: $Revision: 0.52 $
;; Keywords: MIME, multimedia, multilingual, mail, news
;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
;;;
(defconst mime-edit-RCS-ID
- "$Id: mime-edit.el,v 0.49 1997-02-28 02:20:47 tmorioka Exp $")
+ "$Id: mime-edit.el,v 0.52 1997-03-01 03:39:01 tmorioka Exp $")
(defconst mime-edit-version (get-version-string mime-edit-RCS-ID))
(defconst mime-edit-mime-map (make-sparse-keymap)
"Keymap for MIME commands.")
+
;;; @ keymap and menu
;;;
)
;;; end
+;;; @@ visible/invisible
+;;;
+
+(defmacro enable-invisible ())
+
+(defmacro end-of-invisible ())
+
+(cond (running-xemacs
+ (defun invisible-region (start end)
+ (if (save-excursion
+ (goto-char start)
+ (eq (following-char) ?\n)
+ )
+ (setq start (1+ start))
+ )
+ (put-text-property start end 'invisible t)
+ )
+ (defun invisible-p (pos)
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n)
+ )
+ (setq pos (1+ pos))
+ )
+ (get-text-property pos 'invisible)
+ )
+ )
+ (defun next-visible-point (pos)
+ (save-excursion
+ (if (save-excursion
+ (goto-char pos)
+ (eq (following-char) ?\n)
+ )
+ (setq pos (1+ pos))
+ )
+ (or (next-single-property-change pos 'invisible)
+ (point-max))
+ ))
+ (t
+ (defun invisible-region (start end)
+ (if (save-excursion
+ (goto-char (1- end))
+ (eq (following-char) ?\n)
+ )
+ (setq end (1- end))
+ )
+ (put-text-property start end 'invisible t)
+ )
+ (defun invisible-p (pos)
+ (get-text-property pos 'invisible)
+ )
+ (defun next-visible-point (pos)
+ (save-excursion
+ (goto-char (next-single-property-change pos 'invisible))
+ (if (eq (following-char) ?\n)
+ (forward-char)
+ )
+ (point)
+ ))
+ ))
+
+(defun visible-region (start end)
+ (put-text-property start end 'invisible nil)
+ )
+
;;; @ functions
;;;
))
)))
+(defsubst replace-space-with-underline (str)
+ (mapconcat (function
+ (lambda (arg)
+ (char-to-string
+ (if (eq arg ?\ )
+ ?_
+ arg)))) str "")
+ )
+
+(defun mime-edit-make-boundary ()
+ (concat mime-multipart-boundary "_"
+ (replace-space-with-underline (current-time-string))
+ ))
+
(defun mime-edit-translate-body ()
"Encode the tagged MIME body in current buffer in MIME compliant message."
(interactive)
(save-excursion
- (let ((boundary
- (concat mime-multipart-boundary "_"
- (replace-space-with-underline (current-time-string))
- ))
+ (let ((boundary (mime-edit-make-boundary))
(i 1)
ret)
(while (mime-edit-process-multipart-1
t)))
(defun mime-edit-translate-region (beg end &optional boundary multipart)
- (if (null boundary)
- (setq boundary
- (concat mime-multipart-boundary "_"
- (replace-space-with-underline (current-time-string))))
- )
+ (or boundary
+ (setq boundary (mime-edit-make-boundary))
+ )
(save-excursion
(save-restriction
(narrow-to-region beg end)