+2000-07-11 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo2.el (elmo-move-msgs): Don't move message when buffer-size is 0.
+
+ * elmo-nntp.el (elmo-nntp-delete-msgs): Check the value of
+ `elmo-nntp-use-killed-list'.
+ (elmo-nntp-list-folder): Use killed list.
+ (elmo-nntp-max-of-folder): Ditto.
+ (elmo-nntp-msgdb-create): Set killed list.
+
+ * elmo-vars.el (elmo-nntp-use-killed-list): New user option.
+
+ * elmo2.el (elmo-clear-killed): New backend function.
+ All other related modules are changed.
+
2000-07-07 OKAZAKI Tetsurou <okazaki@be.to>
* elmo-util.el (elmo-imap4-spec-folder): Use
(defalias 'elmo-archive-list-folder-important
'elmo-generic-list-folder-important)
(defalias 'elmo-archive-commit 'elmo-generic-commit)
+(defalias 'elmo-archive-clear-killed 'elmo-generic-clear-killed)
;;; End
(run-hooks 'elmo-archive-load-hook)
(defalias 'elmo-cache-list-folder-important
'elmo-generic-list-folder-important)
(defalias 'elmo-cache-commit 'elmo-generic-commit)
+(defalias 'elmo-cache-clear-killed 'elmo-cache-clear-killed)
(provide 'elmo-cache)
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <00/03/13 18:58:42 teranisi>
+;; Time-stamp: <00/07/10 17:55:56 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(defun elmo-filter-commit (spec)
(elmo-commit (nth 2 spec)))
+(defun elmo-filter-clear-killed (spec)
+ (elmo-clear-killed (nth 2 spec)))
+
(defun elmo-filter-plugged-p (spec)
(elmo-folder-plugged-p (nth 2 spec)))
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <00/03/14 19:40:38 teranisi>
+;; Time-stamp: <00/07/10 17:52:16 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(defalias 'elmo-imap4-sync-number-alist 'elmo-generic-sync-number-alist)
+(defalias 'elmo-imap4-clear-killed 'elmo-generic-clear-killed)
+
(provide 'elmo-imap4)
;;; elmo-imap4.el ends here
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <2000-03-03 11:12:17 teranisi>
+;; Time-stamp: <00/07/10 17:57:16 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(defalias 'elmo-internal-list-folder-important
'elmo-generic-list-folder-important)
(defalias 'elmo-internal-commit 'elmo-generic-commit)
+(defalias 'elmo-internal-clear-killed 'elmo-generic-clear-killed)
(provide 'elmo-internal)
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <2000-05-18 17:09:15 teranisi>
+;; Time-stamp: <00/07/10 17:52:07 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(defalias 'elmo-localdir-list-folder-important
'elmo-generic-list-folder-important)
(defalias 'elmo-localdir-commit 'elmo-generic-commit)
+(defalias 'elmo-localdir-clear-killed 'elmo-generic-clear-killed)
(provide 'elmo-localdir)
;; Yuuichi Teranishi <teranisi@gohome.org>
;; Author: OKUNISHI Fujikazu <fuji0924@mbox.kyoto-inet.or.jp>
-;; Time-stamp: <2000-01-24 12:20:07 teranisi>
+;; Time-stamp: <00/07/10 17:57:30 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(defalias 'elmo-localnews-list-folder-important
'elmo-generic-list-folder-important)
(defalias 'elmo-localnews-commit 'elmo-generic-commit)
+(defalias 'elmo-localnews-clear-killed 'elmo-generic-clear-killed)
(provide 'elmo-localnews)
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <00/04/24 10:19:24 teranisi>
+;; Time-stamp: <00/07/10 17:57:40 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
'elmo-generic-list-folder-unread)
(defalias 'elmo-maildir-list-folder-important
'elmo-generic-list-folder-important)
+(defalias 'elmo-maildir-clear-killed 'elmo-generic-clear-killed)
(provide 'elmo-maildir)
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <00/03/14 19:41:07 teranisi>
+;; Time-stamp: <00/07/10 17:54:06 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(defun elmo-multi-commit (spec)
(mapcar 'elmo-commit (cdr spec)))
+(defun elmo-multi-clear-killed (spec)
+ (mapcar 'elmo-clear-killed (cdr spec)))
+
(defun elmo-multi-plugged-p (spec)
(let* ((flds (cdr spec)))
(catch 'plugged
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <00/04/28 10:30:51 teranisi>
+;; Time-stamp: <00/07/11 09:46:12 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(defun elmo-nntp-list-folder (spec)
(elmo-nntp-setting spec
- (let* ((server (format "%s" server)) ;; delete text property
- response retval use-listgroup)
- (save-excursion
- (when (setq use-listgroup (elmo-nntp-listgroup-p server port))
- (elmo-nntp-send-command buffer
- process
- (format "listgroup %s" folder))
- (if (not (elmo-nntp-read-response buffer process t))
- (progn
- (elmo-nntp-set-listgroup server port nil)
- (setq use-listgroup nil))
- (if (null (setq response (elmo-nntp-read-contents buffer process)))
- (error "Fetching listgroup failed"))
- (setq retval (elmo-string-to-list response))))
- (if use-listgroup
- retval
- (elmo-nntp-send-command buffer
- process
- (format "group %s" folder))
- (if (null (setq response (elmo-nntp-read-response buffer process)))
- (error "Select folder failed"))
- (setcar (cddr connection) folder)
- (if (and
- (string-match "211 \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\) [^.].+$"
- response)
- (> (string-to-int (elmo-match-string 1 response)) 0))
- (elmo-nntp-make-msglist
- (elmo-match-string 2 response)
- (elmo-match-string 3 response))
- nil))))))
+ (let* ((server (format "%s" server)) ;; delete text property
+ (killed (and elmo-nntp-use-killed-list
+ (elmo-msgdb-killed-list-load
+ (elmo-msgdb-expand-path nil spec))))
+ response numbers use-listgroup)
+ (save-excursion
+ (when (setq use-listgroup (elmo-nntp-listgroup-p server port))
+ (elmo-nntp-send-command buffer
+ process
+ (format "listgroup %s" folder))
+ (if (not (elmo-nntp-read-response buffer process t))
+ (progn
+ (elmo-nntp-set-listgroup server port nil)
+ (setq use-listgroup nil))
+ (if (null (setq response (elmo-nntp-read-contents buffer process)))
+ (error "Fetching listgroup failed"))
+ (setq numbers (elmo-string-to-list response))))
+ (unless use-listgroup
+ (elmo-nntp-send-command buffer
+ process
+ (format "group %s" folder))
+ (if (null (setq response (elmo-nntp-read-response buffer process)))
+ (error "Select folder failed"))
+ (setcar (cddr connection) folder)
+ (if (and
+ (string-match
+ "211 \\([0-9]+\\) \\([0-9]+\\) \\([0-9]+\\) [^.].+$"
+ response)
+ (> (string-to-int (elmo-match-string 1 response)) 0))
+ (setq numbers (elmo-nntp-make-msglist
+ (elmo-match-string 2 response)
+ (elmo-match-string 3 response)))))
+ (delq nil
+ (mapcar (lambda (number)
+ (unless (memq number killed)
+ number))
+ numbers))))))
(defun elmo-nntp-max-of-folder (spec)
(let* ((port (elmo-nntp-spec-port spec))
(user (elmo-nntp-spec-username spec))
(server (elmo-nntp-spec-hostname spec))
(ssl (elmo-nntp-spec-ssl spec))
- (folder (elmo-nntp-spec-group spec)))
+ (folder (elmo-nntp-spec-group spec))
+ (dir (elmo-msgdb-expand-path nil spec))
+ (killed-list (and elmo-nntp-use-killed-list
+ (elmo-msgdb-killed-list-load dir)))
+ number-alist)
(if elmo-nntp-groups-async
(let* ((fld (concat folder
(elmo-nntp-folder-postfix user server port ssl)))
(elmo-match-string 3 response)))
(setq e-num (string-to-int
(elmo-match-string 1 response)))
+ (when (and killed-list elmo-nntp-use-killed-list)
+ (setq killed-list (nreverse (sort killed-list '<)))
+ (cond
+ ;; XXX biggest number in server is killed,
+ ;; so max number is unknown (treated as no unsync).
+ ((eq end-num (car killed-list))
+ (setq end-num nil))
+ ;; killed number is obsolete.
+ ((< end-num (car killed-list))
+ (while killed-list
+ (when (>= end-num (car killed-list))
+ (elmo-msgdb-killed-list-save dir killed-list)
+ (setq killed-list nil))
+ (setq killed-list (cdr killed-list))))))
(cons end-num e-num))
(if (null response)
(error "Selecting newsgroup \"%s\" failed" folder)
(let* ((cwf (caddr connection))
(filter (and as-num numlist))
beg-num end-num cur length
- ret-val ov-str use-xover)
+ ret-val ov-str use-xover dir)
(if (and folder
(not (string= cwf folder))
(null (elmo-nntp-goto-folder server folder user port ssl)))
important-mark
seen-list
filter))))))
+ (when elmo-nntp-use-killed-list
+ (setq dir (elmo-msgdb-expand-path nil spec))
+ (elmo-msgdb-killed-list-save
+ dir
+ (nconc
+ (elmo-msgdb-killed-list-load dir)
+ (car (elmo-list-diff
+ numlist
+ (mapcar 'car
+ (elmo-msgdb-get-number-alist
+ ret-val)))))))
;; If there are canceled messages, overviews are not obtained
;; to max-number(inn 2.3?).
(when (and (elmo-nntp-max-number-precedes-list-active-p)
(setq errmsg "Fetching message failed")
(set-buffer outbuf)
(erase-buffer)
- (insert "\n\n")
+ ;(insert "\n\n")
(throw 'done nil)))
(setq response (elmo-nntp-read-body buffer process outbuf))
(set-buffer outbuf)
(elmo-nntp-send-data-line process sending-data))))
+(defun elmo-nntp-clear-killed (spec)
+ (elmo-msgdb-killed-list-save (elmo-msgdb-expand-path nil spec) nil))
(defun elmo-nntp-delete-msgs (spec msgs)
"MSGS on FOLDER at SERVER pretended as Deleted. Returns nil if failed."
- (let* ((dir (elmo-msgdb-expand-path nil spec))
-; (msgs (mapcar 'string-to-int msgs))
- (killed-list (elmo-msgdb-killed-list-load dir)))
- (mapcar '(lambda (msg)
- (setq killed-list
- (elmo-msgdb-set-as-killed killed-list msg)))
- msgs)
- (elmo-msgdb-killed-list-save dir killed-list)
- t))
+ (if elmo-nntp-use-killed-list
+ (let* ((dir (elmo-msgdb-expand-path nil spec))
+ (killed-list (elmo-msgdb-killed-list-load dir)))
+ (mapcar '(lambda (msg)
+ (setq killed-list
+ (elmo-msgdb-set-as-killed killed-list msg)))
+ msgs)
+ (elmo-msgdb-killed-list-save dir killed-list)))
+ t)
(defun elmo-nntp-check-validity (spec validity-file)
t)
(elmo-msgdb-append-element
overview entity))
(setq number-alist
- (elmo-msgdb-number-add number-alist
- (elmo-msgdb-overview-entity-get-number entity)
- (car entity)))
+ (elmo-msgdb-number-add
+ number-alist
+ (elmo-msgdb-overview-entity-get-number entity)
+ (car entity)))
(setq message-id (car entity))
(setq seen (member message-id seen-list))
(if (setq gmark
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <2000-03-03 14:06:56 teranisi>
+;; Time-stamp: <00/07/10 17:58:38 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(elmo-commit (elmo-pipe-spec-src spec))
(elmo-commit (elmo-pipe-spec-dst spec)))
+(defun elmo-pipe-clear-killed (spec)
+ (elmo-clear-killed (elmo-pipe-spec-src spec)))
+
(defun elmo-pipe-plugged-p (spec)
(and (elmo-folder-plugged-p (elmo-pipe-spec-src spec))
(elmo-folder-plugged-p (elmo-pipe-spec-dst spec))))
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <00/05/10 10:15:20 teranisi>
+;; Time-stamp: <00/07/10 10:35:15 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
"Non-nil means max number of msgdb is set as the max number of `list active'.
(Needed for inn 2.3 or later?).")
+(defvar elmo-nntp-use-killed-list t
+ "If non-nil, deleted messages are saved as `killed'
+and do not appear again.")
+
(defvar elmo-pop3-send-command-synchronously nil
"If non-nil, commands are send synchronously.
If server doesn't accept asynchronous commands, this variable should be
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
-;; Time-stamp: <2000-05-18 17:49:09 teranisi>
+;; Time-stamp: <00/07/10 20:24:29 teranisi>
;; This file is part of ELMO (Elisp Library for Message Orchestration).
(if (setq ret-val (elmo-call-func (car real-fld-num)
"read-msg"
(cdr real-fld-num) outbuf))
- (if (and (not (elmo-local-file-p folder msg))
+ (if (and message-id
+ (not (elmo-local-file-p folder msg))
(elmo-use-cache-p folder msg))
(elmo-cache-save message-id
(elmo-string-partial-p ret-val)
(not (eq pair
(rassoc message-id
number-alist)))))))
- (unless (elmo-append-msg dst-folder (buffer-string) message-id
- (if same-number (car messages))
- ;; null means all unread.
- (or (null unread-marks)
- unseen))
- (error "move: append message to %s failed" dst-folder))))
+ (unless (eq (buffer-size) 0)
+ (unless (elmo-append-msg dst-folder (buffer-string) message-id
+ (if same-number (car messages))
+ ;; null means all unread.
+ (or (null unread-marks)
+ unseen))
+ (error "move: append message to %s failed" dst-folder)))))
;; delete src cache if it is partial.
(elmo-cache-delete-partial message-id src-folder (car messages))
(setq ret-val (nconc ret-val (list (car messages))))
(car x))))
mark-alist)))
+(defun elmo-generic-clear-killed (spec)
+ nil)
+
(defun elmo-generic-list-folder-important (spec overview)
nil)
(defun elmo-commit (folder)
(elmo-call-func folder "commit"))
+(defun elmo-clear-killed (folder)
+ (elmo-call-func folder "clear-killed"))
+
;; returns cons cell of (unsync . number-of-messages-in-folder)
(defun elmo-folder-diff (fld &optional number-alist)
(interactive)