From: teranisi Date: Thu, 13 Jul 2000 02:13:35 +0000 (+0000) Subject: * elmo-msgdb.el (elmo-msgdb-append-to-killed-list): New function. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f84b12d66edf5fd60301b41e9702907db8a4f123;p=elisp%2Fwanderlust.git * elmo-msgdb.el (elmo-msgdb-append-to-killed-list): New function. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 9ec1f6a..1c18792 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,7 @@ +2000-07-13 Yuuichi Teranishi + + * elmo-msgdb.el (elmo-msgdb-append-to-killed-list): New function. + 2000-07-12 Hiroya Murata * elmo-pop3.el (elmo-pop3-clear-killed): New alias. diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index 268713a..b5bcc65 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -4,7 +4,7 @@ ;; Author: Yuuichi Teranishi ;; Keywords: mail, net news -;; Time-stamp: <00/05/11 09:20:11 teranisi> +;; Time-stamp: <00/07/13 10:32:40 teranisi> ;; This file is part of ELMO (Elisp Library for Message Orchestration). @@ -561,80 +561,17 @@ content of MSGDB is changed." killed-list)) (defun elmo-msgdb-killed-message-p (killed-list msg) - (and killed-list - (not (listp - (catch 'found - (mapcar - (function - (lambda (entity) - (cond - ((integerp entity) - (if (eq entity msg) - (throw 'found t))) - ((consp entity) - (if (and (<= (car entity) msg) - (<= msg (cdr entity))) - (throw 'found t))))) - killed-list))))))) + (memq msg killed-list)) (defun elmo-msgdb-set-as-killed (killed-list msg) - "if cons cell, set car-cdr messages as killed. -if integer, set number th message as killed." - (let ((dlist killed-list) - (ret-val killed-list) - entity found) - (cond - ((integerp msg) - (while (and dlist (not found)) - (setq entity (car dlist)) - (if (or (and (integerp entity) (eq entity msg)) - (and (consp entity) - (<= (car entity) msg) - (<= msg (cdr entity)))) - (setq found t)) - (setq dlist (cdr dlist)) - ) - (if (not found) - (setq ret-val (elmo-msgdb-append-element killed-list msg))) - ) - ((consp msg) - (while (and dlist (not found)) - (setq entity (car dlist)) - (if (integerp entity) - (cond - ((and (<= (car msg) entity)(<= entity (cdr msg))) - (setcar dlist msg) - (setq found t) - ) - ((= (1- (car msg)) entity) - (setcar dlist (cons entity (cdr msg))) - (setq found t) - ) - ((= (1+ (cdr msg)) entity) - (setcar dlist (cons (car msg) entity)) - (setq found t) - )) - ;; entity is consp - (cond ; there are four patterns - ((and (<= (car msg) (car entity)) - (<= (cdr entity) (cdr msg))) - (setcar dlist msg) - (setq found t)) - ((and (< (car entity)(car msg)) - (< (cdr msg) (cdr entity))) - (setq found t)) - ((and (<= (car msg) (car entity)) - (<= (cdr msg) (cdr entity))) - (setcar dlist (cons (car msg) (cdr entity))) - (setq found t)) - ((and (<= (car entity) (car msg)) - (<= (cdr entity) (cdr msg))) - (setcar dlist (cons (car entity) (cdr msg))) - (setq found t)))) - (setq dlist (cdr dlist))) - (if (not found) - (setq ret-val (elmo-msgdb-append-element killed-list msg))))) - ret-val)) + (elmo-msgdb-append-element killed-list msg)) + +(defun elmo-msgdb-append-to-killed-list (folder msgs) + (let ((dir (elmo-msgdb-expand-path folder))) + (elmo-msgdb-killed-list-save + dir + (nconc (elmo-msgdb-killed-list-load dir) + msgs)))) (defun elmo-msgdb-finfo-load () (elmo-object-load (expand-file-name