elmo-imap4-session-select-mailbox.
* wl-vars.el (wl-summary-mark-action-list): Define resend action.
* wl-summary.el (wl-summary-mode-map): Bind resend action.
* wl-highlight.el (wl-highlight-summary-disposed-face): New face
(Renamed from wl-highlight-summary-deleted-face).
(wl-highlight-summary-resend-face): New face.
* wl-address.el (wl-complete-field-to): Added optional argument prompt.
* wl-action.el (wl-summary-get-resend-address): New function.
(wl-summary-exec-action-resend): Ditto.
(wl-summary-exec-action-resend-subr): Ditto.
2003-07-16 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo-imap4.el (elmo-folder-delete-messages-plugged): Call
+ elmo-imap4-session-select-mailbox.
+
* elmo.el (elmo-folder-move-messages): Don't display any message.
* elmo-imap4.el (elmo-imap4-send-command): Accept process output when
(luna-define-method elmo-folder-delete-messages-plugged
((folder elmo-imap4-folder) numbers)
(let ((session (elmo-imap4-get-session folder)))
- (elmo-imap4-set-flag folder numbers "\\Deleted")
+ (elmo-imap4-session-select-mailbox
+ session
+ (elmo-imap4-folder-mailbox-internal folder))
+ (unless (elmo-imap4-set-flag folder numbers "\\Deleted")
+ (error "Failed to set deleted flag"))
(elmo-imap4-send-command session "expunge")))
(defmacro elmo-imap4-detect-search-charset (string)
2003-07-16 Yuuichi Teranishi <teranisi@gohome.org>
+ * wl-vars.el (wl-summary-mark-action-list): Define resend action.
+
+ * wl-summary.el (wl-summary-mode-map): Bind resend action.
+
+ * wl-highlight.el (wl-highlight-summary-disposed-face): New face
+ (Renamed from wl-highlight-summary-deleted-face).
+ (wl-highlight-summary-resend-face): New face.
+
+ (wl-highlight-summary-deleted-face): Renamed from
+ wl-highlight-summary-erased-face.
+
+ * wl-address.el (wl-complete-field-to): Added optional argument prompt.
+
+ * wl-action.el (wl-summary-get-resend-address): New function.
+ (wl-summary-exec-action-resend): Ditto.
+ (wl-summary-exec-action-resend-subr): Ditto.
+
* w-thread.el (wl-thread-copy): Removed definition.
(wl-thread-refile): Ditto.
(wl-thread-delete): Ditto.
(message "Prefetching...done")
0)))
+;; Resend.
+(defun wl-summary-get-resend-address (action number)
+ "Decide resend address."
+ (wl-complete-field-to "Resend message to: "))
+
+(defun wl-summary-exec-action-resend (mark-list)
+ (let ((failure 0))
+ (dolist (mark-info mark-list)
+ (if (condition-case nil
+ (progn
+ (wl-summary-exec-action-resend-subr (car mark-info)
+ (nth 2 mark-info))
+ t)
+ (error))
+ (wl-summary-unmark (car mark-info))
+ (incf failure)))
+ failure))
+
+(defun wl-summary-exec-action-resend-subr (number address)
+ "Resend the message with NUMBER to ADDRESS."
+ (message "Resending message to %s..." address)
+ (let ((folder wl-summary-buffer-elmo-folder))
+ (save-excursion
+ ;; We first set up a normal mail buffer.
+ (set-buffer (get-buffer-create " *wl-draft-resend*"))
+ (buffer-disable-undo (current-buffer))
+ (erase-buffer)
+ (setq wl-sent-message-via nil)
+ ;; Insert our usual headers.
+ (wl-draft-insert-from-field)
+ (wl-draft-insert-date-field)
+ (insert "To: " address "\n")
+ (goto-char (point-min))
+ ;; Rename them all to "Resent-*".
+ (while (re-search-forward "^[A-Za-z]" nil t)
+ (forward-char -1)
+ (insert "Resent-"))
+ (widen)
+ (forward-line)
+ (delete-region (point) (point-max))
+ (let ((beg (point)))
+ ;; Insert the message to be resent.
+ (insert
+ (with-temp-buffer
+ (elmo-message-fetch folder number
+ (elmo-make-fetch-strategy 'entire)
+ nil (current-buffer) 'unread)
+ (buffer-string)))
+ (goto-char (point-min))
+ (search-forward "\n\n")
+ (forward-char -1)
+ (save-restriction
+ (narrow-to-region beg (point))
+ (wl-draft-delete-fields wl-ignored-resent-headers)
+ (goto-char (point-max)))
+ (insert mail-header-separator)
+ ;; Rename all old ("Previous-")Resent headers.
+ (while (re-search-backward "^\\(Previous-\\)*Resent-" beg t)
+ (beginning-of-line)
+ (insert "Previous-"))
+ ;; Quote any "From " lines at the beginning.
+ (goto-char beg)
+ (when (looking-at "From ")
+ (replace-match "X-From-Line: ")))
+ ;; Send it.
+ (wl-draft-dispatch-message)
+ (kill-buffer (current-buffer)))
+ (message "Resending message to %s...done" address)))
+
;;;
(defun wl-summary-remove-destination ()
(save-excursion
(setq entries (cdr entries)))
(append result cl)))
-(defun wl-complete-field-to ()
+(defun wl-complete-field-to (prompt)
(interactive)
(let ((cl wl-address-completion-list))
(if cl
- (completing-read "To: " cl)
- (read-string "To: "))))
+ (completing-read (or prompt "To: ") cl)
+ (read-string (or prompt "To: ")))))
(defalias 'wl-address-quote-specials 'elmo-address-quote-specials)
:group 'wl-summary-faces
:group 'wl-faces)
-(wl-defface wl-highlight-summary-deleted-face
+(wl-defface wl-highlight-summary-disposed-face
'(
(((type tty)
(background dark))
(((class color)
(background light))
(:foreground "DarkKhaki")))
- "Face used for displaying messages mark as deleted."
+ "Face used for displaying messages mark as disposed."
:group 'wl-summary-faces
:group 'wl-faces)
-(wl-defface wl-highlight-summary-erased-face
+(wl-defface wl-highlight-summary-deleted-face
'(
(((type tty)
(background dark))
(((class color)
(background light))
(:foreground "SteelBlue")))
- "Face used for displaying messages mark as erased."
+ "Face used for displaying messages mark as deleted."
:group 'wl-summary-faces
:group 'wl-faces)
:group 'wl-summary-faces
:group 'wl-faces)
+(wl-defface wl-highlight-summary-resend-face
+ '(
+ (((type tty)
+ (background dark))
+ (:foreground "Yellow"))
+ (((class color)
+ (background dark))
+ (:foreground "orange3"))
+ (((class color)
+ (background light))
+ (:foreground "orange3")))
+ "Face used for displaying messages mark as resend."
+ :group 'wl-summary-faces
+ :group 'wl-faces)
+
(wl-defface wl-highlight-summary-refiled-face
'(
(((type tty)
(define-key wl-summary-mode-map "u" 'wl-summary-unmark)
(define-key wl-summary-mode-map "U" 'wl-summary-unmark-all)
(define-key wl-summary-mode-map "D" 'wl-summary-delete)
+ (define-key wl-summary-mode-map "~" 'wl-summary-resend)
;; thread commands
(define-key wl-summary-mode-map "t" (make-sparse-keymap))
(define-key wl-summary-mode-map "tO" 'wl-thread-copy)
(define-key wl-summary-mode-map "td" 'wl-thread-dispose)
(define-key wl-summary-mode-map "tD" 'wl-thread-delete)
+ (define-key wl-summary-mode-map "t~" 'wl-thread-resend)
(define-key wl-summary-mode-map "tu" 'wl-thread-unmark)
(define-key wl-summary-mode-map "t!" 'wl-thread-mark-as-unread)
(define-key wl-summary-mode-map "t$" 'wl-thread-mark-as-important)
;; target-mark commands
(define-key wl-summary-mode-map "m" (make-sparse-keymap))
(define-key wl-summary-mode-map "mi" 'wl-summary-target-mark-prefetch)
- (define-key wl-summary-mode-map "mR" 'wl-summary-target-mark-mark-as-read)
(define-key wl-summary-mode-map "mo" 'wl-summary-target-mark-refile)
(define-key wl-summary-mode-map "mO" 'wl-summary-target-mark-copy)
- (define-key wl-summary-mode-map "md" 'wl-summary-target-mark-delete)
+ (define-key wl-summary-mode-map "md" 'wl-summary-target-mark-dispose)
+ (define-key wl-summary-mode-map "mD" 'wl-summary-target-mark-delete)
+ (define-key wl-summary-mode-map "m~" 'wl-summary-target-mark-resend)
+
+ (define-key wl-summary-mode-map "mu" 'wl-summary-delete-all-temp-marks)
+
(define-key wl-summary-mode-map "my" 'wl-summary-target-mark-save)
+ (define-key wl-summary-mode-map "mR" 'wl-summary-target-mark-mark-as-read)
(define-key wl-summary-mode-map "m!" 'wl-summary-target-mark-mark-as-unread)
(define-key wl-summary-mode-map "m$" 'wl-summary-target-mark-mark-as-important)
- (define-key wl-summary-mode-map "mu" 'wl-summary-delete-all-temp-marks)
(define-key wl-summary-mode-map "mU" 'wl-summary-target-mark-uudecode)
(define-key wl-summary-mode-map "ma" 'wl-summary-target-mark-all)
(define-key wl-summary-mode-map "mt" 'wl-summary-target-mark-thread)
(define-key wl-summary-mode-map "m?" 'wl-summary-target-mark-pick)
(define-key wl-summary-mode-map "m#" 'wl-summary-target-mark-print)
(define-key wl-summary-mode-map "m|" 'wl-summary-target-mark-pipe)
- (define-key wl-summary-mode-map "mD" 'wl-summary-target-mark-delete)
;; region commands
(define-key wl-summary-mode-map "r" (make-sparse-keymap))
(define-key wl-summary-mode-map "rO" 'wl-summary-copy-region)
(define-key wl-summary-mode-map "rd" 'wl-summary-dispose-region)
(define-key wl-summary-mode-map "rD" 'wl-summary-delete-region)
+ (define-key wl-summary-mode-map "r~" 'wl-summary-resend-region)
(define-key wl-summary-mode-map "ru" 'wl-summary-unmark-region)
(define-key wl-summary-mode-map "r!" 'wl-summary-mark-as-unread-region)
(define-key wl-summary-mode-map "r$" 'wl-summary-mark-as-important-region)
nil
wl-summary-register-temp-mark
wl-summary-exec-action-dispose
- wl-highlight-summary-deleted-face
+ wl-highlight-summary-disposed-face
"dispose messages according to `wl-dispose-folder-alist'.")
("D"
delete
nil
wl-summary-register-temp-mark
wl-summary-exec-action-delete
- wl-highlight-summary-erased-face
+ wl-highlight-summary-deleted-face
"delete messages immediately.")
("o"
refile
wl-summary-register-temp-mark
wl-summary-exec-action-prefetch
wl-highlight-summary-prefetch-face
- "prefetch messages."))
+ "prefetch messages.")
+ ("~"
+ resend
+ wl-summary-get-resend-address
+ wl-summary-register-temp-mark
+ wl-summary-exec-action-resend
+ wl-highlight-summary-resend-face
+ ))
"A variable to define Mark & Action.
Each element of the list should be a list of
\(MARK