From: yoichi Date: Sat, 19 Jun 2004 15:23:03 +0000 (+0000) Subject: * wl-summary.el (wl-summary-exec-with-confirmation): Extracted X-Git-Tag: wl-2_11_31~99 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=8800c64aab62951109d63f061bed141a80b403c8;p=elisp%2Fwanderlust.git * wl-summary.el (wl-summary-exec-with-confirmation): Extracted from `wl-summary-cleanup-temp-marks'. (wl-summary-cleanup-temp-marks): Abolish argument. * wl.el (wl-save-status): Revert previous change. (wl-execute-temp-marks): New function, call `wl-summary-exec-with-confirmation'. * wl-folder.el (wl-folder-mode-map): Bind "x" to it. (wl-folder-save-and-exec-marks): Abolished. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index 9d2e83b..374aea4 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,14 @@ +2004-06-20 Yoichi NAKAYAMA + + * wl-summary.el (wl-summary-exec-with-confirmation): Extracted + from `wl-summary-cleanup-temp-marks'. + (wl-summary-cleanup-temp-marks): Abolish argument. + * wl.el (wl-save-status): Revert previous change. + (wl-execute-temp-marks): New function, call + `wl-summary-exec-with-confirmation'. + * wl-folder.el (wl-folder-mode-map): Bind "x" to it. + (wl-folder-save-and-exec-marks): Abolished. + 2004-06-19 Yoichi NAKAYAMA * wl-e21.el (wl-e21-display-image-p): Respect diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 2a16631..03f4a15 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -187,7 +187,7 @@ (define-key wl-folder-mode-map "?" 'wl-folder-pick) (define-key wl-folder-mode-map "q" 'wl-exit) (define-key wl-folder-mode-map "z" 'wl-folder-suspend) - (define-key wl-folder-mode-map "x" 'wl-folder-save-and-exec-marks) + (define-key wl-folder-mode-map "x" 'wl-execute-temp-marks) (define-key wl-folder-mode-map "\M-t" 'wl-toggle-plugged) (define-key wl-folder-mode-map "\C-t" 'wl-plugged-change) (define-key wl-folder-mode-map "<" 'beginning-of-buffer) @@ -2288,10 +2288,6 @@ Use `wl-subscribed-mailing-list'." (wl-folder-get-elmo-folder fld-name)) nil sticky t))) -(defun wl-folder-save-and-exec-marks () - (interactive) - (wl-save 'exec-marks)) - (defun wl-folder-suspend () (interactive) (run-hooks 'wl-folder-suspend-hook) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 6db22c0..7860827 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -1088,20 +1088,23 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." (defun wl-summary-thread-modified-p () wl-summary-buffer-thread-modified) -(defun wl-summary-cleanup-temp-marks (&optional default-keep) +(defun wl-summary-exec-with-confirmation (&optional message) (when wl-summary-buffer-temp-mark-list - (if (y-or-n-p (format "Execute marks in %s?%s " - (wl-summary-buffer-folder-name) - (if default-keep - "" - " (answer \"n\" to discard them)"))) + (if (y-or-n-p (or message + (format "Execute marks in %s? " + (wl-summary-buffer-folder-name)))) (progn (wl-summary-exec) (if wl-summary-buffer-temp-mark-list (error "Some execution was failed"))) ;; temp-mark-list is remained. - (message ""))) - (unless default-keep + (message "")))) + +(defun wl-summary-cleanup-temp-marks () + (when wl-summary-buffer-temp-mark-list + (wl-summary-exec-with-confirmation + (format "Execute marks in %s? (answer \"n\" to discard them) " + (wl-summary-buffer-folder-name))) (wl-summary-delete-all-temp-marks 'no-msg) (setq wl-summary-scored nil))) diff --git a/wl/wl.el b/wl/wl.el index 1cc8a26..3a371e6 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -626,20 +626,30 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." ;;; end of wl-plugged-mode -(defun wl-save (&optional exec-marks) +(defun wl-save () "Save summary and folder status." - (interactive "P") - (wl-save-status 'keep-summary (not exec-marks)) + (interactive) + (wl-save-status 'keep-summary) (run-hooks 'wl-save-hook)) -(defun wl-save-status (&optional keep-summary leave-marks) +(defun wl-execute-temp-marks () + "Execute temporary marks in summary buffers." + (interactive) + (let ((summaries (wl-collect-summary))) + (while summaries + (with-current-buffer (car summaries) + (wl-summary-exec-with-confirmation) + (wl-summary-save-status)) + (setq summaries (cdr summaries))))) + +(defun wl-save-status (&optional keep-summary) (message "Saving summary and folder status...") (save-excursion (let ((summaries (wl-collect-summary))) (while summaries (with-current-buffer (car summaries) - (unless leave-marks - (wl-summary-cleanup-temp-marks keep-summary)) + (unless keep-summary + (wl-summary-cleanup-temp-marks)) (wl-summary-save-view) (elmo-folder-commit wl-summary-buffer-elmo-folder) (unless keep-summary