* wl-summary.el (wl-summary-write): Add argument `folder'.
authorhmurata <hmurata>
Sat, 13 May 2006 08:34:33 +0000 (08:34 +0000)
committerhmurata <hmurata>
Sat, 13 May 2006 08:34:33 +0000 (08:34 +0000)
(wl-summary-write-current-folder): Change argument `folder' from
optional to require.
(wl-summary-get-buffer): Return the buffer associated folder only.

* wl-folder.el (wl-folder-set-persistent-mark): Follow the above
change.
(wl-folder-toggle-disp-summary): Ditto.

* wl-draft.el (wl-draft-create-buffer): Don't use folder of
current summary as parent-folder.

wl/ChangeLog
wl/wl-draft.el
wl/wl-folder.el
wl/wl-summary.el

index 8c53035..bdc7057 100644 (file)
@@ -1,3 +1,17 @@
+2006-05-13  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl-summary.el (wl-summary-write): Add argument `folder'.
+       (wl-summary-write-current-folder): Change argument `folder' from
+       optional to require.
+       (wl-summary-get-buffer): Return the buffer associated folder only.
+
+       * wl-folder.el (wl-folder-set-persistent-mark): Follow the above
+       change.
+       (wl-folder-toggle-disp-summary): Ditto.
+
+       * wl-draft.el (wl-draft-create-buffer): Don't use folder of
+       current summary as parent-folder.
+
 2006-05-13  Yoichi NAKAYAMA  <yoichi@geiin.org>
 
        * wl-draft.el (wl-draft-reedit): Don't overwrite
index ec9e29b..533da17 100644 (file)
@@ -1671,8 +1671,6 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
 
 (defun wl-draft-create-buffer (&optional parent-folder parent-number)
   (let* ((draft-folder (wl-draft-get-folder))
-        (parent-folder (or parent-folder (wl-summary-buffer-folder-name)))
-        (summary-buf (wl-summary-get-buffer parent-folder))
         (reply-or-forward
          (or (eq this-command 'wl-summary-reply)
              (eq this-command 'wl-summary-reply-with-citation)
@@ -1727,7 +1725,8 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
     (setq wl-draft-parent-folder (or parent-folder ""))
     (setq wl-draft-parent-number parent-number)
     (or (eq this-command 'wl-folder-write-current-folder)
-       (setq wl-draft-buffer-cur-summary-buffer summary-buf))
+       (setq wl-draft-buffer-cur-summary-buffer
+             (wl-summary-get-buffer parent-folder)))
     buffer))
 
 (defun wl-draft-create-contents (header-alist)
index 4e1be53..ffff140 100644 (file)
@@ -522,9 +522,7 @@ Default HASHTB is `wl-folder-elmo-folder-hashtb'."
 (defun wl-folder-set-persistent-mark (folder number flag)
   "Set a persistent mark which corresponds to the specified flag on message."
   (let ((buffer (wl-summary-get-buffer folder)))
-    (if (and buffer
-            (with-current-buffer buffer
-              (string= wl-summary-buffer-folder-name folder)))
+    (if buffer
        (with-current-buffer buffer
          (wl-summary-set-persistent-mark flag number))
       ;; Parent buffer does not exist.
@@ -1417,8 +1415,9 @@ If current line is group folder, all subfolders are marked."
       ;; hide wl-summary window.
       (let ((cur-buf (current-buffer))
            (summary-buffer (wl-summary-get-buffer folder)))
-       (wl-folder-select-buffer summary-buffer)
-       (delete-window)
+       (when summary-buffer
+         (wl-folder-select-buffer summary-buffer)
+         (delete-window))
        (select-window (get-buffer-window cur-buf))))
      (t
       (setq wl-folder-buffer-disp-summary
@@ -1434,9 +1433,11 @@ If current line is group folder, all subfolders are marked."
                (unwind-protect
                    (wl-summary-goto-folder-subr folder-name 'no-sync nil)
                  (select-window (get-buffer-window cur-buf))))
-           (wl-folder-select-buffer (wl-summary-get-buffer folder-name))
-           (delete-window)
-           (select-window (get-buffer-window cur-buf)))))))))
+           (let ((summary-buffer (wl-summary-get-buffer folder-name)))
+             (when summary-buffer
+               (wl-folder-select-buffer summary-buffer)
+               (delete-window))
+             (select-window (get-buffer-window cur-buf))))))))))
 
 (defun wl-folder-prev-unsync ()
   "Move cursor to the previous unsync folder."
index 459e967..590e403 100644 (file)
@@ -2360,9 +2360,13 @@ If ARG, without confirm."
       (beginning-of-line))))
 
 (defun wl-summary-get-buffer (folder)
-  (or (and folder
-          (get-buffer (wl-summary-sticky-buffer-name folder)))
-      (get-buffer wl-summary-buffer-name)))
+  (and folder
+       (or (get-buffer (wl-summary-sticky-buffer-name folder))
+          (let ((buffer (get-buffer wl-summary-buffer-name)))
+            (and buffer
+                 (with-current-buffer buffer
+                   (string= (wl-summary-buffer-folder-name) folder))
+                 buffer)))))
 
 (defun wl-summary-get-buffer-create (name &optional force-sticky)
   (if force-sticky
@@ -4278,11 +4282,10 @@ Reply to author if invoked with ARG."
       (with-current-buffer summary-buf (run-hooks 'wl-summary-reply-hook))
       t)))
 
-(defun wl-summary-write ()
+(defun wl-summary-write (folder)
   "Write a new draft from Summary."
-  (interactive)
-  (wl-draft (list (cons 'To ""))
-           nil nil nil nil (wl-summary-buffer-folder-name))
+  (interactive (list (wl-summary-buffer-folder-name)))
+  (wl-draft (list (cons 'To "")) nil nil nil nil folder)
   (run-hooks 'wl-mail-setup-hook)
   (mail-position-on-field "To"))
 
@@ -4294,12 +4297,10 @@ Reply to author if invoked with ARG."
 Call from `wl-summary-write-current-folder'.
 When guess function return nil, challenge next guess-function.")
 
-(defun wl-summary-write-current-folder (&optional folder)
+(defun wl-summary-write-current-folder (folder)
   "Write message to current FOLDER's newsgroup or mailing-list.
 Use function list is `wl-summary-write-current-folder-functions'."
-  (interactive)
-  ;; default FOLDER is current buffer folder
-  (setq folder (or folder (wl-summary-buffer-folder-name)))
+  (interactive (list (wl-summary-buffer-folder-name)))
   (let ((func-list wl-summary-write-current-folder-functions)
        guess-list guess-func)
     (while func-list
@@ -4309,7 +4310,7 @@ Use function list is `wl-summary-write-current-folder-functions'."
        (setq guess-func (car func-list))
        (setq func-list nil)))
     (if (null guess-func)
-       (wl-summary-write)
+       (wl-summary-write folder)
       (unless (or (stringp (nth 0 guess-list))
                  (stringp (nth 1 guess-list))
                  (stringp (nth 2 guess-list)))