* elmo-pop3.el (elmo-folder-initialize): Rewrite.
* elmo-imap4.el (elmo-folder-initialize): Ditto.
* elmo-nntp.el (elmo-folder-initialize): Ditto.
* elmo-multi.el (elmo-folder-initialize): Ditto.
* elmo-util.el (elmo-parse-token): New function.
(elmo-parse-prefixed-element): Ditto.
+2001-11-05 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-pop3.el (elmo-folder-initialize): Rewrite.
+
+ * elmo-imap4.el (elmo-folder-initialize): Ditto.
+
+ * elmo-nntp.el (elmo-folder-initialize): Ditto.
+
+ * elmo-multi.el (elmo-folder-initialize): Ditto.
+
+ * elmo-util.el (elmo-parse-token): New function.
+ (elmo-parse-prefixed-element): Ditto.
+
2001-11-01 Yuuichi Teranishi <teranisi@gohome.org>
* elmo-imap4.el (elmo-imap4-send-command): If BYE response is detected,
(if elmo-imap4-stream-type-alist
(append elmo-imap4-stream-type-alist
elmo-network-stream-type-alist)
- elmo-network-stream-type-alist)))
+ elmo-network-stream-type-alist))
+ parse)
(when (string-match "\\(.*\\)@\\(.*\\)" default-server)
;; case: imap4-default-server is specified like
;; "hoge%imap.server@gateway".
(setq default-user (elmo-match-string 1 default-server))
(setq default-server (elmo-match-string 2 default-server)))
(setq name (luna-call-next-method))
- (when (string-match
- "^\\([^:@!]*\\)\\(:[^/!]+\\)?\\(/[^/:@!]+\\)?"
- name)
- (progn
- (if (match-beginning 1)
- (progn
- (elmo-imap4-folder-set-mailbox-internal
- folder
- (elmo-imap4-encode-folder-string
- (elmo-match-string 1 name)))
- (if (eq (length (elmo-imap4-folder-mailbox-internal folder))
- 0)
- ;; No information is specified other than folder type.
- (elmo-imap4-folder-set-mailbox-internal
- folder
- (elmo-imap4-encode-folder-string
- elmo-imap4-default-mailbox))))
- (elmo-imap4-folder-set-mailbox-internal
- folder
- (elmo-imap4-encode-folder-string
- elmo-imap4-default-mailbox)))
- ;; Setup slots for elmo-net-folder.
- (elmo-net-folder-set-user-internal
- folder
- (if (match-beginning 2)
- (elmo-match-substring 2 name 1)
- default-user))
- (elmo-net-folder-set-auth-internal
- folder
- (if (match-beginning 3)
- (intern (elmo-match-substring 3 name 1))
- (or elmo-imap4-default-authenticate-type 'clear)))
- (unless (elmo-net-folder-server-internal folder)
- (elmo-net-folder-set-server-internal folder default-server))
- (unless (elmo-net-folder-port-internal folder)
- (elmo-net-folder-set-port-internal folder default-port))
- (unless (elmo-net-folder-stream-type-internal folder)
- (elmo-net-folder-set-stream-type-internal
- folder
- (elmo-get-network-stream-type
- elmo-imap4-default-stream-type)))
- folder))))
-
+ ;; mailbox
+ (setq parse (elmo-parse-token name ":"))
+ (elmo-imap4-folder-set-mailbox-internal folder
+ (elmo-imap4-encode-folder-string
+ (if (eq (length (car parse)) 0)
+ elmo-imap4-default-mailbox
+ (car parse))))
+ ;; user
+ (setq parse (elmo-parse-prefixed-element ?: (cdr parse) "/"))
+ (elmo-net-folder-set-user-internal folder
+ (if (eq (length (car parse)) 0)
+ default-user
+ (car parse)))
+ ;; auth
+ (setq parse (elmo-parse-prefixed-element ?/ (cdr parse)))
+ (elmo-net-folder-set-auth-internal
+ folder
+ (if (eq (length (car parse)) 0)
+ (or elmo-imap4-default-authenticate-type 'clear)
+ (intern (car parse))))
+ (unless (elmo-net-folder-server-internal folder)
+ (elmo-net-folder-set-server-internal folder default-server))
+ (unless (elmo-net-folder-port-internal folder)
+ (elmo-net-folder-set-port-internal folder default-port))
+ (unless (elmo-net-folder-stream-type-internal folder)
+ (elmo-net-folder-set-stream-type-internal
+ folder
+ (elmo-get-network-stream-type elmo-imap4-default-stream-type)))
+ folder))
+
;;; ELMO IMAP4 folder
(luna-define-method elmo-folder-expand-msgdb-path ((folder
elmo-imap4-folder))
(luna-define-method elmo-folder-initialize ((folder
elmo-multi-folder)
name)
- (elmo-multi-folder-set-children-internal
- folder
- (mapcar 'elmo-make-folder (split-string name ",")))
+ (while (> (length (car (setq name (elmo-parse-token name ",")))) 0)
+ (elmo-multi-folder-set-children-internal
+ folder
+ (nconc (elmo-multi-folder-children-internal
+ folder)
+ (list (elmo-make-folder (car name)))))
+ (setq name (cdr name))
+ (when (and (> (length name) 0)
+ (eq (aref name 0) ?,))
+ (setq name (substring name 1))))
(elmo-multi-folder-set-divide-number-internal
folder
elmo-multi-divide-number)
(setq elmo-network-stream-type-alist
(append elmo-nntp-stream-type-alist
elmo-network-stream-type-alist))
- elmo-network-stream-type-alist)))
+ elmo-network-stream-type-alist))
+ parse)
(setq name (luna-call-next-method))
- (when (string-match
- "^\\([^:@!]*\\)\\(:[^/!]+\\)?\\(/[^/:@!]+\\)?"
- name)
- (elmo-nntp-folder-set-group-internal
+ (setq parse (elmo-parse-token name ":"))
+ (elmo-nntp-folder-set-group-internal folder
+ (elmo-nntp-encode-group-string
+ (car parse)))
+ (setq parse (elmo-parse-prefixed-element ?: (cdr parse)))
+ (elmo-net-folder-set-user-internal folder
+ (if (eq (length (car parse)) 0)
+ elmo-nntp-default-user
+ (car parse)))
+ (unless (elmo-net-folder-server-internal folder)
+ (elmo-net-folder-set-server-internal folder
+ elmo-nntp-default-server))
+ (unless (elmo-net-folder-port-internal folder)
+ (elmo-net-folder-set-port-internal folder
+ elmo-nntp-default-port))
+ (unless (elmo-net-folder-stream-type-internal folder)
+ (elmo-net-folder-set-stream-type-internal
folder
- (if (match-beginning 1)
- (elmo-nntp-encode-group-string
- (elmo-match-string 1 name))))
- ;; Setup slots for elmo-net-folder
- (elmo-net-folder-set-user-internal folder
- (if (match-beginning 2)
- (elmo-match-substring 2 name 1)
- elmo-nntp-default-user))
- (unless (elmo-net-folder-server-internal folder)
- (elmo-net-folder-set-server-internal folder
- elmo-nntp-default-server))
- (unless (elmo-net-folder-port-internal folder)
- (elmo-net-folder-set-port-internal folder
- elmo-nntp-default-port))
- (unless (elmo-net-folder-stream-type-internal folder)
- (elmo-net-folder-set-stream-type-internal
- folder
- (elmo-get-network-stream-type
- elmo-nntp-default-stream-type)))
- folder)))
+ (elmo-get-network-stream-type
+ elmo-nntp-default-stream-type)))
+ folder))
(luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-nntp-folder))
(convert-standard-filename
(if elmo-pop3-stream-type-alist
(append elmo-pop3-stream-type-alist
elmo-network-stream-type-alist)
- elmo-network-stream-type-alist)))
+ elmo-network-stream-type-alist))
+ parse)
(setq name (luna-call-next-method))
- ;; Setup slots for elmo-net-folder
- (when (string-match "^\\([^:/!]*\\)\\(/[^/:@!]+\\)?\\(:[^/:@!]+\\)?" name)
- (elmo-net-folder-set-user-internal folder
- (if (match-beginning 1)
- (elmo-match-string 1 name)))
- (if (eq (length (elmo-net-folder-user-internal folder)) 0)
- (elmo-net-folder-set-user-internal folder
- elmo-pop3-default-user))
- (elmo-net-folder-set-auth-internal
- folder
- (if (match-beginning 2)
- (intern (elmo-match-substring 2 name 1))
- elmo-pop3-default-authenticate-type))
- (elmo-pop3-folder-set-use-uidl-internal
- folder
- (if (match-beginning 3)
- (string= (elmo-match-substring 3 name 1) "uidl")
- elmo-pop3-default-use-uidl)))
+ ;; user
+ (setq parse (elmo-parse-token name "/:"))
+ (elmo-net-folder-set-user-internal folder
+ (if (eq (length (car parse)) 0)
+ elmo-pop3-default-user
+ (car parse)))
+ ;; auth
+ (setq parse (elmo-parse-prefixed-element ?/ (cdr parse) ":"))
+ (elmo-net-folder-set-auth-internal folder
+ (if (eq (length (car parse)) 0)
+ elmo-pop3-default-authenticate-type
+ (intern (downcase (car parse)))))
+ ;; uidl
+ (setq parse (elmo-parse-prefixed-element ?: (cdr parse)))
+ (elmo-pop3-folder-set-use-uidl-internal folder
+ (if (eq (length (car parse)) 0)
+ elmo-pop3-default-use-uidl
+ (string= (car parse) "uidl")))
(unless (elmo-net-folder-server-internal folder)
(elmo-net-folder-set-server-internal folder
elmo-pop3-default-server))
(setq alist (cdr alist)))
matches))
+;;; Folder parser utils.
+(defun elmo-parse-token (string &optional seps)
+ "Parse atom from STRING using SEPS as a string of separator char list."
+ (let ((len (length string))
+ (seps (and seps (string-to-char-list seps)))
+ (i 0)
+ (sep nil)
+ content c in)
+ (if (eq len 0)
+ (cons "" "")
+ (while (and (< i len) (or in (null sep)))
+ (setq c (aref string i))
+ (cond
+ ((and in (eq c ?\\))
+ (setq i (1+ i)
+ i (1+ i)
+ content (cons (aref string i) content)))
+ ((eq c ?\")
+ (setq in (not in)
+ i (1+ i)))
+ (in (setq content (cons c content)
+ i (1+ i)))
+ ((memq c seps)
+ (setq sep c))
+ (t (setq content (cons c content)
+ i (1+ i)))))
+ (if in (error "Parse error in quoted"))
+ (cons (if (null content) "" (char-list-to-string (nreverse content)))
+ (substring string i)))))
+
+(defun elmo-parse-prefixed-element (prefix string &optional seps)
+ (if (and (not (eq (length string) 0))
+ (eq (aref string 0) prefix))
+ (elmo-parse-token (substring string 1) seps)
+ (cons "" string)))
+
;;; Number set defined by OKAZAKI Tetsurou <okazaki@be.to>
;;
;; number ::= [0-9]+
+2001-11-05 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-summary.el (wl-summary-insert-summary): Renamed dummy argument.
+
2001-11-01 Yuuichi Teranishi <teranisi@gohome.org>
* wl-summary.el (wl-summary-sync-update): Enclose network
(error (ding)
(message "Error in wl-summary-line-inserted-hook"))))
-(defun wl-summary-insert-summary (entity database mark-alist dummy &optional dummy)
+(defun wl-summary-insert-summary (entity database mark-alist dummy &optional dumm)
(let ((overview-entity entity)
summary-line msg)
(setq msg (elmo-msgdb-overview-entity-get-number entity))