wl-folder-get-elmo-folder.
(wl-biff-check-folder): Set `biff' argument of
`wl-folder-check-one-entity'.
(wl-biff-check-folder-async): Setup `biff' slot of folder.
* wl-folder.el (wl-folder-get-elmo-folder): Added `no-cache' argument.
(wl-folder-check-one-entity): Added `biff' argument;
Setup `biff' slot of folder.
* elmo.el (luna-define-class): Added `biff' slot.
* elmo-pop3.el (elmo-pop3-debug): Split biff log.
(elmo-pop3-debug-inhibit-logging): Abolished.
(elmo-network-close-session): Eliminated needless let.
(elmo-pop3-get-session): Set prefix 'BIFF' if biff folder.
(elmo-pop3-send-command): Added `no-log' argument.
(elmo-pop3-process-filter): Use `with-current-buffer'.
(elmo-pop3-auth-user): Set `no-log' argument; Delete process
if login failure.
(elmo-pop3-auth-apop): Likewise.
(elmo-network-authenticate-session): Likewise.
* elmo-nntp.el (elmo-nntp-get-session): Set prefix 'BIFF'
if biff folder.
* elmo-net.el (elmo-network-session-password-key): Use class symbol
string to determine protocol.
(elmo-network-session-name-prefix): Abolished.
(elmo-network-session-cache-key): Follow the change above.
(elmo-network-open-session): Ditto.
* elmo-imap4.el (elmo-imap4-send-command): Modified error message.
(elmo-imap4-get-session): Set prefix 'BIFF' if biff folder.
2001-12-19 Yuuichi Teranishi <teranisi@gohome.org>
+ * elmo.el (luna-define-class): Added `biff' slot.
+
+ * elmo-pop3.el (elmo-pop3-debug): Split biff log.
+ (elmo-pop3-debug-inhibit-logging): Abolished.
+ (elmo-network-close-session): Eliminated needless let.
+ (elmo-pop3-get-session): Set prefix 'BIFF' if biff folder.
+ (elmo-pop3-send-command): Added `no-log' argument.
+ (elmo-pop3-process-filter): Use `with-current-buffer'.
+ (elmo-pop3-auth-user): Set `no-log' argument; Delete process
+ if login failure.
+ (elmo-pop3-auth-apop): Likewise.
+ (elmo-network-authenticate-session): Likewise.
+
+ * elmo-nntp.el (elmo-nntp-get-session): Set prefix 'BIFF'
+ if biff folder.
+
+ * elmo-net.el (elmo-network-session-password-key): Use class symbol
+ string to determine protocol.
+ (elmo-network-session-name-prefix): Abolished.
+ (elmo-network-session-cache-key): Follow the change above.
+ (elmo-network-open-session): Ditto.
+
+ * elmo-imap4.el (elmo-imap4-send-command): Modified error message.
+ (elmo-imap4-get-session): Set prefix 'BIFF' if biff folder.
+
* elmo-version.el (elmo-version): Up to 2.9.1.
* elmo-util.el (elmo-file-field-primitive-condition-match): Fixed
(insert "NO LOGGING\n")
(insert (apply 'format message args) "\n")))))
-
(defsubst elmo-imap4-decode-folder-string (string)
(if elmo-imap4-use-modified-utf7
(utf7-decode-string string 'imap)
(elmo-imap4-process-bye session))
(setq elmo-imap4-current-response nil)
(if elmo-imap4-parsing
- (error "IMAP process is running. Please wait (or plug again.)"))
+ (error "IMAP process is running. Please wait (or plug again)"))
(setq elmo-imap4-parsing t)
(elmo-imap4-debug "<-(%s)- %s" tag command)
(while (setq token (car command-args))
(elmo-imap4-folder-mailbox-internal folder)))))
(defun elmo-imap4-get-session (folder &optional if-exists)
- (elmo-network-get-session 'elmo-imap4-session "IMAP" folder if-exists))
+ (elmo-network-get-session 'elmo-imap4-session
+ (concat
+ (if (elmo-folder-biff-internal folder)
+ "BIFF-")
+ "IMAP")
+ folder if-exists))
(defun elmo-imap4-session-select-mailbox (session mailbox
&optional force no-error)
(defsubst elmo-network-session-password-key (session)
(format "%s:%s/%s@%s:%d"
- (elmo-network-session-name-internal session)
+ (upcase
+ (nth 1 (split-string (symbol-name
+ (luna-class-name session)) "[4-]")))
(elmo-network-session-user-internal session)
(elmo-network-session-auth-internal session)
(elmo-network-session-server-internal session)
(elmo-network-session-port-internal session)))
(defvar elmo-network-session-cache nil)
-(defvar elmo-network-session-name-prefix nil)
(defsubst elmo-network-session-cache-key (name folder)
"Returns session cache key for NAME and FOLDER."
(format "%s:%s/%s@%s:%d%s"
- (concat elmo-network-session-name-prefix name)
+ name
(elmo-net-folder-user-internal folder)
(elmo-net-folder-auth-internal folder)
(elmo-net-folder-server-internal folder)
:process nil
:greeting nil))
(buffer (format " *%s session for %s@%s:%d%s"
- (concat elmo-network-session-name-prefix name)
+ name
user
server
port
(defun elmo-nntp-get-session (folder &optional if-exists)
(elmo-network-get-session
'elmo-nntp-session
- "NNTP"
+ (concat
+ (if (elmo-folder-biff-internal folder)
+ "BIFF-")
+ "NNTP")
folder
if-exists))
"Non-nil forces POP3 folder as debug mode.
Debug information is inserted in the buffer \"*POP3 DEBUG*\"")
-(defvar elmo-pop3-debug-inhibit-logging nil)
-
;;; Debug
(defsubst elmo-pop3-debug (message &rest args)
(if elmo-pop3-debug
- (with-current-buffer (get-buffer-create "*POP3 DEBUG*")
- (goto-char (point-max))
- (if elmo-pop3-debug-inhibit-logging
- (insert "NO LOGGING\n")
+ (let ((biff (string-match "BIFF-" (buffer-name)))
+ pos)
+ (with-current-buffer (get-buffer-create (concat "*POP3 DEBUG*"
+ (if biff "BIFF")))
+ (goto-char (point-max))
+ (setq pos (point))
(insert (apply 'format message args) "\n")))))
;;; ELMO POP3 folder
(when (memq (process-status
(elmo-network-session-process-internal session))
'(open run))
- (let ((buffer (process-buffer
- (elmo-network-session-process-internal session))))
- (elmo-pop3-send-command (elmo-network-session-process-internal session)
- "quit")
- ;; process is dead.
- (or (elmo-pop3-read-response
- (elmo-network-session-process-internal session)
- t)
- (error "POP error: QUIT failed"))))
+ (elmo-pop3-send-command (elmo-network-session-process-internal session)
+ "quit")
+ ;; process is dead.
+ (or (elmo-pop3-read-response
+ (elmo-network-session-process-internal session)
+ t)
+ (error "POP error: QUIT failed")))
(kill-buffer (process-buffer
(elmo-network-session-process-internal session)))
(delete-process (elmo-network-session-process-internal session))))
nil
(elmo-pop3-folder-use-uidl-internal
folder))))
- (elmo-network-get-session 'elmo-pop3-session "POP3" folder if-exists)))
-
-(defun elmo-pop3-send-command (process command &optional no-erase)
+ (elmo-network-get-session 'elmo-pop3-session
+ (concat
+ (if (elmo-folder-biff-internal folder)
+ "BIFF-")
+ "POP3")
+ folder if-exists)))
+
+(defun elmo-pop3-send-command (process command &optional no-erase no-log)
(with-current-buffer (process-buffer process)
(unless no-erase
(erase-buffer))
(goto-char (point-min))
(setq elmo-pop3-read-point (point))
- (elmo-pop3-debug "SEND: %s\n" command)
+ (elmo-pop3-debug "SEND: %s\n" (if no-log "<NO LOGGING>" command))
(process-send-string process command)
(process-send-string process "\r\n")))
return-value)))
(defun elmo-pop3-process-filter (process output)
- (save-excursion
- (set-buffer (process-buffer process))
+ (with-current-buffer (process-buffer process)
(goto-char (point-max))
(insert output)
(elmo-pop3-debug "RECEIVED: %s\n" output)
;; try USER/PASS
(elmo-pop3-send-command
process
- (format "user %s" (elmo-network-session-user-internal session)))
+ (format "user %s" (elmo-network-session-user-internal session))
+ nil 'no-log)
(or (elmo-pop3-read-response process t)
- (signal 'elmo-authenticate-error
- '(elmo-pop-auth-user)))
+ (progn
+ (delete-process process)
+ (signal 'elmo-authenticate-error
+ '(elmo-pop-auth-user))))
(elmo-pop3-send-command process
(format
"pass %s"
(elmo-get-passwd
- (elmo-network-session-password-key session))))
+ (elmo-network-session-password-key session)))
+ nil 'no-log)
(or (elmo-pop3-read-response process t)
- (signal 'elmo-authenticate-error
- '(elmo-pop-auth-user)))))
+ (progn
+ (delete-process process)
+ (signal 'elmo-authenticate-error
+ '(elmo-pop-auth-user))))))
(defun elmo-pop3-auth-apop (session)
(if (string-match "^\+OK .*\\(<[^\>]+>\\)"
1
(elmo-network-session-greeting-internal session))
(elmo-get-passwd
- (elmo-network-session-password-key session))))))
+ (elmo-network-session-password-key session)))))
+ nil 'no-log)
(or (elmo-pop3-read-response
(elmo-network-session-process-internal session)
t)
- (signal 'elmo-authenticate-error
- '(elmo-pop3-auth-apop))))
+ (progn
+ (delete-process (elmo-network-session-process-internal session))
+ (signal 'elmo-authenticate-error
+ '(elmo-pop3-auth-apop)))))
(signal 'elmo-open-error '(elmo-pop3-auth-apop))))
(luna-define-method elmo-network-initialize-session-buffer :after
(with-current-buffer (process-buffer
(elmo-network-session-process-internal session))
(let* ((process (elmo-network-session-process-internal session))
- (elmo-pop3-debug-inhibit-logging t)
(auth (elmo-network-session-auth-internal session))
(auth (mapcar '(lambda (mechanism) (upcase (symbol-name mechanism)))
(if (listp auth) auth (list auth))))
(concat
" "
(elmo-base64-encode-string
- (sasl-step-data step) 'no-line-break))))) ;)
+ (sasl-step-data step) 'no-line-break))))
+ nil 'no-log)
(catch 'done
(while t
(unless (setq response (elmo-pop3-read-response process t))
(if (sasl-step-data step)
(elmo-base64-encode-string (sasl-step-data step)
'no-line-break)
- "")))))))))
+ "") nil 'no-log))))))))
(luna-define-method elmo-network-setup-session ((session
elmo-pop3-session))
message-modified ; message is modified.
mark-modified ; mark is modified.
process-duplicates ; read or hide
+ biff ; folder for biff
))
(luna-define-internal-accessors 'elmo-folder))
2001-12-19 Yuuichi Teranishi <teranisi@gohome.org>
+ * wl-util.el (wl-biff-check-folders): Set `no-cache' argument of
+ wl-folder-get-elmo-folder.
+ (wl-biff-check-folder): Set `biff' argument of
+ `wl-folder-check-one-entity'.
+ (wl-biff-check-folder-async): Setup `biff' slot of folder.
+
+ * wl-folder.el (wl-folder-get-elmo-folder): Added `no-cache' argument.
+ (wl-folder-check-one-entity): Added `biff' argument;
+ Setup `biff' slot of folder.
+
* Version number is increased to 2.9.1.
2001-12-18 Yuuichi Teranishi <teranisi@gohome.org>
(setq li (cdr li))))))))
;;; ELMO folder structure with cache.
-(defmacro wl-folder-get-elmo-folder (entity)
+(defmacro wl-folder-get-elmo-folder (entity &optional no-cache)
"Get elmo folder structure from entity."
- (` (or (wl-folder-elmo-folder-cache-get (, entity))
- (let* ((name (elmo-string (, entity)))
- (folder (elmo-make-folder name)))
- (wl-folder-elmo-folder-cache-put name folder)
- folder))))
+ (` (if (, no-cache)
+ (elmo-make-folder (elmo-string (, entity)))
+ (or (wl-folder-elmo-folder-cache-get (, entity))
+ (let* ((name (elmo-string (, entity)))
+ (folder (elmo-make-folder name)))
+ (wl-folder-elmo-folder-cache-put name folder)
+ folder)))))
(defmacro wl-folder-elmo-folder-cache-get (name &optional hashtb)
"Returns a elmo folder structure associated with NAME from HASHTB.
(run-hooks 'wl-folder-check-entity-hook)
ret-val))
-(defun wl-folder-check-one-entity (entity)
- (let* ((folder (wl-folder-get-elmo-folder entity))
+(defun wl-folder-check-one-entity (entity &optional biff)
+ (let* ((folder (wl-folder-get-elmo-folder entity biff))
(nums (condition-case err
- (if (wl-string-match-member entity wl-strict-diff-folders)
- (elmo-strict-folder-diff folder)
- (elmo-folder-diff folder))
+ (progn
+ (if biff (elmo-folder-set-biff-internal folder t))
+ (if (wl-string-match-member entity wl-strict-diff-folders)
+ (elmo-strict-folder-diff folder)
+ (elmo-folder-diff folder)))
(error
;; maybe not exist folder.
(if (and (not (memq 'elmo-open-error
folder)
(if (eq (length flist) 1)
(wl-biff-check-folder-async (wl-folder-get-elmo-folder
- (car flist)) (interactive-p))
+ (car flist) 'biff) (interactive-p))
(unwind-protect
(while flist
(setq folder (wl-folder-get-elmo-folder (car flist))
(defun wl-biff-check-folder (folder)
(if (eq (elmo-folder-type-internal folder) 'pop3)
(unless (elmo-pop3-get-session folder 'if-exists)
- ;; Currently no main pop3 process.
- (let ((elmo-network-session-name-prefix "BIFF-"))
- (wl-folder-check-one-entity
- (elmo-folder-name-internal folder))))
- (let ((elmo-network-session-name-prefix "BIFF-"))
- (wl-folder-check-one-entity (elmo-folder-name-internal folder)))))
+ (wl-folder-check-one-entity (elmo-folder-name-internal folder)
+ 'biff))))
(defun wl-biff-check-folder-async-callback (diff data)
(if (nth 1 data)
(defun wl-biff-check-folder-async (folder notify-minibuf)
(when (elmo-folder-plugged-p folder)
+ (elmo-folder-set-biff-internal folder t)
(if (and (eq (elmo-folder-type-internal folder) 'imap4)
(elmo-folder-use-flag-p folder))
;; Check asynchronously only when IMAP4 and use server diff.