From ee750374bc8d8494c78f8f03ff616cb17a09a6a3 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sat, 13 May 2006 08:34:33 +0000 Subject: [PATCH] * 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. --- wl/ChangeLog | 14 ++++++++++++++ wl/wl-draft.el | 5 ++--- wl/wl-folder.el | 17 +++++++++-------- wl/wl-summary.el | 25 +++++++++++++------------ 4 files changed, 38 insertions(+), 23 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 8c53035..bdc7057 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,17 @@ +2006-05-13 Hiroya Murata + + * 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 * wl-draft.el (wl-draft-reedit): Don't overwrite diff --git a/wl/wl-draft.el b/wl/wl-draft.el index ec9e29b..533da17 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -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) diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 4e1be53..ffff140 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -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." diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 459e967..590e403 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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))) -- 1.7.10.4