From: okada Date: Fri, 15 Sep 2000 02:57:42 +0000 (+0000) Subject: Fix X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=af46d81a7dc6df98208bdd07e5c75c8d41328595;p=elisp%2Fwanderlust.git Fix --- diff --git a/elmo/elmo-archive.el b/elmo/elmo-archive.el index 9890852..714f536 100644 --- a/elmo/elmo-archive.el +++ b/elmo/elmo-archive.el @@ -238,7 +238,10 @@ TYPE specifies the archiver's symbol." (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*"))) @@ -258,24 +261,23 @@ TYPE specifies the archiver's symbol." (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)) diff --git a/elmo/elmo-internal.el b/elmo/elmo-internal.el index ac6c2b0..aa297bf 100644 --- a/elmo/elmo-internal.el +++ b/elmo/elmo-internal.el @@ -35,24 +35,26 @@ (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)) diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 679dfe2..af33d0e 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -223,22 +223,24 @@ (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) @@ -382,7 +384,7 @@ &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 @@ -397,7 +399,7 @@ (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)) diff --git a/elmo/elmo-maildir.el b/elmo/elmo-maildir.el index 8a3ca7f..4ca4610 100644 --- a/elmo/elmo-maildir.el +++ b/elmo/elmo-maildir.el @@ -351,25 +351,28 @@ file name for maildir directories." (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))