+2001-02-21 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo.el (elmo-init): New function.
+ (elmo-quit): Call `elmo-crosspost-message-alist-save'.
+
+ * elmo-vars.el (elmo-msgdb-file-header-chop-length): New variable
+ (Renamed from `elmo-localdir-header-chop-length').
+
+ * elmo-pop3.el (elmo-pop3-use-cache,
+ elmo-pop3-send-command-synchronously): Moved from `elmo-vars.el'.
+
+ * elmo-nntp.el (elmo-message-fetch): Define.
+ (elmo-message-fetch-unplugged): Ditto.
+ (elmo-nntp-overview-fetch-chop-length): Moved from `elmo-vars.el'.
+ (elmo-nntp-use-cache): Ditto.
+ (elmo-nntp-max-number-precedes-list-active): Ditto.
+
+ * elmo-multi.el (elmo-multi-divide-number): Moved from `elmo-vars.el'.
+
+ * elmo-msgdb.el (elmo-localdir-insert-header): Renamed to
+ `elmo-msgdb-insert-file-header'.
+ Use `elmo-msgdb-file-header-chop-length'.
+
+ * elmo-localdir.el (elmo-localdir-lockfile-list): Moved from
+ `elmo-vars.el'.
+
+ * elmo-cache.el (elmo-cache-insert-header): Eliminated.
+ (elmo-cache-msgdb-create-overview-entity-from-file): Use
+ `elmo-msgdb-insert-file-header'.
+
+ * elmo-imap4.el, elmo-nntp.el, elmo-pop3.el:
+ Use new variable;
+ Define obsolete variables with `elmo-define-obsolete-variable',
+
+ * elmo-util.el (elmo-warning-buffer-name): New constant.
+ (elmo-warning): New function.
+ (elmo-obsolete-variable-alist): New variable.
+ (elmo-obsolete-variable-show-warnings): New variable.
+ (elmo-define-obsolete-variable): New function.
+ (elmo-resque-obsolete-variable): Ditto.
+ (elmo-resque-obsolete-variables): Ditto.
+
+2001-02-20 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * elmo-vars.el (elmo-use-buffer-cache, elmo-buffer-cache-size):
+ Eliminated.
+
+ * elmo-pop3.el, elmo-nntp.el: Use custom.
+
2000-02-20 Kenichi OKADA <okada@opaopa.org>
* elmo-imap4.el (elmo-network-authenticate-session): Fix.
`nohide'.
(elmo-folder-synchronize): Changed meaning of argument `ignore-msgdb'.
+2001-02-21 OKAZAKI Tetsurou <okazaki@be.to>
+
+ * elmo-util.el (elmo-display-progress): Prefer
+ `progress-feedback-with-label' to `lprogress-display'.
+
2000-02-20 Kenichi OKADA <okada@opaopa.org>
* elmo-imap4.el (elmo-imap4-list-folder): Added 'uid'
(elmo-msgid-to-cache
(cdr (assq number number-alist)))))
-(if (boundp 'nemacs-version)
- (defsubst elmo-cache-insert-header (file)
- "Insert the header of the article (Does not work on nemacs)."
- (as-binary-input-file
- (insert-file-contents file)))
- (defsubst elmo-cache-insert-header (file)
- "Insert the header of the article."
- (let ((beg 0)
- insert-file-contents-pre-hook ; To avoid autoconv-xmas...
- insert-file-contents-post-hook
- format-alist)
- (when (file-exists-p file)
- ;; Read until header separator is found.
- (while (and (eq elmo-localdir-header-chop-length
- (nth 1
- (as-binary-input-file
- (insert-file-contents
- file nil beg
- (incf beg elmo-localdir-header-chop-length)))))
- (prog1 (not (search-forward "\n\n" nil t))
- (goto-char (point-max)))))))))
-
(defsubst elmo-cache-msgdb-create-overview-entity-from-file (number file)
(save-excursion
(let ((tmp-buffer (get-buffer-create " *ELMO Cache Temp*"))
;; insert header from file.
(catch 'done
(condition-case nil
- (elmo-cache-insert-header file)
+ (elmo-msgdb-insert-file-header file)
(error (throw 'done nil)))
(goto-char (point-min))
(setq header-end
:type 'symbol
:group 'elmo)
-;;; Obsolete.
-(defvar elmo-default-imap4-mailbox elmo-imap4-default-mailbox)
-(defvar elmo-default-imap4-server elmo-imap4-default-server)
-(defvar elmo-default-imap4-authenticate-type
- elmo-imap4-default-authenticate-type)
-(defvar elmo-default-imap4-user elmo-imap4-default-user)
-(defvar elmo-default-imap4-port elmo-imap4-default-port)
-(defvar elmo-default-imap4-stream-type elmo-imap4-default-stream-type)
+(elmo-define-obsolete-variable 'elmo-default-imap4-mailbox
+ 'elmo-imap4-default-mailbox)
+(elmo-define-obsolete-variable 'elmo-default-imap4-server
+ 'elmo-imap4-default-server)
+(elmo-define-obsolete-variable 'elmo-default-imap4-authenticate-type
+ 'elmo-imap4-default-authenticate-type)
+(elmo-define-obsolete-variable 'elmo-default-imap4-user
+ 'elmo-imap4-default-user)
+(elmo-define-obsolete-variable 'elmo-default-imap4-port
+ 'elmo-imap4-default-port)
(defvar elmo-imap4-stream-type-alist nil
"*Stream bindings for IMAP4.
session
(concat "AUTHENTICATE " name
(and (sasl-step-data step)
- (concat
+ (concat
" "
(elmo-base64-encode-string
(sasl-step-data step)
- 'no-lin-break)))))) ;)
+ 'no-lin-break))))))
(catch 'done
(while t
(setq response
(luna-define-method elmo-folder-initialize :around ((folder
elmo-imap4-folder)
name)
- (let ((default-user elmo-default-imap4-user)
- (default-server elmo-default-imap4-server)
- (default-port elmo-default-imap4-port)
+ (let ((default-user elmo-imap4-default-user)
+ (default-server elmo-imap4-default-server)
+ (default-port elmo-imap4-default-port)
(elmo-network-stream-type-alist
(if elmo-imap4-stream-type-alist
(append elmo-imap4-stream-type-alist
elmo-network-stream-type-alist)
elmo-network-stream-type-alist)))
(when (string-match "\\(.*\\)@\\(.*\\)" default-server)
- ;; case: default-imap4-server is specified like
+ ;; 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)))
;; No information is specified other than folder type.
(elmo-imap4-folder-set-mailbox-internal
folder
- elmo-default-imap4-mailbox)))
+ elmo-imap4-default-mailbox)))
(elmo-imap4-folder-set-mailbox-internal
folder
- elmo-default-imap4-mailbox))
+ elmo-imap4-default-mailbox))
;; Setup slots for elmo-net-folder.
(elmo-net-folder-set-user-internal
folder
folder
(if (match-beginning 3)
(intern (elmo-match-substring 3 name 1))
- elmo-default-imap4-authenticate-type))
+ elmo-imap4-default-authenticate-type))
(unless (elmo-net-folder-server-internal folder)
(elmo-net-folder-set-server-internal folder default-server))
(unless (elmo-net-folder-port-internal folder)
(unless (elmo-net-folder-stream-type-internal folder)
(elmo-net-folder-set-stream-type-internal
folder
- elmo-default-imap4-stream-type))
+ elmo-imap4-default-stream-type))
folder))))
;;; ELMO IMAP4 folder
session
(list "list " (elmo-imap4-mailbox root) " *"))))
(unless (string= (elmo-net-folder-user-internal folder)
- elmo-default-imap4-user)
+ elmo-imap4-default-user)
(setq append-serv (concat ":" (elmo-net-folder-user-internal folder))))
(unless (eq (elmo-net-folder-auth-internal folder)
- elmo-default-imap4-authenticate-type)
+ elmo-imap4-default-authenticate-type)
(setq append-serv
(concat append-serv "/"
(symbol-name (elmo-net-folder-auth-internal folder)))))
(unless (string= (elmo-net-folder-server-internal folder)
- elmo-default-imap4-server)
+ elmo-imap4-default-server)
(setq append-serv (concat append-serv "@"
(elmo-net-folder-server-internal folder))))
- (unless (eq (elmo-net-folder-port-internal folder) elmo-default-imap4-port)
+ (unless (eq (elmo-net-folder-port-internal folder) elmo-imap4-default-port)
(setq append-serv (concat append-serv ":"
(int-to-string
(elmo-net-folder-port-internal folder)))))
(setq type (elmo-net-folder-stream-type-internal folder))
(unless (eq (elmo-network-stream-type-symbol type)
- elmo-default-imap4-stream-type)
+ elmo-imap4-default-stream-type)
(if type
(setq append-serv (concat append-serv
(elmo-network-stream-type-spec-string
:type 'directory
:group 'elmo)
+(defvar elmo-localdir-lockfile-list nil)
+
;;; ELMO Local directory folder
(eval-and-compile
(luna-define-class elmo-localdir-folder (elmo-folder)
(copy-sequence (cdr entity))))
(static-if (boundp 'nemacs-version)
- (defsubst elmo-localdir-insert-header (file)
+ (defsubst elmo-msgdb-insert-file-header (file)
"Insert the header of the article (Does not work on nemacs)."
(as-binary-input-file
(insert-file-contents file)))
- (defsubst elmo-localdir-insert-header (file)
+ (defsubst elmo-msgdb-insert-file-header (file)
"Insert the header of the article."
(let ((beg 0)
insert-file-contents-pre-hook ; To avoid autoconv-xmas...
format-alist)
(when (file-exists-p file)
;; Read until header separator is found.
- (while (and (eq elmo-localdir-header-chop-length
+ (while (and (eq elmo-msgdb-file-header-chop-length
(nth 1
(insert-file-contents-as-binary
file nil beg
- (incf beg elmo-localdir-header-chop-length)))))
+ (incf beg elmo-msgdb-file-header-chop-length)))))
(prog1 (not (search-forward "\n\n" nil t))
(goto-char (point-max))))))))
;; insert header from file.
(catch 'done
(condition-case nil
- (elmo-localdir-insert-header file)
+ (elmo-msgdb-insert-file-header file)
(error (throw 'done nil)))
(goto-char (point-min))
(setq header-end
(require 'elmo)
(require 'luna)
+
+(defvar elmo-multi-divide-number 100000
+ "*Multi divider number.")
+
;;; ELMO Multi folder
(eval-and-compile
(luna-define-class elmo-multi-folder (elmo-folder)
(require 'elmo)
(require 'elmo-net)
+;; User options
+(defcustom elmo-nntp-default-server "localhost"
+ "*Default NNTP server."
+ :type 'string
+ :group 'elmo)
+
+(defcustom elmo-nntp-default-user nil
+ "*Default User of NNTP. nil means no user authentication."
+ :type 'string
+ :group 'elmo)
+
+(defcustom elmo-nntp-default-port 119
+ "*Default Port number of NNTP."
+ :type 'integer
+ :group 'elmo)
+
+(defcustom elmo-nntp-default-stream-type nil
+ "*Default stream type for NNTP.
+Any symbol value of `elmo-network-stream-type-alist' or
+`elmo-nntp-stream-type-alist'."
+ :type 'symbol
+ :group 'elmo)
+
+(elmo-define-obsolete-variable 'elmo-default-nntp-server
+ 'elmo-nntp-default-server)
+(elmo-define-obsolete-variable 'elmo-default-nntp-user
+ 'elmo-nntp-default-user)
+(elmo-define-obsolete-variable 'elmo-default-nntp-port
+ 'elmo-nntp-default-port)
+
+(defvar elmo-nntp-stream-type-alist nil
+ "*Stream bindings for NNTP.
+This is taken precedence over `elmo-network-stream-type-alist'.")
+
+(defvar elmo-nntp-overview-fetch-chop-length 200
+ "*Number of overviews to fetch in one request in nntp.")
+
+(defvar elmo-nntp-use-cache t
+ "Use cache in nntp folder.")
+
+(defvar elmo-nntp-max-number-precedes-list-active nil
+ "Non-nil means max number of msgdb is set as the max number of `list active'.
+(Needed for inn 2.3 or later?).")
+
;;; ELMO NNTP folder
(eval-and-compile
(luna-define-class elmo-nntp-folder (elmo-net-folder)
(elmo-net-folder-set-user-internal folder
(if (match-beginning 2)
(elmo-match-substring 2 folder 1)
- elmo-default-nntp-user))
+ elmo-nntp-default-user))
(unless (elmo-net-folder-server-internal folder)
(elmo-net-folder-set-server-internal folder
- elmo-default-nntp-server))
+ elmo-nntp-default-server))
(unless (elmo-net-folder-port-internal folder)
(elmo-net-folder-set-port-internal folder
- elmo-default-nntp-port))
+ elmo-nntp-default-port))
(unless (elmo-net-folder-stream-type-internal folder)
(elmo-net-folder-set-stream-type-internal
folder
- elmo-default-nntp-stream-type))
+ elmo-nntp-default-stream-type))
folder)))
(luna-define-method elmo-folder-expand-msgdb-path ((folder elmo-nntp-folder))
(concat
(and user (concat ":" user))
(if (and server
- (null (string= server elmo-default-nntp-server)))
+ (null (string= server elmo-nntp-default-server)))
(concat "@" server))
(if (and port
- (null (eq port elmo-default-nntp-port)))
+ (null (eq port elmo-nntp-default-port)))
(concat ":" (if (numberp port)
(int-to-string port) port)))
(unless (eq (elmo-network-stream-type-symbol type)
- elmo-default-nntp-stream-type)
+ elmo-nntp-default-stream-type)
(elmo-network-stream-type-spec-string type))))
(defun elmo-nntp-get-session (folder &optional if-exists)
(elmo-display-progress
'elmo-nntp-list-folders "Parsing active..." 100))))
(unless (string= (elmo-net-folder-server-internal folder)
- elmo-default-nntp-server)
+ elmo-nntp-default-server)
(setq append-serv (concat "@" (elmo-net-folder-server-internal
folder))))
- (unless (eq (elmo-net-folder-port-internal folder) elmo-default-nntp-port)
+ (unless (eq (elmo-net-folder-port-internal folder) elmo-nntp-default-port)
(setq append-serv (concat append-serv
":" (int-to-string
(elmo-net-folder-port-internal folder)))))
(unless (eq (elmo-network-stream-type-symbol
(elmo-net-folder-stream-type-internal folder))
- elmo-default-nntp-stream-type)
+ elmo-nntp-default-stream-type)
(setq append-serv
(concat append-serv
(elmo-network-stream-type-spec-string
(with-current-buffer (elmo-network-session-buffer session)
(std11-field-body "Newsgroups")))))
+(luna-define-method elmo-message-fetch ((folder elmo-nntp-folder)
+ number strategy
+ &optional section
+ outbuf
+ unseen)
+ (if (elmo-folder-plugged-p folder)
+ (let ((cache-file (elmo-file-cache-expand-path
+ (elmo-fetch-strategy-cache-path strategy)
+ section)))
+ (if (and (elmo-fetch-strategy-use-cache strategy)
+ (file-exists-p cache-file))
+ (if outbuf
+ (with-current-buffer outbuf
+ (insert-file-contents-as-binary cache-file)
+ (elmo-nntp-setup-crosspost-buffer folder number)
+ (unless unread
+ (elmo-nntp-folder-update-crosspost-message-alist
+ folder (list number)))
+ t)
+ (with-temp-buffer
+ (insert-file-contents-as-binary cache-file)
+ (elmo-nntp-setup-crosspost-buffer folder number)
+ (unless unread
+ (elmo-nntp-folder-update-crosspost-message-alist
+ folder (list number)))
+ (buffer-string)))
+ (if outbuf
+ (with-current-buffer outbuf
+ (elmo-folder-send folder 'elmo-message-fetch-plugged
+ number strategy section
+ (current-buffer) unseen)
+ (elmo-delete-cr-buffer)
+ (when (and (> (buffer-size) 0)
+ (elmo-fetch-strategy-save-cache strategy))
+ (elmo-file-cache-save
+ (elmo-fetch-strategy-cache-path strategy)
+ section))
+ t)
+ (with-temp-buffer
+ (elmo-folder-send folder 'elmo-message-fetch-plugged
+ number strategy section
+ (current-buffer) unseen)
+ (elmo-delete-cr-buffer)
+ (when (and (> (buffer-size) 0)
+ (elmo-fetch-strategy-save-cache strategy))
+ (elmo-file-cache-save
+ (elmo-fetch-strategy-cache-path strategy)
+ section))
+ (buffer-string)))))
+ (elmo-folder-send folder 'elmo-message-fetch-unplugged
+ number strategy section outbuf unseen)))
+
(luna-define-method elmo-message-fetch-plugged ((folder elmo-nntp-folder)
number strategy
&optional section outbuf
unread)
(elmo-nntp-message-fetch folder number strategy section outbuf unread))
+(luna-define-method elmo-message-fetch-unplugged ((folder elmo-nntp-folder)
+ number strategy
+ &optional section outbuf
+ unread)
+ (if (elmo-fetch-strategy-use-cache strategy)
+ (if outbuf
+ (with-current-buffer outbuf
+ (insert-file-contents-as-binary
+ (elmo-file-cache-expand-path
+ (elmo-fetch-strategy-cache-path strategy)
+ section))
+ (elmo-nntp-setup-crosspost-buffer folder number)
+ (unless unread
+ (elmo-nntp-folder-update-crosspost-message-alist
+ folder (list number)))
+ t)
+ (with-temp-buffer
+ (insert-file-contents-as-binary
+ (elmo-file-cache-expand-path
+ (elmo-fetch-strategy-cache-path strategy)
+ section))
+ (elmo-nntp-setup-crosspost-buffer folder number)
+ (unless unread
+ (elmo-nntp-folder-update-crosspost-message-alist
+ folder (list number)))
+ (buffer-string)))
+ (error "Unplugged")))
+
(defun elmo-nntp-message-fetch (folder number strategy section outbuf unread)
(let ((session (elmo-nntp-get-session folder))
newsgroups)
(let ((session (elmo-nntp-get-session
(luna-make-entity
'elmo-nntp-folder
- :user elmo-default-nntp-user
+ :user elmo-nntp-default-user
:server hostname
- :port elmo-default-nntp-port
- :stream-type elmo-default-nntp-stream-type)))
+ :port elmo-nntp-default-port
+ :stream-type elmo-nntp-default-stream-type)))
response has-message-id)
(save-excursion
(set-buffer content-buf)
(autoload 'md5 "md5"))
;; POP3
-(defvar elmo-default-pop3-user (or (getenv "USER")
- (getenv "LOGNAME")
- (user-login-name))
- "*Default username for POP3.")
-(defvar elmo-default-pop3-server "localhost"
- "*Default POP3 server.")
-(defvar elmo-default-pop3-authenticate-type 'user
- "*Default Authentication type for POP3.")
-(defvar elmo-default-pop3-port 110
- "*Default POP3 port.")
-(defvar elmo-default-pop3-stream-type nil
+(defcustom elmo-pop3-default-user (or (getenv "USER")
+ (getenv "LOGNAME")
+ (user-login-name))
+ "*Default username for POP3."
+ :type 'string
+ :group 'elmo)
+
+(defcustom elmo-pop3-default-server "localhost"
+ "*Default POP3 server."
+ :type 'string
+ :group 'elmo)
+
+(defcustom elmo-pop3-default-authenticate-type 'user
+ "*Default Authentication type for POP3."
+ :type 'symbol
+ :group 'elmo)
+
+(defcustom elmo-pop3-default-port 110
+ "*Default POP3 port."
+ :type 'integer
+ :group 'elmo)
+
+(defcustom elmo-pop3-default-stream-type nil
"*Default stream type for POP3.
-Any symbol value of `elmo-network-stream-type-alist'.")
-
+Any symbol value of `elmo-network-stream-type-alist' or
+`elmo-pop3-stream-type-alist'."
+ :type 'symbol
+ :group 'elmo)
+
+(defcustom elmo-pop3-default-use-uidl t
+ "If non-nil, use UIDL on POP3."
+ :type 'boolean
+ :group 'elmo)
+
+(elmo-put-obsolete-variable 'elmo-default-pop3-server
+ 'elmo-pop3-default-server)
+(elmo-put-obsolete-variable 'elmo-default-pop3-user
+ 'elmo-pop3-default-user)
+(elmo-put-obsolete-variable 'elmo-default-pop3-authenticate-type
+ 'elmo-pop3-default-authenticate-type)
+(elmo-put-obsolete-variable 'elmo-default-pop3-port
+ 'elmo-pop3-default-port)
(defvar elmo-pop3-stream-type-alist nil
"*Stream bindings for POP3.
This is taken precedence over `elmo-network-stream-type-alist'.")
-
-(defvar elmo-pop3-default-use-uidl t
- "If non-nil, use UIDL on POP3.")
-
(defvar elmo-pop3-use-uidl-internal t
"(Internal switch for using UIDL on POP3).")
(defvar elmo-pop3-inhibit-uidl nil
"(Internal switch for using UIDL on POP3).")
+(defvar elmo-pop3-use-cache t
+ "Use cache in pop3 folder.")
+
+(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
+set as non-nil.")
+
(defvar elmo-pop3-exists-exactly t)
(defvar sasl-mechanism-alist)
(elmo-match-string 1 name)))
(if (eq (length (elmo-net-folder-user-internal folder)) 0)
(elmo-net-folder-set-user-internal folder
- elmo-default-pop3-user))
+ elmo-pop3-default-user))
(elmo-net-folder-set-auth-internal
folder
(if (match-beginning 2)
(intern (elmo-match-substring 2 name 1))
- elmo-default-pop3-authenticate-type))
+ elmo-pop3-default-authenticate-type))
(elmo-pop3-folder-set-use-uidl-internal
folder
(if (match-beginning 3)
elmo-pop3-default-use-uidl)))
(unless (elmo-net-folder-server-internal folder)
(elmo-net-folder-set-server-internal folder
- elmo-default-pop3-server))
+ elmo-pop3-default-server))
(unless (elmo-net-folder-port-internal folder)
(elmo-net-folder-set-port-internal folder
- elmo-default-pop3-port))
+ elmo-pop3-default-port))
(unless (elmo-net-folder-stream-type-internal folder)
(elmo-net-folder-set-stream-type-internal
folder
- elmo-default-pop3-stream-type))
+ elmo-pop3-default-stream-type))
folder))
;;; POP3 session
(list 'error-message doc
'error-conditions (cons error conds))))))
-(cond ((fboundp 'lprogress-display)
- (defalias 'elmo-display-progress 'lprogress-display))
- ((fboundp 'progress-feedback-with-label)
+(cond ((fboundp 'progress-feedback-with-label)
(defalias 'elmo-display-progress 'progress-feedback-with-label))
+ ((fboundp 'lprogress-display)
+ (defalias 'elmo-display-progress 'lprogress-display))
(t
(defun elmo-display-progress (label format &optional value &rest args)
"Print a progress message."
(match-end matchn)) list)))
(nreverse list)))
+(defconst elmo-warning-buffer-name "*elmo warning*")
+
+(defun elmo-warning (&rest args)
+ "Display a warning, making warning message by passing all args to `insert'."
+ (with-current-buffer (get-buffer-create elmo-warning-buffer-name)
+ (goto-char (point-max))
+ (apply 'insert (append args '("\n")))
+ (recenter 1))
+ (display-buffer elmo-warning-buffer-name))
+
+(defvar elmo-obsolete-variable-alist nil)
+(defvar elmo-obsolete-variable-show-warnings nil)
+
+(defun elmo-define-obsolete-variable (obsolete var)
+ "Define obsolete variable.
+OBSOLETE is a symbol for obsolete variable.
+VAR is a symbol for new variable.
+Definition is stored in `elmo-obsolete-variable-alist'."
+ (let ((pair (assq var elmo-obsolete-variable-alist)))
+ (if pair
+ (setcdr pair obsolete)
+ (setq elmo-obsolete-variable-alist
+ (cons (cons var obsolete)
+ elmo-obsolete-variable-alist)))))
+
+(defun elmo-resque-obsolete-variable (obsolete var)
+ "Resque obsolete variable OBSOLETE as VAR.
+If `elmo-obsolete-variable-show-warnings' is non-nil, show warning message."
+ (when (boundp obsolete)
+ (set var (symbol-value obsolete))
+ (if elmo-obsolete-variable-show-warnings
+ (elmo-warning (format "%s is obsolete. Use %s instead."
+ (symbol-name obsolete)
+ (symbol-name var))))))
+
+(defun elmo-resque-obsolete-variables (&optional alist)
+ "Resque obsolete variables in ALIST.
+ALIST is a list of cons cell of
+\(OBSOLETE-VARIABLE-SYMBOL . NEW-VARIABLE-SYMBOL\).
+If ALIST is nil, `elmo-obsolete-variable-alist' is used."
+ (dolist (pair elmo-obsolete-variable-alist)
+ (elmo-resque-obsolete-variable (cdr pair)
+ (car pair))))
+
+
(require 'product)
(product-provide (provide 'elmo-util) (require 'elmo-version))
:group 'news
:group 'mail)
-;; NNTP
-(defvar elmo-default-nntp-server "localhost"
- "*Default NNTP server.")
-(defvar elmo-default-nntp-user nil
- "*Default User of NNTP. nil means no user authentication.")
-(defvar elmo-default-nntp-port 119
- "*Default Port number of NNTP.")
-(defvar elmo-default-nntp-stream-type nil
- "*Default stream type for NNTP.
-Any symbol value of `elmo-network-stream-type-alist'.")
-(defvar elmo-nntp-stream-type-alist nil
- "*Stream bindings for NNTP.
-This is taken precedence over `elmo-network-stream-type-alist'.")
-
;; Local
-(defvar elmo-localdir-folder-path "~/Mail"
- "*Local mail folder path.")
(defvar elmo-localnews-folder-path "~/News"
"*Local news folder path.")
(defvar elmo-maildir-folder-path "~/Maildir"
"*All Folders that match this list will be treated as Maildir.
Each elements are regexp of folder name (This is obsolete).")
+(defvar elmo-msgdb-file-header-chop-length 2048
+ "*Number of bytes to get header in one reading from file.")
+
(defvar elmo-msgdb-dir "~/.elmo"
"*ELMO Message Database path.")
(defvar elmo-passwd-alist-file-name "passwd"
(defvar elmo-enable-disconnected-operation nil
"*Enable disconnected operations.")
-(defvar elmo-nntp-overview-fetch-chop-length 200
- "*Number of overviews to fetch in one request in nntp.")
-(defvar elmo-localdir-header-chop-length 2048
- "*Number of bytes to get header in one reading from file.")
(defvar elmo-auto-change-plugged 600
"*Time to expire change plugged state automatically, as the number of seconds.
"*Path separator.")
(defvar elmo-plugged t)
(defvar elmo-use-semi nil)
+
(defvar elmo-no-subject "(No Subject in original.)"
"*A string used when no subject field exists.")
(defvar elmo-no-from "nobody@nowhere?"
"*A string used when no from field exists.")
-(defvar elmo-multi-divide-number 100000
- "*Multi divider number.")
-
;; database dynamic linking
(defvar elmo-database-dl-module
(expand-file-name "database.so" exec-directory))
(defvar elmo-cache-expire-default-age 50
"Cache expiration age (days).")
+
(defvar elmo-cache-dirname "cache"
"Directory name for cache storage.")
-(defvar elmo-use-buffer-cache t
- "Use buffer cache.")
-
-(defvar elmo-buffer-cache-size 10
- "*Number of buffer for message cache.")
-
(defvar elmo-pack-number-check-strict t
"Pack number strictly.")
("/" . " s")
("\\" . " b")))
-(defvar elmo-nntp-use-cache t
- "Use cache in nntp folder.")
-
-(defvar elmo-pop3-use-cache t
- "Use cache in pop3 folder.")
-
-(defvar elmo-localdir-lockfile-list nil)
-
-(defvar elmo-nntp-max-number-precedes-list-active nil
- "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-pop3-send-command-synchronously nil
- "If non-nil, commands are send synchronously.
-If server doesn't accept asynchronous commands, this variable should be
-set as non-nil.")
-
(defvar elmo-hash-minimum-size 1023
"Minimum size of hash table.")
(dolist (group groups)
(or (elmo-get-hash-val group hashtb)
(elmo-set-hash-val group nil hashtb)))
- hashtb))
+ (setq elmo-newsgroups-hashtb hashtb)))
(defvar elmo-crosspost-message-alist-modified nil)
(defun elmo-crosspost-message-alist-load ()
(elmo-make-directory temp-dir)
temp-dir))
+(defun elmo-init ()
+ "Initialize ELMO module."
+ (elmo-crosspost-message-alist-load)
+ (elmo-resque-obsolete-variables))
+
(defun elmo-quit ()
"Quit and cleanup ELMO."
+; (setq elmo-newsgroups-hashtb nil)
+ (elmo-crosspost-message-alist-save)
;; Not implemented yet.
(let ((types elmo-folder-type-alist)
class)
+2001-02-21 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl.el (wl-init): Don't call `elmo-crosspost-message-alist-load'.
+ (wl): Call `elmo-init' and fix.
+
+ * wl-draft.el, wl-folder.el, wl-summary.el, wl-util.el:
+ Use new variables.
+
+ * wl-folder.el (wl-folder): Call `sit-for' before `wl-folder-init'.
+
+2001-02-20 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-vars.el (wl-biff-notify-hook): Set default value as '(beep).
+
2001-02-20 Katsumi Yamaoka <yamaoka@jpl.org>
* wl-demo.el (wl-demo-image-type-alist): Use ' instead of `.
(wl-parse-newsgroups): Likewise.
(wl-biff-notify): Run `wl-biff-notify-hook'.
+2001-02-21 Yuuichi Teranishi <teranisi@gohome.org>
+
+ * wl-vars.el (wl-summary-lazy-highlight): New variable.
+
+ * wl-summary.el (wl-summary-mode): Set up window-scroll-functions
+ when `wl-summary-lazy-highlight' is non-nil.
+ (wl-summary-goto-folder-subr): Highlight only when
+ `wl-summary-lazy-highlight' is non-nil.
+
+ * wl-highlight.el (wl-highlight-summary): Fixed docstring;
+ Don't display progress and highlight temp-mark when
+ `wl-summary-lazy-highlight' is non-nil.
+ (wl-highlight-summary-window): New function.
+ (Based on the patch from Akihiro MOTOKI <mokkun@iname.com>)
+
+2000-02-20 Kenichi OKADA <okada@opaopa.org>
+
+ * wl-summary.el (wl-summary-sync): Change `all-visible'
+ from `all-shown'
+ (wl-summary-input-range): Ditto.
+
2001-02-20 Katsumi Yamaoka <yamaoka@jpl.org>
* wl-e21.el (wl-highlight-folder-current-line): Call
2000-02-20 Kenichi OKADA <okada@opaopa.org>
- * wl-summary.el (wl-summary-sync): Added 'all-shown'
+ * wl-summary.el (wl-summary-sync): Added `all-shown'
2000-02-20 Kenichi OKADA <okada@opaopa.org>
(let ((session (elmo-pop3-get-session
(list 'pop3
(or wl-pop-before-smtp-user
- elmo-default-pop3-user)
+ elmo-pop3-default-user)
(or wl-pop-before-smtp-authenticate-type
- elmo-default-pop3-authenticate-type)
+ elmo-pop3-default-authenticate-type)
(or wl-pop-before-smtp-server
- elmo-default-pop3-server)
+ elmo-pop3-default-server)
(or wl-pop-before-smtp-port
- elmo-default-pop3-port)
+ elmo-pop3-default-port)
(or wl-pop-before-smtp-stream-type
- elmo-default-pop3-stream-type)))))
+ elmo-pop3-default-stream-type)))))
(when session (elmo-network-close-session session)))
(error))
(wl-draft-send-mail-with-smtp))
(defun wl-draft-elmo-nntp-send ()
(let ((elmo-nntp-post-pre-hook wl-news-send-pre-hook)
- (elmo-default-nntp-user
- (or wl-nntp-posting-user elmo-default-nntp-user))
- (elmo-default-nntp-server
- (or wl-nntp-posting-server elmo-default-nntp-server))
- (elmo-default-nntp-port
- (or wl-nntp-posting-port elmo-default-nntp-port))
- (elmo-default-nntp-stream-type
- (or wl-nntp-posting-stream-type elmo-default-nntp-stream-type)))
- (if (not (elmo-plugged-p elmo-default-nntp-server elmo-default-nntp-port))
+ (elmo-nntp-default-user
+ (or wl-nntp-posting-user elmo-nntp-default-user))
+ (elmo-nntp-default-server
+ (or wl-nntp-posting-server elmo-nntp-default-server))
+ (elmo-nntp-default-port
+ (or wl-nntp-posting-port elmo-nntp-default-port))
+ (elmo-nntp-default-stream-type
+ (or wl-nntp-posting-stream-type elmo-nntp-default-stream-type)))
+ (if (not (elmo-plugged-p elmo-nntp-default-server elmo-nntp-default-port))
(wl-draft-set-sent-message 'news 'unplugged
- (cons elmo-default-nntp-server
- elmo-default-nntp-port))
- (elmo-nntp-post elmo-default-nntp-server (current-buffer))
+ (cons elmo-nntp-default-server
+ elmo-nntp-default-port))
+ (elmo-nntp-post elmo-nntp-default-server (current-buffer))
(wl-draft-set-sent-message 'news 'sent)
- (wl-draft-write-sendlog 'ok 'nntp elmo-default-nntp-server
+ (wl-draft-write-sendlog 'ok 'nntp elmo-nntp-default-server
(std11-field-body "Newsgroups")
(std11-field-body "Message-ID")))))
(switch-to-buffer wl-folder-buffer-name)
(switch-to-buffer (get-buffer-create wl-folder-buffer-name))
(wl-folder-mode)
+ (sit-for 0)
(wl-folder-init)
(set-buffer wl-folder-buffer-name)
(let ((inhibit-read-only t)
(elmo-set-plugged wl-plugged
wl-nntp-posting-server
wl-nntp-posting-stream-type
- elmo-default-nntp-port
+ elmo-nntp-default-port
nil nil "nntp" add))
(run-hooks 'wl-make-plugged-hook)))
wl-highlight-summary-refiled-regexp matches messages mark as refiled
wl-highlight-summary-copied-regexp matches messages mark as copied
wl-highlight-summary-new-regexp matches new messages
-
-If HACK-SIG is true,then we search backward from END for something that
-looks like the beginning of a signature block, and don't consider that a
-part of the message (this is because signatures are often incorrectly
-interpreted as cited text.)"
+"
(if (< end start)
(let ((s start)) (setq start end end s)))
- (let* ((lines (count-lines start end))
- (too-big (and wl-highlight-max-summary-lines
- (> lines wl-highlight-max-summary-lines)))
- (real-end end)
- gc-message
- e p hend i percent)
+ (let (lines too-big gc-message e p hend i percent)
(save-excursion
- (save-restriction
- (widen)
- (narrow-to-region start end)
- (if (not too-big)
- (save-restriction
- (goto-char start)
- (setq i 0)
- (while (not (eobp))
- (wl-highlight-summary-current-line nil nil wl-summary-scored)
- (when (> lines elmo-display-progress-threshold)
- (setq i (+ i 1))
- (setq percent (/ (* i 100) lines))
- (if (or (zerop (% percent 5)) (= i lines))
- (elmo-display-progress
- 'wl-highlight-summary "Highlighting..."
- percent)))
- (forward-line 1))
- (message "Highlighting...done")))))))
+ (unless wl-summary-lazy-highlight
+ (setq lines (count-lines start end)
+ too-big (and wl-highlight-max-summary-lines
+ (> lines wl-highlight-max-summary-lines))))
+ (goto-char start)
+ (setq i 0)
+ (while (and (not (eobp))
+ (< (point) end))
+ (wl-highlight-summary-current-line nil nil
+ (or wl-summary-lazy-highlight
+ wl-summary-scored))
+ (when (and (not wl-summary-lazy-highlight)
+ (> lines elmo-display-progress-threshold))
+ (setq i (+ i 1))
+ (setq percent (/ (* i 100) lines))
+ (if (or (zerop (% percent 5)) (= i lines))
+ (elmo-display-progress
+ 'wl-highlight-summary "Highlighting..."
+ percent)))
+ (forward-line 1))
+ (unless wl-summary-lazy-highlight
+ (message "Highlighting...done")))))
+
+(defun wl-highlight-summary-window (&optional win beg)
+ "Highlight summary window.
+This function is defined for `window-scroll-functions'"
+ (if wl-summary-highlight
+ (with-current-buffer (window-buffer win)
+ (wl-highlight-summary (window-start win)
+ (save-excursion
+ (goto-char (window-start win))
+ (forward-line (frame-height))
+ (point))))))
(defun wl-highlight-headers (&optional for-draft)
(let ((beg (point-min))
wl-summary-buffer-folder-indicator
wl-summary-buffer-unread-status))
(easy-menu-add wl-summary-mode-menu)
+ (when wl-summary-lazy-highlight
+ (make-local-variable 'window-scroll-functions)
+ (add-hook 'window-scroll-functions 'wl-highlight-summary-window))
;; This hook may contain the function `wl-setup-summary' for reasons
;; of system internal to accord facilities for the Emacs variants.
(run-hooks 'wl-summary-mode-hook))
(wl-summary-buffer-number-column-detect t)
(wl-summary-toggle-disp-msg 'on)
(unless (and reuse-buf keep-cursor)
- (setq hilit wl-summary-highlight)
+ ;(setq hilit wl-summary-highlight)
(unwind-protect
(let ((wl-summary-highlight (if reuse-buf wl-summary-highlight))
(wl-use-scoring
(forward-line -1)
(wl-summary-prev))
(setq retval 'more-next))
- (setq wl-summary-highlight hilit)
+ ;(setq wl-summary-highlight hilit)
(if (and wl-summary-highlight
+ (not wl-summary-lazy-highlight)
(not reuse-buf))
(if (and wl-summary-highlight-partial-threshold
(> (count-lines (point-min) (point-max))
wl-summary-highlight-partial-threshold)))
(wl-highlight-summary (point) (point-max)))
(wl-highlight-summary (point-min) (point-max))))
+ (if (null wl-summary-buffer-msgdb) ;; one more try.
+ (setq wl-summary-buffer-msgdb
+ (elmo-msgdb-load (elmo-string fld))))
(if (eq retval 'disp-msg)
(wl-summary-redisplay))
(if mes (message "%s" mes))
(wl-summary-buffer-folder-name) original 'no-sync))
(cond ((eq wl-summary-search-via-nntp 'confirm)
(message "Search message in nntp server \"%s\" <y/n/s(elect)>?"
- elmo-default-nntp-server)
+ elmo-nntp-default-server)
(setq schar (read-char))
(cond ((eq schar ?y)
(wl-summary-jump-to-msg-by-message-id-via-nntp msgid))
(setq server server-spec)))
(when (setq ret (elmo-nntp-get-newsgroup-by-msgid
msgid
- (or server elmo-default-nntp-server)
- (or user elmo-default-nntp-user)
- (or port elmo-default-nntp-port)
- (or type elmo-default-nntp-stream-type)))
+ (or server elmo-nntp-default-server)
+ (or user elmo-nntp-default-user)
+ (or port elmo-nntp-default-port)
+ (or type elmo-nntp-default-stream-type)))
(setq newsgroups (elmo-nntp-parse-newsgroups ret))
(setq folder (concat "-" (car newsgroups)
(elmo-nntp-folder-postfix user server port type)))
(if ret
(wl-summary-jump-to-msg-internal folder nil 'update msgid)
(message "No message id \"%s\" in nntp server \"%s\"."
- msgid (or server elmo-default-nntp-server))
+ msgid (or server elmo-nntp-default-server))
nil)))
(defun wl-summary-jump-to-msg-internal (folder msg scan-type &optional msgid)
(setq fld-name nil))
(if (eq (length (setq port
(elmo-match-string 2 url))) 0)
- (setq port (int-to-string elmo-default-nntp-port)))
+ (setq port (int-to-string elmo-nntp-default-port)))
(if (eq (length (setq server
(elmo-match-string 1 url))) 0)
- (setq server elmo-default-nntp-server))
+ (setq server elmo-nntp-default-server))
(setq folder (concat "-" fld-name "@" server ":" port))
(if (eq (length (setq msg
(elmo-match-string 4 url))) 0)
"A hook called when score mode is started.")
(defvar wl-make-plugged-hook nil
"A hook called when make plugged alist.")
+(defvar wl-biff-notify-hook '(beep)
+ "A hook called when a biff-notification is invoked.")
(defvar wl-plugged-exit-hook nil
"A hook called when exit plugged mode.")
:group 'wl-summary
:group 'wl-highlight)
+(defcustom wl-summary-lazy-highlight (and (boundp 'window-scroll-functions)
+ (not wl-on-xemacs))
+ "Non-nil forces lazy summary highlighting using `window-scroll-functions'."
+ :type 'boolean
+ :group 'wl-summary
+ :group 'wl-highlight)
+
(defcustom wl-summary-highlight-partial-threshold 1000
- "Summary is not highlighted entirely if there are lines more than this value."
+ "Summary is not highlighted entirely if there are lines more than this value.
+Available if only `wl-summary-lazy-highlight' is nil."
:type 'integer
:group 'wl-summary
:group 'wl-highlight)
(defcustom wl-summary-partial-highlight-above-lines 30
"If Summary has lines more than `wl-summary-highlight-partial-threshold',
-Summary lines are highlighted partialy above current position."
+Summary lines are highlighted partialy above current position.
+Available if only `wl-summary-lazy-highlight' is nil."
:type 'integer
:group 'wl-summary
:group 'wl-highlight)
(wl-address-init)
(wl-draft-setup)
(wl-refile-alist-setup)
- (elmo-crosspost-message-alist-load)
(if wl-use-semi
(progn
(require 'wl-mime)
(let (demo-buf)
(unwind-protect
(setq demo-buf (wl-init arg))
- (wl-plugged-init (wl-folder arg)))
- (unwind-protect
- (unless arg
- (run-hooks 'wl-auto-check-folder-pre-hook)
- (wl-folder-auto-check)
- (run-hooks 'wl-auto-check-folder-hook))
+ (wl-plugged-init (wl-folder arg))
+ (elmo-init)
+ (unwind-protect
+ (unless arg
+ (run-hooks 'wl-auto-check-folder-pre-hook)
+ (wl-folder-auto-check)
+ (run-hooks 'wl-auto-check-folder-hook))
+ (unless arg (wl-biff-start))
+ (if (buffer-live-p demo-buf)
+ (kill-buffer demo-buf)))
(if (buffer-live-p demo-buf)
(kill-buffer demo-buf))
- (unless arg (wl-biff-start))
(run-hooks 'wl-hook))))
;; Define some autoload functions WL might use.