(args (list file))
(file-regexp (format (elmo-archive-get-regexp type)
(elmo-concat-path (regexp-quote prefix) "")))
- buf file-list header-end)
+ (killed (and elmo-use-killed-list
+ (elmo-msgdb-killed-list-load
+ (elmo-msgdb-expand-path nil spec))))
+ numbers buf file-list header-end)
(when (file-exists-p file)
(save-excursion
(set-buffer (setq buf (get-buffer-create " *ELMO ARCHIVE ls*")))
(match-string 1))))))
(kill-buffer buf)))
(if nonsort
- (cons (or (elmo-max-of-list file-list) 0) (length file-list))
- (sort file-list '<))))
+ (cons (or (elmo-max-of-list file-list) 0)
+ (if killed
+ (- (length file-list) (length killed))
+ (length file-list)))
+ (setq numbers (sort file-list '<))
+ (if killed
+ (delq nil
+ (mapcar (lambda (number)
+ (unless (memq number killed) number))
+ numbers))
+ numbers))))
(defun elmo-archive-list-folder (spec)
(let* ((type (nth 2 spec))
(prefix (nth 3 spec))
- (arc (elmo-archive-get-archive-name (nth 1 spec) type spec))
- (killed (and elmo-use-killed-list
- (elmo-msgdb-killed-list-load
- (elmo-msgdb-expand-path nil spec))))
- numbers)
- (setq numbers (elmo-archive-list-folder-subr arc type prefix))
- (if killed
- (delq nil
- (mapcar (lambda (number)
- (unless (memq number killed) number))
- numbers))
- numbers)))
+ (arc (elmo-archive-get-archive-name (nth 1 spec) type spec)))
+ (elmo-archive-list-folder-subr arc type prefix)))
(defun elmo-archive-max-of-folder (spec)
(let* ((type (nth 2 spec))
(arg (nth 2 spec))
(flist (elmo-list-folder-by-location
spec
- (elmo-internal-list-location directive arg))))
+ (elmo-internal-list-location directive arg)))
+ (killed (and elmo-use-killed-list
+ (elmo-msgdb-killed-list-load
+ (elmo-msgdb-expand-path nil spec))))
+ numbers)
(if nonsort
(cons (or (elmo-max-of-list flist) 0)
- (length flist))
- (sort flist '<))))
+ (if killed
+ (- (length flist) (length killed))
+ (length flist)))
+ (setq numbers (sort flist '<))
+ (if killed
+ (delq nil
+ (mapcar (lambda (number)
+ (unless (memq number killed) number))
+ numbers))
+ numbers))))
(defun elmo-internal-list-folder (spec)
- (let ((killed (and elmo-use-killed-list
- (elmo-msgdb-killed-list-load
- (elmo-msgdb-expand-path nil spec))))
- numbers)
- (setq numbers (elmo-internal-list-folder-subr spec))
- (if killed
- (delq nil
- (mapcar (lambda (number)
- (unless (memq number killed) number))
- numbers))
- numbers)))
+ (elmo-internal-list-folder-subr spec))
(defun elmo-internal-list-folder-by-location (spec location &optional msgdb)
(let* ((path (elmo-msgdb-expand-path nil spec))
(elmo-msgdb-killed-list-load
(elmo-msgdb-expand-path nil spec))))
numbers)
- (setq numbers
- (if nonsort
- (cons (or (elmo-max-of-list flist) 0) (length flist))
- (sort flist '<)))
- (if killed
- (delq nil
- (mapcar (lambda (number)
- (unless (memq number killed) number))
- numbers))
- numbers)))
+ (if nonsort
+ (cons (or (elmo-max-of-list flist) 0)
+ (if killed
+ (- (length flist) (length killed))
+ (length flist)))
+ (setq numbers (sort flist '<))
+ (if killed
+ (delq nil
+ (mapcar (lambda (number)
+ (unless (memq number killed) number))
+ numbers))
+ numbers))))
(defun elmo-localdir-append-msg (spec string &optional msg no-see)
(let ((dir (elmo-localdir-get-folder-directory spec))
(tmp-buffer (get-buffer-create " *ELMO Temp buffer*"))
(next-num (or msg
- (1+ (car (elmo-localdir-list-folder-subr spec t)))))
+ (1+ (car (elmo-localdir-max-of-folder spec)))))
filename)
(save-excursion
(set-buffer tmp-buffer)
&optional loc-alist same-number)
(let ((dst-dir
(elmo-localdir-get-folder-directory dst-spec))
- (next-num (1+ (car (elmo-localdir-list-folder-subr dst-spec t)))))
+ (next-num (1+ (car (elmo-localdir-max-of-folder dst-spec)))))
(while msgs
(elmo-copy-file
;; src file
(if (and (eq (car dst-spec) 'localdir)
(elmo-localdir-locked-p))
;; MDA is running.
- (1+ (car (elmo-localdir-list-folder-subr dst-spec t)))
+ (1+ (car (elmo-localdir-max-of-folder dst-spec)))
(1+ next-num)))))
t))
(flist (elmo-list-folder-by-location
spec
(car (elmo-maildir-list-location dir))))
- (news (car (elmo-maildir-list-location dir "new"))))
+ (killed (and elmo-use-killed-list
+ (elmo-msgdb-killed-list-load
+ (elmo-msgdb-expand-path nil spec))))
+ (news (car (elmo-maildir-list-location dir "new")))
+ numbers)
(if nonsort
(cons (+ (or (elmo-max-of-list flist) 0) (length news))
- (+ (length flist) (length news)))
- (sort flist '<))))
+ (+ (length news)
+ (if killed
+ (- (length flist) (length killed))
+ (length flist))))
+ (setq numbers (sort flist '<))
+ (if killed
+ (delq nil
+ (mapcar (lambda (number)
+ (unless (memq number killed) number))
+ numbers))
+ numbers))))
(defun elmo-maildir-list-folder (spec)
(elmo-maildir-update-current spec)
- (let ((killed (and elmo-use-killed-list
- (elmo-msgdb-killed-list-load
- (elmo-msgdb-expand-path nil spec))))
- numbers)
- (setq numbers (elmo-maildir-list-folder-subr spec))
- (if killed
- (delq nil
- (mapcar (lambda (number)
- (unless (memq number killed) number))
- numbers))
- numbers)))
+ (elmo-maildir-list-folder-subr spec))
(defun elmo-maildir-max-of-folder (spec)
(elmo-maildir-list-folder-subr spec t))