* wl-summary.el (wl-summary-erase): New function to erase message
authoryoichi <yoichi>
Fri, 8 Nov 2002 08:09:59 +0000 (08:09 +0000)
committeryoichi <yoichi>
Fri, 8 Nov 2002 08:09:59 +0000 (08:09 +0000)
without moving it to trash. Bind to "D".

wl/ChangeLog
wl/wl-summary.el

index 051c7ce..7064551 100644 (file)
@@ -1,5 +1,8 @@
 2002-11-08  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
 
+       * wl-summary.el (wl-summary-erase): New function to erase message
+       without moving it to trash. Bind to "D".
+
        * wl-draft.el (wl-user-agent-compose): Set wl-draft-buffer-style
        as `keep' unless switch-function.
 
index 04322a2..ce86452 100644 (file)
@@ -406,7 +406,6 @@ See also variable `wl-use-petname'."
   (define-key wl-summary-mode-map "g"    'wl-summary-goto-folder)
   (define-key wl-summary-mode-map "G"    'wl-summary-goto-folder-sticky)
   (define-key wl-summary-mode-map "c"    'wl-summary-mark-as-read-all)
-;  (define-key wl-summary-mode-map "D"    'wl-summary-drop-unsync)
 
   (define-key wl-summary-mode-map "a"    'wl-summary-reply)
   (define-key wl-summary-mode-map "A"    'wl-summary-reply-with-citation)
@@ -476,6 +475,7 @@ See also variable `wl-use-petname'."
   (define-key wl-summary-mode-map "d"    'wl-summary-delete)
   (define-key wl-summary-mode-map "u"    'wl-summary-unmark)
   (define-key wl-summary-mode-map "U"    'wl-summary-unmark-all)
+  (define-key wl-summary-mode-map "D"    'wl-summary-erase)
 
   ;; thread commands
   (define-key wl-summary-mode-map "t"  (make-sparse-keymap))
@@ -3133,6 +3133,29 @@ If optional argument NUMBER is specified, mark message specified by NUMBER."
                           "")
                         "."))))))
 
+(defun wl-summary-erase (&optional number)
+  "Erase message actually, without moving it to trash."
+  (interactive)
+  (if (elmo-folder-writable-p wl-summary-buffer-elmo-folder)
+      (let* ((buffer-num (wl-summary-message-number))
+            (msg-num (or number buffer-num)))
+       (if (null msg-num)
+           (message "No message.")
+         (let* ((msgdb (wl-summary-buffer-msgdb))
+                (entity (elmo-msgdb-overview-get-entity msg-num msgdb))
+                (subject (elmo-delete-char
+                          ?\n (or (elmo-msgdb-overview-entity-get-subject
+                                   entity)
+                                  wl-summary-no-subject-message))))
+           (when (yes-or-no-p
+                  (format "Erase \"%s\" without moving it to trash? "
+                          (truncate-string subject 30)))
+             (wl-summary-unmark msg-num)
+             (elmo-folder-delete-messages wl-summary-buffer-elmo-folder
+                                          (list msg-num))
+             (wl-summary-sync nil "update")))))
+    (message "Read-only folder.")))
+
 (defun wl-summary-read-folder (default &optional purpose ignore-error
                                no-create init)
   (let ((fld (completing-read