From 8970a3db57876bad24de6d8c5363d9fbf7bac64c Mon Sep 17 00:00:00 2001 From: teranisi Date: Wed, 21 Feb 2001 08:41:54 +0000 Subject: [PATCH] Synch up with main trunk and so on. --- elmo/ChangeLog | 54 ++++++++++++++++++ elmo/elmo-cache.el | 24 +------- elmo/elmo-imap4.el | 48 ++++++++-------- elmo/elmo-localdir.el | 2 + elmo/elmo-msgdb.el | 10 ++-- elmo/elmo-multi.el | 4 ++ elmo/elmo-nntp.el | 150 ++++++++++++++++++++++++++++++++++++++++++++----- elmo/elmo-pop3.el | 76 +++++++++++++++++-------- elmo/elmo-util.el | 51 ++++++++++++++++- elmo/elmo-vars.el | 51 ++--------------- elmo/elmo.el | 9 ++- wl/ChangeLog | 37 +++++++++++- wl/wl-draft.el | 36 ++++++------ wl/wl-folder.el | 3 +- wl/wl-highlight.el | 64 +++++++++++---------- wl/wl-summary.el | 23 +++++--- wl/wl-util.el | 4 +- wl/wl-vars.el | 15 ++++- wl/wl.el | 18 +++--- 19 files changed, 474 insertions(+), 205 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index dd91aa6..995cac7 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,52 @@ +2001-02-21 Yuuichi Teranishi + + * 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 + + * 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 * elmo-imap4.el (elmo-network-authenticate-session): Fix. @@ -10,6 +59,11 @@ `nohide'. (elmo-folder-synchronize): Changed meaning of argument `ignore-msgdb'. +2001-02-21 OKAZAKI Tetsurou + + * elmo-util.el (elmo-display-progress): Prefer + `progress-feedback-with-label' to `lprogress-display'. + 2000-02-20 Kenichi OKADA * elmo-imap4.el (elmo-imap4-list-folder): Added 'uid' diff --git a/elmo/elmo-cache.el b/elmo/elmo-cache.el index 7d20f60..1f5eb79 100644 --- a/elmo/elmo-cache.el +++ b/elmo/elmo-cache.el @@ -393,28 +393,6 @@ If KBYTES is kilo bytes (This value must be float)." (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*")) @@ -432,7 +410,7 @@ If KBYTES is kilo bytes (This value must be float)." ;; 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 diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 110ded9..24d9d5f 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -86,14 +86,16 @@ Any symbol value of `elmo-network-stream-type-alist' or :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. @@ -988,11 +990,11 @@ If CHOP-LENGTH is not specified, message set is not chopped." 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 @@ -1745,16 +1747,16 @@ Return nil if no complete line has arrived." (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))) @@ -1773,10 +1775,10 @@ Return nil if no complete line has arrived." ;; 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 @@ -1787,7 +1789,7 @@ Return nil if no complete line has arrived." 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) @@ -1795,7 +1797,7 @@ Return nil if no complete line has arrived." (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 @@ -1894,24 +1896,24 @@ Return nil if no complete line has arrived." 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 diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 15ced51..f041c58 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -42,6 +42,8 @@ :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) diff --git a/elmo/elmo-msgdb.el b/elmo/elmo-msgdb.el index c2a0e77..3ef50ce 100644 --- a/elmo/elmo-msgdb.el +++ b/elmo/elmo-msgdb.el @@ -645,11 +645,11 @@ Header region is supposed to be narrowed." (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... @@ -657,11 +657,11 @@ Header region is supposed to be narrowed." 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)))))))) @@ -679,7 +679,7 @@ Header region is supposed to be narrowed." ;; 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 diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index 0633392..fbb5977 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -31,6 +31,10 @@ (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) diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index 3e9b69f..70da479 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -41,6 +41,50 @@ (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) @@ -68,17 +112,17 @@ (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)) @@ -207,14 +251,14 @@ Don't cache if nil.") (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) @@ -515,16 +559,16 @@ Don't cache if nil.") (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 @@ -928,12 +972,92 @@ Don't cache if nil.") (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) @@ -960,10 +1084,10 @@ Don't cache if nil.") (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) diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 3d7dfc5..f69e0af 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -41,34 +41,66 @@ (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) @@ -94,12 +126,12 @@ This is taken precedence over `elmo-network-stream-type-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) @@ -107,14 +139,14 @@ This is taken precedence over `elmo-network-stream-type-alist'.") 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 diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 8b87674..05d7477 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1096,10 +1096,10 @@ the value of `foo'." (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." @@ -1348,6 +1348,51 @@ NUMBER-SET is altered." (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)) diff --git a/elmo/elmo-vars.el b/elmo/elmo-vars.el index 1389b5c..5d0d7c0 100644 --- a/elmo/elmo-vars.el +++ b/elmo/elmo-vars.el @@ -41,23 +41,7 @@ :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" @@ -66,6 +50,9 @@ This is taken precedence over `elmo-network-stream-type-alist'.") "*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" @@ -133,10 +120,6 @@ For disconnected operations.") (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. @@ -164,14 +147,12 @@ If function, return value of function.") "*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)) @@ -224,15 +205,10 @@ Arguments for this function are NAME, BUFFER, HOST and SERVICE.") (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.") @@ -260,23 +236,6 @@ Arguments for this function are NAME, BUFFER, HOST and SERVICE.") ("/" . " 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.") diff --git a/elmo/elmo.el b/elmo/elmo.el index 10fb1ba..72eefde 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -1203,7 +1203,7 @@ Return a hashtable for newsgroups." (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 () @@ -1239,8 +1239,15 @@ Return a hashtable for newsgroups." (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) diff --git a/wl/ChangeLog b/wl/ChangeLog index 31139f0..8aad2b6 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,17 @@ +2001-02-21 Yuuichi Teranishi + + * 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 + + * wl-vars.el (wl-biff-notify-hook): Set default value as '(beep). + 2001-02-20 Katsumi Yamaoka * wl-demo.el (wl-demo-image-type-alist): Use ' instead of `. @@ -69,6 +83,27 @@ (wl-parse-newsgroups): Likewise. (wl-biff-notify): Run `wl-biff-notify-hook'. +2001-02-21 Yuuichi Teranishi + + * 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 ) + +2000-02-20 Kenichi OKADA + + * wl-summary.el (wl-summary-sync): Change `all-visible' + from `all-shown' + (wl-summary-input-range): Ditto. + 2001-02-20 Katsumi Yamaoka * wl-e21.el (wl-highlight-folder-current-line): Call @@ -113,7 +148,7 @@ 2000-02-20 Kenichi OKADA - * wl-summary.el (wl-summary-sync): Added 'all-shown' + * wl-summary.el (wl-summary-sync): Added `all-shown' 2000-02-20 Kenichi OKADA diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 415e40b..65acdd6 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -955,15 +955,15 @@ non-nil." (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)) @@ -1426,21 +1426,21 @@ If optional argument is non-nil, current draft buffer is killed" (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"))))) diff --git a/wl/wl-folder.el b/wl/wl-folder.el index fe23e67..6a25e86 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -1455,6 +1455,7 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (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) @@ -1964,7 +1965,7 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (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))) diff --git a/wl/wl-highlight.el b/wl/wl-highlight.el index 4be1ac9..e73a998 100644 --- a/wl/wl-highlight.el +++ b/wl/wl-highlight.el @@ -986,38 +986,44 @@ Variables used: 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)) diff --git a/wl/wl-summary.el b/wl/wl-summary.el index d24c7ed..c1b1c87 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -759,6 +759,9 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'." 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)) @@ -2570,7 +2573,7 @@ If ARG, without confirm." (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 @@ -2611,8 +2614,9 @@ If ARG, without confirm." (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)) @@ -2625,6 +2629,9 @@ If ARG, without confirm." 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)) @@ -4717,7 +4724,7 @@ Return t if message exists." (wl-summary-buffer-folder-name) original 'no-sync)) (cond ((eq wl-summary-search-via-nntp 'confirm) (message "Search message in nntp server \"%s\" ?" - 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)) @@ -4749,10 +4756,10 @@ Return t if message exists." (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))) @@ -4768,7 +4775,7 @@ Return t if message exists." (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) diff --git a/wl/wl-util.el b/wl/wl-util.el index 5fb51fe..c934171 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -512,10 +512,10 @@ that `read' can handle, whenever this is possible." (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) diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 9f39733..a3cd860 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -504,6 +504,8 @@ reasons of system internal to accord facilities for the Emacs variants.") "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.") @@ -991,15 +993,24 @@ ex. :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) diff --git a/wl/wl.el b/wl/wl.el index 00342e4..004a52f 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -667,7 +667,6 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (wl-address-init) (wl-draft-setup) (wl-refile-alist-setup) - (elmo-crosspost-message-alist-load) (if wl-use-semi (progn (require 'wl-mime) @@ -767,15 +766,18 @@ If ARG (prefix argument) is specified, folder checkings are skipped." (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. -- 1.7.10.4