;;; elmo-maildir.el -- Maildir interface for ELMO.
-;; Copyright 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
+;; Copyright (C) 1998,1999,2000 Yuuichi Teranishi <teranisi@gohome.org>
;; Author: Yuuichi Teranishi <teranisi@gohome.org>
;; Keywords: mail, net news
(expand-file-name
(let ((file (file-name-completion (symbol-name location)
(expand-file-name "cur" dir))))
- (if (eq file t) location file))
+ (if (eq file t) (symbol-name location) file))
(expand-file-name "cur" dir)))
(defsubst elmo-maildir-list-location (dir &optional child-dir)
"^[^.].*$" t))))
(defun elmo-maildir-update-current (spec)
- "Move all new msgs to cur in the maildir"
+ "Move all new msgs to cur in the maildir."
(let* ((maildir (elmo-maildir-get-folder-directory spec))
(news (directory-files (expand-file-name "new"
maildir)
;; cleanup tmp directory.
(elmo-maildir-cleanup-temporal maildir)
;; move new msgs to cur directory.
- (mapcar (lambda (x)
- (rename-file
- (expand-file-name x (expand-file-name "new" maildir))
- (expand-file-name (concat x ":2,")
- (expand-file-name "cur" maildir))))
- news)))
+ (while news
+ (rename-file
+ (expand-file-name (car news) (expand-file-name "new" maildir))
+ (expand-file-name (concat (car news) ":2,")
+ (expand-file-name "cur" maildir)))
+ (setq news (cdr news)))))
(defun elmo-maildir-set-mark (filename mark)
- "Mark the file in the maildir. MARK is a character."
- (if (string-match "^\\([^:]+:2,\\)\\(.*\\)$" filename)
+ "Mark the FILENAME file in the maildir. MARK is a character."
+ (if (string-match "^\\([^:]+:[12],\\)\\(.*\\)$" filename)
(let ((flaglist (string-to-char-list (elmo-match-string
2 filename))))
(unless (memq mark flaglist)
(setq flaglist (sort (cons mark flaglist) '<))
(rename-file filename
(concat (elmo-match-string 1 filename)
- (char-list-to-string flaglist)))))))
+ (char-list-to-string flaglist)))))
+ ;; Rescue no info file in maildir.
+ (rename-file filename
+ (concat filename ":2," (char-to-string mark)))))
(defun elmo-maildir-delete-mark (filename mark)
- "Mark the file in the maildir. MARK is a character."
+ "Mark the FILENAME file in the maildir. MARK is a character."
(if (string-match "^\\([^:]+:2,\\)\\(.*\\)$" filename)
(let ((flaglist (string-to-char-list (elmo-match-string
2 filename))))
'elmo-maildir-msgdb-create "Creating msgdb..."
percent))
(setq numlist (cdr numlist)))
- (message "Creating msgdb...done.")
+ (message "Creating msgdb...done")
(elmo-msgdb-sort-by-date
(list overview number-alist mark-alist loc-alist)))))
(unless (file-exists-p (file-name-directory filename))
(make-directory (file-name-directory filename)))
(while (file-exists-p filename)
- ;; (sleep-for 2) ; I don't want to wait.
+;;; I don't want to wait.
+;;; (sleep-for 2)
(setq filename
(expand-file-name
(concat "tmp/" (elmo-maildir-make-unique-string))
(progn (delete-file file)
t))))
-(defun elmo-maildir-read-msg (spec number outbuf &optional msgdb)
+(defun elmo-maildir-read-msg (spec number outbuf &optional msgdb unread)
(save-excursion
(let* ((loc-alist (if msgdb (elmo-msgdb-get-location msgdb)
(elmo-msgdb-location-load (elmo-msgdb-expand-path
(setq numbers (sort flist '<))
(elmo-living-messages numbers killed))))
-(defun elmo-maildir-list-folder (spec)
+(defun elmo-maildir-list-folder (spec &optional nohide)
(elmo-maildir-update-current spec)
(elmo-maildir-list-folder-subr spec))
(defun elmo-maildir-max-of-folder (spec)
+ (elmo-maildir-update-current spec)
(elmo-maildir-list-folder-subr spec t))
(defalias 'elmo-maildir-check-validity 'elmo-localdir-check-validity)