tm 7.45.
authormorioka <morioka>
Mon, 9 Mar 1998 15:56:38 +0000 (15:56 +0000)
committermorioka <morioka>
Mon, 9 Mar 1998 15:56:38 +0000 (15:56 +0000)
ChangeLog
Makefile
gnus/s-path
mh-e/ChangeLog
mh-e/Makefile
mh-e/tm-mh-e.el
tm-edit.el

index 1901952..1ba681b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Mon Feb 26 08:43:36 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
+
+       * tl: Version 7.11.3 was released.
+       * tm: Version 7.45 was released.
+       * tm/mh-e: Version 7.50 was released.
+
+       * tm-edit.el (mime-editor::edit-again): New function.
+       (mime/edit-again): New function.
+
 Fri Feb 23 22:00:46 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
 
        * tm-vm.el (tm-vm/preview-current-message): widen all headers
index f09d7f1..628f018 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,7 +40,7 @@ TL_FILES = tl/README.en tl/Makefile tl/mk-tl tl/*.el tl/doc/*.texi \
 
 FILES  = $(TM_FILES) $(TM_MUA_FILES) $(MEL_FILES) $(TL_FILES)
 
-TARFILE = tm7.44.1.tar.gz
+TARFILE = tm7.45.tar.gz
 
 
 18:
index c76233f..4e76350 100644 (file)
@@ -9,7 +9,7 @@
 ;; please edit
 
 ;; It is relative style. Added path is searched from load-path.
-(add-path "sgnus-0.38/lisp/" 'all-paths)
+(add-path "sgnus-0.43/lisp/" 'all-paths)
 
 ;; It is absolute style.
 ;; (add-path "/usr/local/share/emacs/site-lisp/sgnus/lisp/")
index 318c9d6..25747f4 100644 (file)
@@ -1,3 +1,10 @@
+Mon Feb 26 08:41:56 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
+
+       * tm/mh-e: Version 7.50 was released.
+
+       * tm-mh-e.el (tm-mh-e/edit-again): New function.
+
+\f
 Fri Feb 22 17:58:27 1996  Morioka Tomohiko  <morioka@jaist.ac.jp>
 
        * tm/mh-e: Version 7.49 was released.
index b2a1e3e..7169079 100644 (file)
@@ -24,7 +24,7 @@ TMDIR19       = $(HOME)/lib/emacs19/lisp
 
 
 FILES  = tm/mh-e/*.el tm/mh-e/Makefile tm/mh-e/mk-tmh tm/mh-e/*.ol
-TARFILE = tm-mh-e7.49.tar
+TARFILE = tm-mh-e7.50.tar
 
 
 elc:
index fcb4e1b..22ed96a 100644 (file)
@@ -9,7 +9,7 @@
 ;;; modified by YAMAOKA Katsumi <yamaoka@ga.sony.co.jp>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1993/11/21 (obsolete mh-e-mime.el)
-;;; Version: $Revision: 7.49 $
+;;; Version: $Revision: 7.50 $
 ;;; Keywords: mail, MH, MIME, multimedia, encoded-word, multilingual
 ;;;
 ;;; This file is part of tm (Tools for MIME).
@@ -47,7 +47,7 @@
 ;;;
 
 (defconst tm-mh-e/RCS-ID
-  "$Id: tm-mh-e.el,v 7.49 1996/02/22 17:56:49 morioka Exp $")
+  "$Id: tm-mh-e.el,v 7.50 1996/02/26 08:41:56 morioka Exp $")
 
 (defconst tm-mh-e/version (get-version-string tm-mh-e/RCS-ID))
 
@@ -578,6 +578,36 @@ then prompt for the message sequence. See also documentation for
               (error "There is no current message"))))
     (mh-yank-cur-msg)))
 
+(defun tm-mh-e/edit-again (msg)
+  (require 'mh-comp)
+  (interactive (list (mh-get-msg-num t)))
+  (let* ((from-folder mh-current-folder)
+        (config (current-window-configuration))
+        (draft
+         (cond ((and mh-draft-folder (equal from-folder mh-draft-folder))
+                (pop-to-buffer (find-file-noselect (mh-msg-filename msg)) t)
+                (if mime::preview/article-buffer
+                    (switch-to-buffer mime::preview/article-buffer)
+                  )             
+                (rename-buffer (format "draft-%d" msg))
+                (buffer-name))
+               (t
+                (let ((file-coding-system-for-read *noconv*))
+                  (mh-read-draft "clean-up" (mh-msg-filename msg) nil)
+                  ))
+               )))
+    (setq buffer-read-only nil)
+    (goto-char (point-min))
+    (mh-clean-msg-header (point-min) mh-new-draft-cleaned-headers nil)
+    (if (re-search-forward "^-+$" nil t)
+       (replace-match "")
+      )
+    (mime/edit-again t t)
+    (goto-char (point-min))
+    (set-buffer-modified-p nil)
+    (mh-compose-and-send-mail draft "" from-folder nil nil nil nil nil nil
+                             config)))
+
 (call-after-loaded
  'mime-setup
  (function
@@ -591,6 +621,8 @@ then prompt for the message sequence. See also documentation for
        (substitute-key-definition
         'mh-yank-cur-msg 'tm-mh-e/yank-cur-msg mh-letter-mode-map)
        )))
+    (substitute-key-definition
+     'mh-edit-again 'tm-mh-e/edit-again mh-folder-mode-map)
     )))
 
 
index 332d0b8..d05131d 100644 (file)
@@ -8,7 +8,7 @@
 ;;;         MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Maintainer: MORIOKA Tomohiko <morioka@jaist.ac.jp>
 ;;; Created: 1994/08/21 renamed from mime.el
-;;; Version: $Revision: 7.44 $
+;;; Version: $Revision: 7.45 $
 ;;; Keywords: mail, news, MIME, multimedia, multilingual
 ;;;
 ;;; This file is part of tm (Tools for MIME).
 ;;;
 
 (defconst mime-editor/RCS-ID
-  "$Id: tm-edit.el,v 7.44 1996/02/23 16:16:30 morioka Exp $")
+  "$Id: tm-edit.el,v 7.45 1996/02/26 08:43:36 morioka Exp $")
 
 (defconst mime-editor/version (get-version-string mime-editor/RCS-ID))
 
@@ -2602,6 +2602,126 @@ Content-Type: message/partial; id=%s; number=%d; total=%d\n%s\n"
           )
 
 
+;;; @ edit again
+;;;
+
+(defun mime-editor::edit-again ()
+  (save-excursion
+    (goto-char (point-min))
+    (let ((ctl (mime/Content-Type)))
+      (if ctl
+         (let ((ctype (car ctl))
+               (params (cdr ctl))
+               type stype)
+           (if (string-match "/" ctype)
+               (progn
+                 (setq type (substring ctype 0 (match-beginning 0)))
+                 (setq stype (substring ctype (match-end 0)))
+                 )
+             (setq type ctype)
+             )
+           (cond ((string-equal type "multipart")
+                  (let ((boundary (assoc-value "boundary" params)))
+                    (re-search-forward (concat "--" boundary) nil t)
+                    (let ((bb (match-beginning 0))
+                          eb ee)
+                      (re-search-forward (concat "\n--" boundary "--") nil t)
+                      (setq eb (match-beginning 0))
+                      (setq ee (match-end 0))
+                      (delete-region eb ee)
+                      (save-restriction
+                        (narrow-to-region bb eb)
+                        (goto-char (point-min))
+                        (while (re-search-forward
+                                (concat "\\(\n\\|^\\)--" boundary "\n") nil t)
+                          (let ((beg (match-beginning 0))
+                                end)
+                            (delete-region beg (match-end 0))
+                            (save-excursion
+                              (if (re-search-forward
+                                   (concat "\n--" boundary) nil t)
+                                  (setq end (match-beginning 0))
+                                (setq end (point-max))
+                                )
+                              (save-restriction
+                                (narrow-to-region beg end)
+                                (mime-editor::edit-again)
+                                (goto-char (point-max))
+                                (insert "\n")
+                                ))))
+                        (goto-char (point-min))
+                        (insert (format "--<<%s>>-{\n" stype))
+                        (goto-char (point-max))
+                        (insert (format "\n--}-<<%s>>" stype))
+                        ))
+                    (goto-char (point-min))
+                    (or (= (point-min) 1)
+                        (delete-region (point-min)
+                                       (if (re-search-forward "^$" nil t)
+                                           (match-end 0)
+                                         (point-min)
+                                         )))
+                    ))
+                 (t
+                  (let* ((str (rfc822/get-header-string-except
+                               "^Content-Type" ""))
+                         charset
+                         (pstr
+                          (mapconcat (function
+                                      (lambda (attr)
+                                        (if (string-equal (car attr)
+                                                          "charset")
+                                            (progn
+                                              (setq charset (cdr attr))
+                                              "")
+                                          (concat ";" (car attr)
+                                                  "=" (cdr attr))
+                                          )
+                                        ))
+                                     params ""))
+                         )
+                    (if charset
+                        (mime/code-convert-region-to-emacs (point-min)
+                                                           (point-max)
+                                                           charset)
+                      )
+                    (and str
+                         (setq pstr (concat pstr "\n" str))
+                         )
+                    (or (= (point-min) 1)
+                        (delete-region (point-min)
+                                       (if (re-search-forward "^$" nil t)
+                                           (match-end 0)
+                                         (point-min)
+                                         )))
+                    (insert (mime-create-tag
+                             (concat type "/" stype pstr)))
+                    ))))))))
+
+(defun mime/edit-again (&optional no-separator no-mode)
+  (interactive)
+  (mime-editor::edit-again)
+  (goto-char (point-min))
+  (save-restriction
+    (narrow-to-region (point-min)
+                     (if (re-search-forward "^$" nil t)
+                         (match-end 0)
+                       (point-max)
+                       ))
+    (goto-char (point-min))
+    (while (re-search-forward
+           "^\\(Content-.*\\|Mime-Version\\):" nil t)
+      (delete-region (match-beginning 0) (1+ (rfc822/field-end)))
+      ))
+  (or no-separator
+      (and (re-search-forward "^$")
+          (replace-match mail-header-separator)
+          ))
+  (or no-mode
+      (mime/editor-mode)
+      ))
+
+
 ;;; @ etc
 ;;;