* wl-news.el.in (wl-news-append-to-folder): New function.
authorokada <okada>
Sun, 22 Dec 2002 17:49:11 +0000 (17:49 +0000)
committerokada <okada>
Sun, 22 Dec 2002 17:49:11 +0000 (17:49 +0000)
(wl-news-exit): Rewrite.
(wl-news-discard-and-mail): Merge to `wl-news-exit'.

wl/ChangeLog
wl/wl-news.el.in

index 4669e70..a65b60d 100644 (file)
@@ -1,3 +1,9 @@
+2002-12-23  Kenichi OKADA  <okada@opaopa.org>
+
+       * wl-news.el.in (wl-news-append-to-folder): New function.
+       (wl-news-exit): Rewrite.
+       (wl-news-discard-and-mail): Merge to `wl-news-exit'.
+
 2002-12-22  Kenichi OKADA  <okada@opaopa.org>
 
        * wl-draft.el (wl-draft-reply-position): New function.
index 9872ee9..86bc4eb 100644 (file)
   (define-key wl-news-mode-map "Q"     'wl-news-force-exit)
   (define-key wl-news-mode-map "\C-xk" 'wl-news-exit)
   (define-key wl-news-mode-map "a"     'wl-news-show-all)
+  (define-key wl-news-mode-map "m"     'wl-news-append-to-folder)
   (define-key wl-news-mode-map "\C-m"  'wl-news-next-line)
   (define-key wl-news-mode-map " "     'wl-news-next-page))
 
                  ;; insert news
                  (let ((buffer-read-only nil))
                    (insert "--- Wanderlust NEWS ---  press 'a' to show all NEWS\n")
+                   (insert "                         press 'm' to mail this NEWS to your folder\n")
                    (insert "                         press 'q' to quit\n")
                    (insert "                         press 'Q' to force quit\n\n")
                    (while (car lang)
 
 (defun wl-news-exit ()
   (interactive)
-  (let ((buf))
-    (when (setq buf (get-buffer wl-news-buf-name))
-      (wl-news-discard-and-mail)
+  (let* ((oldest-version (cdr (wl-news-previous-version-load)))
+        (current-version (product-version (product-find 'wl-version)))
+        (new-old-version current-version)
+        (buf (get-buffer wl-news-buf-name)))
+    (when buf
+      (if (wl-news-check-news oldest-version wl-news-lang)
+         (if (y-or-n-p "Do you want to see this message again? ")
+             (progn
+               (message "Please M-x wl-news if you want to see it.")
+               (setq new-old-version oldest-version))))
+      (wl-news-previous-version-save
+       current-version new-old-version)
+      (kill-buffer (current-buffer))
+      (if wl-news-winconf
+         (set-window-configuration wl-news-winconf))
       (kill-buffer buf)
       (if wl-news-winconf
          (set-window-configuration wl-news-winconf)))))
 
-(defun wl-news-discard-and-mail ()
+(defun wl-news-append-to-folder ()
   (interactive)
   (let* ((oldest-version (cdr (wl-news-previous-version-load)))
         (current-version (product-version (product-find 'wl-version)))
-        (new-old-version current-version))
-    (if (wl-news-check-news oldest-version wl-news-lang)
-       (if (y-or-n-p "Do you want to see this message again? ")
-           (progn
-             (message "Please M-x wl-news if you want to see it.")
-             (setq new-old-version oldest-version))
-         (if (y-or-n-p "Do you want this message for a mail? ")
-             (or (wl-news-send-news oldest-version wl-news-lang)
-                 (error
-                  (format "Cannot append NEWS mail to %s" wl-default-folder))))))
-    (wl-news-previous-version-save
-     current-version new-old-version)
-       (kill-buffer (current-buffer))
-       (if wl-news-winconf
-           (set-window-configuration wl-news-winconf))))
+        (new-old-version current-version)
+        (folder wl-default-folder))
+    (if (or (and (elmo-folder-writable-p
+                 (wl-folder-get-elmo-folder folder))
+                (y-or-n-p (format
+                           "Do you want to append this message to %s ? "
+                           wl-default-folder)))
+           (setq folder
+                 (wl-summary-read-folder wl-default-folder "to append ")))
+       (or (wl-news-send-news oldest-version wl-news-lang)
+           (error
+            (format "Cannot append NEWS mail to %s" wl-default-folder))))))
 
 (defun wl-news-force-exit ()
   (interactive)