* wl-mime.el (wl-message-delete-current-part): Avoid error on
authoryoichi <yoichi>
Mon, 20 Jan 2003 14:05:35 +0000 (14:05 +0000)
committeryoichi <yoichi>
Mon, 20 Jan 2003 14:05:35 +0000 (14:05 +0000)
message without msgid.
Rewrite with elmo-folder-move-messages.
Set wl-message-buffer to nil.

wl/ChangeLog
wl/wl-mime.el

index 950f830..98d49e6 100644 (file)
@@ -1,5 +1,10 @@
 2003-01-20  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
 
+       * wl-mime.el (wl-message-delete-current-part): Avoid error on
+       message without msgid.
+       Rewrite with elmo-folder-move-messages.
+       Set wl-message-buffer to nil.
+
        * wl-summary.el (wl-summary-erase-subr): New function. Use
        elmo-folder-move-messages.
        (wl-summary-erase): Call it.
index 4efa3d1..e057837 100644 (file)
@@ -273,25 +273,26 @@ It calls following-method selected from variable
                 (yes-or-no-p
                  (format "Do you really want to delete part %s? "
                          (wl-mime-node-id-to-string node-id))))
-       (with-temp-buffer
-         (insert-buffer orig-buf)
-         (delete-region header-start body-end)
-         (goto-char header-start)
-         (insert "Content-Type: text/plain; charset=US-ASCII\n\n")
-         (insert "** This part has been removed by Wanderlust **\n\n")
-         (elmo-folder-append-buffer folder t))
-
-       (elmo-folder-append-messages
-        (wl-folder-get-elmo-folder wl-trash-folder)
-        folder (list number) nil)
-       (elmo-folder-delete-messages folder (list number))
-
-       (when (file-exists-p (elmo-cache-get-path msgid))
-         (delete-file (elmo-cache-get-path msgid)))
-
-       (mime-preview-quit)
-       (wl-summary-toggle-disp-msg 'off)
-       (wl-summary-sync nil "update")))))
+       (when (with-temp-buffer
+               (insert-buffer orig-buf)
+               (delete-region header-start body-end)
+               (goto-char header-start)
+               (insert "Content-Type: text/plain; charset=US-ASCII\n\n")
+               (insert "** This part has been removed by Wanderlust **\n\n")
+               (elmo-folder-append-buffer folder t))
+
+         (elmo-folder-move-messages
+          folder (list number)
+          (wl-folder-get-elmo-folder wl-trash-folder))
+         (when (and (elmo-cache-get-path msgid)
+                    (file-exists-p (elmo-cache-get-path msgid)))
+           (delete-file (elmo-cache-get-path msgid)))
+
+         (mime-preview-quit)
+         (wl-summary-delete-messages-on-buffer (list number))
+         (wl-summary-toggle-disp-msg 'off)
+         (setq wl-message-buffer nil)
+         (wl-summary-sync nil "update"))))))
 
 (defun wl-message-decrypt-pgp-nonmime ()
   "Decrypt PGP encrypted region"