Function: rmail-summary-undelete-many
rmail-summary-undelete-many is an interactive and byte-compiled
function defined in rmailsum.el.gz.
Signature
(rmail-summary-undelete-many &optional N)
Documentation
Undelete all deleted msgs, optional prefix arg N means undelete N prev msgs.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/mail/rmailsum.el.gz
(defun rmail-summary-undelete-many (&optional n)
"Undelete all deleted msgs, optional prefix arg N means undelete N prev msgs."
(interactive "P")
(if n
(while (and (> n 0) (not (eobp)))
(rmail-summary-goto-msg)
(let (del-msg)
(when (rmail-summary-deleted-p)
(with-current-buffer rmail-buffer
(rmail-undelete-previous-message 1)
(setq del-msg rmail-current-message))
(rmail-summary-mark-undeleted del-msg)))
(while (and (not (eobp))
(save-excursion (beginning-of-line)
(looking-at " *[0-9]+ ")))
(forward-line 1))
(setq n (1- n)))
(rmail-summary-goto-msg 1)
(dotimes (_ rmail-total-messages)
(rmail-summary-goto-msg)
(let (del-msg)
(when (rmail-summary-deleted-p)
(with-current-buffer rmail-buffer
(rmail-undelete-previous-message 1)
(setq del-msg rmail-current-message))
(rmail-summary-mark-undeleted del-msg)))
(if (not (eobp))
(forward-line 1))))
;; It looks ugly to move to the empty line at end of buffer.
(and (eobp)
(forward-line -1)))