+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
(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)
(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)
(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.
;; 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
(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."
(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
(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"))
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
(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)))