From 310c5eaab82b1db0dc6626717e103fbd93b768b8 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 27 Feb 2001 07:22:17 +0000 Subject: [PATCH] Synch up with main trunk and so on. --- elmo/ChangeLog | 27 ++++++++++++++++++++++ elmo/elmo-cache.el | 1 - elmo/elmo-dop.el | 63 +++++++++++----------------------------------------- elmo/elmo-pipe.el | 4 ++-- elmo/elmo-pop3.el | 8 +++---- elmo/elmo-util.el | 34 ++++++++++++++-------------- elmo/elmo-vars.el | 3 +++ elmo/elmo.el | 5 ----- wl/ChangeLog | 19 ++++++++++++++++ wl/wl-draft.el | 3 --- wl/wl-folder.el | 2 +- wl/wl-summary.el | 32 ++++++++++++++++---------- 12 files changed, 105 insertions(+), 96 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 687bd84..e8b4e81 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,30 @@ +2001-02-27 Yuuichi Teranishi + + * elmo-vars.el (elmo-inhibit-number-mapping): New variable. + + * elmo-util.el (elmo-make-file-cache): Moved position of + some macros. + + * elmo-pop3.el (elmo-pop3-inhibit-uidl): Eliminated. + (elmo-pop3-get-session): Use `elmo-inhibit-number-mapping' + instead of `elmo-pop3-inhibit-uidl'. + (elmo-folder-exists-p): Ditto. + (elmo-pop3-folder-list-messages): Ditto. + + * elmo-pipe.el (elmo-pipe-drain): Use `elmo-inhibit-number-mapping' + instead of `elmo-pop3-inhibit-uidl'. + (elmo-folder-status): Ditto. + + * elmo-dop.el (elmo-dop-folder): New variable. + (elmo-dop-lock-message): Eliminated. + (elmo-dop-unlock-message): Ditto. + (elmo-dop-lock-list-load): Ditto. + (elmo-dop-lock-list-save): Ditto. + (elmo-dop-delete-folder): Ditto. + (elmo-dop-rename-folder): Ditto. + + * elmo.el: Removed incomplete commentary. + 2001-02-25 TAKAHASHI Kaoru * elmo.el (toplevel): Require 'elmo-version first; diff --git a/elmo/elmo-cache.el b/elmo/elmo-cache.el index 6ae218c..6631534 100644 --- a/elmo/elmo-cache.el +++ b/elmo/elmo-cache.el @@ -34,7 +34,6 @@ (require 'elmo-util) (require 'elmo) (require 'elmo-map) -(require 'elmo-dop) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; diff --git a/elmo/elmo-dop.el b/elmo/elmo-dop.el index 89f4503..8980c03 100644 --- a/elmo/elmo-dop.el +++ b/elmo/elmo-dop.el @@ -39,10 +39,13 @@ "A list of (folder-name function-to-be-called argument-list). Automatically loaded/saved.") -(defun elmo-dop-queue-append (folder function argument) +(defvar elmo-dop-folder (concat "+" (expand-file-name "dop" + elmo-msgdb-dir)) + "A folder for `elmo-folder-append-messages' disconnected operations.") + +(defun elmo-dop-queue-append (folder function arguments) (let ((operation (list (elmo-folder-name-internal folder) - function argument))) - (elmo-dop-queue-load) + function arguments))) (unless (member operation elmo-dop-queue) ;; don't append same operation (setq elmo-dop-queue (append elmo-dop-queue @@ -53,7 +56,6 @@ Automatically loaded/saved.") "Flush Disconnected operations. If optional argument FORCE is non-nil, try flushing all operation queues even an operation concerns the unplugged folder." - (elmo-dop-queue-load) ; load cache. (elmo-dop-queue-merge) (let ((queue elmo-dop-queue) (count 0) @@ -147,12 +149,13 @@ even an operation concerns the unplugged folder." (member (cadr que) elmo-dop-merge-funcs) (setq match-queue (car (delete nil - (mapcar '(lambda (new-queue) - (if (and - (string= (car que) (car new-queue)) - (string= (cadr que) (cadr new-queue))) - new-queue)) - new-queue))))) + (mapcar + (lambda (new-queue) + (if (and + (string= (car que) (car new-queue)) + (string= (cadr que) (cadr new-queue))) + new-queue)) + new-queue))))) (setcar (cddr match-queue) (append (nth 2 match-queue) (nth 2 que))) (setq new-queue (append new-queue (list que)))) @@ -173,40 +176,6 @@ even an operation concerns the unplugged folder." elmo-msgdb-dir) elmo-dop-queue))) -(defun elmo-dop-lock-message (message-id &optional lock-list) - (let ((locked (or lock-list - (elmo-object-load - (expand-file-name - elmo-msgdb-lock-list-filename - elmo-msgdb-dir))))) - (setq locked (cons message-id locked)) - (elmo-object-save - (expand-file-name elmo-msgdb-lock-list-filename - elmo-msgdb-dir) - locked))) - -(defun elmo-dop-unlock-message (message-id &optional lock-list) - (let ((locked (or lock-list - (elmo-object-load - (expand-file-name elmo-msgdb-lock-list-filename - elmo-msgdb-dir))))) - (setq locked (delete message-id locked)) - (elmo-object-save - (expand-file-name elmo-msgdb-lock-list-filename - elmo-msgdb-dir) - locked))) - -(defun elmo-dop-lock-list-load () - (elmo-object-load - (expand-file-name elmo-msgdb-lock-list-filename - elmo-msgdb-dir))) - -(defun elmo-dop-lock-list-save (lock-list) - (elmo-object-save - (expand-file-name elmo-msgdb-lock-list-filename - elmo-msgdb-dir) - lock-list)) - (defun elmo-dop-append-list-load (folder &optional resume) (elmo-object-load (expand-file-name (if resume @@ -476,12 +445,6 @@ even an operation concerns the unplugged folder." (error "Unplugged")) (elmo-call-func folder "create-folder"))) -(defun elmo-dop-delete-folder (folder) - (error "Unplugged")) - -(defun elmo-dop-rename-folder (old-folder new-folder) - (error "Unplugged")) - (defun elmo-dop-append-msg (folder string message-id &optional msg) (if elmo-enable-disconnected-operation (if message-id diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index 3e63b39..572d644 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -97,7 +97,7 @@ (defun elmo-pipe-drain (src dst) "Move all messages of SRC to DST." - (let ((elmo-pop3-inhibit-uidl t)) ; No need to use UIDL + (let ((elmo-inhibit-number-mapping t)) ; No need to use UIDL (message "Checking %s..." (elmo-folder-name-internal src)) (elmo-folder-open-internal src) (elmo-folder-move-messages src (elmo-folder-list-messages src) dst)) @@ -132,7 +132,7 @@ (luna-define-method elmo-folder-status ((folder elmo-pipe-folder)) (elmo-folder-open-internal (elmo-pipe-folder-src-internal folder)) (elmo-folder-open-internal (elmo-pipe-folder-dst-internal folder)) - (let* ((elmo-pop3-inhibit-uidl t) + (let* ((elmo-inhibit-number-mapping t) (src-length (length (elmo-folder-list-messages (elmo-pipe-folder-src-internal folder)))) (dst-list (elmo-folder-list-messages diff --git a/elmo/elmo-pop3.el b/elmo/elmo-pop3.el index 9233f4e..7b29818 100644 --- a/elmo/elmo-pop3.el +++ b/elmo/elmo-pop3.el @@ -90,8 +90,6 @@ This is taken precedence over `elmo-network-stream-type-alist'.") (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.") @@ -186,7 +184,7 @@ set as non-nil.") (delete-process (elmo-network-session-process-internal session)))) (defun elmo-pop3-get-session (folder &optional if-exists) - (let ((elmo-pop3-use-uidl-internal (if elmo-pop3-inhibit-uidl + (let ((elmo-pop3-use-uidl-internal (if elmo-inhibit-number-mapping nil (elmo-pop3-folder-use-uidl-internal folder)))) @@ -453,7 +451,7 @@ set as non-nil.") (elmo-folder-plugged-p folder)) (save-excursion (let (elmo-auto-change-plugged ; don't change plug status. - elmo-pop3-inhibit-uidl ; No need to use uidl. + (elmo-inhibit-number-mapping t) ; No need to use uidl. session) (prog1 (setq session (elmo-pop3-get-session folder)) @@ -569,7 +567,7 @@ set as non-nil.") (error "POP3: Error in list"))))) (defsubst elmo-pop3-folder-list-messages (folder) - (if (and (not elmo-pop3-inhibit-uidl) + (if (and (not elmo-inhibit-number-mapping) (elmo-pop3-folder-use-uidl-internal folder)) (elmo-pop3-list-by-uidl-subr folder) (elmo-pop3-list-by-list folder))) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 24ee64f..0164292 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -1364,6 +1364,23 @@ NUMBER-SET is altered." (nreverse list))) ;;; File cache. +(defmacro elmo-make-file-cache (path status) + "PATH is the cache file name. +STATUS is one of 'section, 'entire or nil. + nil means no cache exists. +'section means partial section cache exists. +'entire means entire cache exists. +If the cache is partial file-cache, TYPE is 'partial." + (` (cons (, path) (, status)))) + +(defmacro elmo-file-cache-path (file-cache) + "Returns the file path of the FILE-CACHE." + (` (car (, file-cache)))) + +(defmacro elmo-file-cache-status (file-cache) + "Returns the status of the FILE-CACHE." + (` (cdr (, file-cache)))) + (defsubst elmo-cache-to-msgid (filename) (concat "<" (elmo-recover-string-from-filename filename) ">")) @@ -1441,23 +1458,6 @@ SECTION is the section string." (write-region-as-binary (point-min) (point-max) path nil 'no-msg)))) -(defmacro elmo-make-file-cache (path status) - "PATH is the cache file name. -STATUS is one of 'section, 'entire or nil. - nil means no cache exists. -'section means partial section cache exists. -'entire means entire cache exists. -If the cache is partial file-cache, TYPE is 'partial." - (` (cons (, path) (, status)))) - -(defmacro elmo-file-cache-path (file-cache) - "Returns the file path of the FILE-CACHE." - (` (car (, file-cache)))) - -(defmacro elmo-file-cache-status (file-cache) - "Returns the status of the FILE-CACHE." - (` (cdr (, file-cache)))) - (defun elmo-file-cache-get (msgid &optional section) "Returns the current file-cache object associated with MSGID. MSGID is the message-id of the message. diff --git a/elmo/elmo-vars.el b/elmo/elmo-vars.el index 5d0d7c0..b451e6d 100644 --- a/elmo/elmo-vars.el +++ b/elmo/elmo-vars.el @@ -251,6 +251,9 @@ Arguments for this function are NAME, BUFFER, HOST and SERVICE.") (defvar elmo-display-progress-threshold 20 "*Displaying progress gauge if number of messages are more than this value.") +(defvar elmo-inhibit-number-mapping nil + "Global switch to inhibit number mapping (e.g. Inhibit UIDL on POP3).") + (require 'product) (product-provide (provide 'elmo-vars) (require 'elmo-version)) diff --git a/elmo/elmo.el b/elmo/elmo.el index c4be761..6b2e543 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -25,11 +25,6 @@ ;;; Commentary: ;; -;; APIs which can be used before opened: - -;; elmo-make-folder -;; elmo-folder-diff -;; elmo-folder-open ;;; Code: ;; diff --git a/wl/ChangeLog b/wl/ChangeLog index 4008d5d..246532d 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,22 @@ +2001-02-27 Yuuichi Teranishi + + * wl-draft.el (wl-draft-queue-flush): Don't call + `elmo-dop-unlock-message'. + * wl-draft.el (wl-draft-queue-append): Don't call + `elmo-dop-lock-message'. + + * wl-summary.el (wl-summary-buffer-msgdb): Revival (for compatibility). + (wl-summary-buffer-folder-name): Ditto. + (wl-summary-message-regexp): Added '-' (all other related portions + are changed). + (wl-summary-goto-folder-subr): Set wl-summary-buffer-msgdb and + wl-summary-buffer-folder-name. + +2001-02-26 "A. SAGATA" + + * wl-folder.el (wl-folder-check-one-entity): Fixed problem that + the number of mails in the folder buffer is not updated by wl-biff. + 2000-02-26 Kenichi OKADA * wl-summary.el (wl-summary-default-subject-filter): Fix for `Re>'. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 6674de4..4cf1a32 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1765,8 +1765,6 @@ If optional argument is non-nil, current draft buffer is killed" (message-id (std11-field-body "Message-ID"))) (if (elmo-folder-append-buffer folder t) (progn - (if message-id - (elmo-dop-lock-message message-id)) (wl-draft-queue-info-operation (car (elmo-folder-status folder)) 'save wl-sent-message-via) @@ -1835,7 +1833,6 @@ If optional argument is non-nil, current draft buffer is killed" (elmo-folder-delete-messages queue-folder (cons (car msgs) nil)) (wl-draft-queue-info-operation (car msgs) 'delete) - (elmo-dop-unlock-message (std11-field-body "Message-ID")) (setq performed (+ 1 performed))) (setq msgs (cdr msgs))) (kill-buffer buffer) diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 6a25e86..b485a13 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -845,7 +845,7 @@ Optional argument ARG is repeart count." (elmo-folder-msgdb-path folder))))) (cdr nums)) - (current-buffer))) + (get-buffer wl-folder-buffer-name))) (setq wl-folder-info-alist-modified t) (sit-for 0) (list (if wl-folder-notify-deleted diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 0bece63..8c7234a 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -66,8 +66,6 @@ (defvar wl-summary-mode-map nil) (defvar wl-current-summary-buffer nil) -;; (defvar wl-summary-buffer-msgdb nil) obsolete. -;; (defvar wl-summary-buffer-folder-name nil) obsolete. (defvar wl-summary-buffer-elmo-folder nil) (defmacro wl-summary-buffer-folder-name () @@ -109,6 +107,8 @@ (defvar wl-summary-buffer-next-folder-func nil) (defvar wl-summary-buffer-exit-func nil) (defvar wl-summary-buffer-number-list nil) +(defvar wl-summary-buffer-msgdb nil) +(defvar wl-summary-buffer-folder-name nil) (defvar wl-thread-indent-level-internal nil) (defvar wl-thread-have-younger-brother-str-internal nil) @@ -127,7 +127,7 @@ (defvar wl-summary-get-petname-func 'wl-address-get-petname-1) -(defvar wl-summary-message-regexp "^ *\\([0-9]+\\)") +(defvar wl-summary-message-regexp "^ *\\([0-9-]+\\)") (defvar wl-summary-shell-command-last "") @@ -177,6 +177,8 @@ (make-variable-buffer-local 'wl-summary-buffer-next-folder-func) (make-variable-buffer-local 'wl-summary-buffer-exit-func) (make-variable-buffer-local 'wl-summary-buffer-number-list) +(make-variable-buffer-local 'wl-summary-buffer-msgdb) +(make-variable-buffer-local 'wl-summary-buffer-folder-name) ;; internal functions (dummy) (unless (fboundp 'wl-summary-append-message-func-internal) @@ -1357,7 +1359,7 @@ If ARG is non-nil, checking is omitted." (goto-char (point-min)) (while (not (eobp)) (beginning-of-line) - (when (looking-at "^ *\\([0-9]+\\)[^0-9]\\([^0-9]\\)") + (when (looking-at "^ *\\([0-9-]+\\)[^0-9]\\([^0-9]\\)") (setq mark (wl-match-buffer 2)) (setq msg (string-to-int (wl-match-buffer 1))) (if (or (and (null prefetch-marks) @@ -1411,7 +1413,7 @@ If ARG is non-nil, checking is omitted." (save-excursion (save-match-data (beginning-of-line) - (when (looking-at "^ *\\([0-9]+\\)[^0-9]\\([^0-9]\\)") + (when (looking-at "^ *\\([0-9-]+\\)[^0-9]\\([^0-9]\\)") (goto-char (match-beginning 2)) (let ((inhibit-read-only t) (buffer-read-only nil) @@ -1605,7 +1607,7 @@ If ARG is non-nil, checking is omitted." (elmo-folder-mark-as-read folder (wl-summary-collect-unread mark-alist)) (save-excursion (goto-char (point-min)) - (while (re-search-forward "^ *\\([0-9]+\\)[^0-9]\\([^0-9 ]\\)" nil t) + (while (re-search-forward "^ *\\([0-9-]+\\)[^0-9]\\([^0-9 ]\\)" nil t) (setq msg (string-to-int (wl-match-buffer 1))) (setq mark (wl-match-buffer 2)) (when (and (not (string= mark wl-summary-important-mark)) @@ -1656,7 +1658,7 @@ If ARG is non-nil, checking is omitted." mark number unread new-mark) ;;; (re-search-backward "^ *[0-9]+..[0-9]+/[0-9]+" nil t) ; set cursor line (beginning-of-line) - (when (looking-at "^ *\\([0-9]+\\)[^0-9]\\([^0-9]\\)") + (when (looking-at "^ *\\([0-9-]+\\)[^0-9]\\([^0-9]\\)") (progn (setq mark (wl-match-buffer 2)) (cond @@ -1701,7 +1703,7 @@ If ARG is non-nil, checking is omitted." (message "Resuming cache status...") (save-excursion (goto-char (point-min)) - (while (re-search-forward "^ *\\([0-9]+\\)[^0-9]\\([^0-9]\\)" nil t) + (while (re-search-forward "^ *\\([0-9-]+\\)[^0-9]\\([^0-9]\\)" nil t) (setq msg (string-to-int (wl-match-buffer 1))) (setq mark (wl-match-buffer 2)) @@ -2215,7 +2217,7 @@ If ARG is non-nil, checking is omitted." (buffer-read-only nil) msg-num cur-mark) - (when (looking-at "^ *\\([0-9]+\\)\\([^0-9]\\)") + (when (looking-at "^ *\\([0-9-]+\\)\\([^0-9]\\)") (setq msg-num (string-to-int (wl-match-buffer 1))) (setq cur-mark (wl-match-buffer 2)) (when (member cur-mark (list " " @@ -2282,7 +2284,7 @@ If ARG is non-nil, checking is omitted." (defun wl-summary-message-number () (save-excursion (beginning-of-line) - (if (looking-at "^ *\\([0-9]+\\)") + (if (looking-at "^ *\\([0-9-]+\\)") (string-to-int (wl-match-buffer 1)) nil))) @@ -2460,7 +2462,9 @@ If ARG, without confirm." wl-summary-buffer-message-modified wl-summary-buffer-mark-modified wl-summary-buffer-thread-modified - wl-summary-buffer-number-list) + wl-summary-buffer-number-list + wl-summary-buffer-msgdb + wl-summary-buffer-folder-name) (and (eq wl-summary-buffer-view 'thread) '(wl-thread-entity-hashtb wl-thread-entities @@ -2565,6 +2569,10 @@ If ARG, without confirm." (buffer-read-only nil)) ;; Select folder (elmo-folder-open folder) + ;; For compatibility + (setq wl-summary-buffer-msgdb (elmo-folder-msgdb folder)) + (setq wl-summary-buffer-folder-name (elmo-folder-name-internal + folder)) (erase-buffer) ;; Resume summary view (if wl-summary-cache-use @@ -4285,7 +4293,7 @@ If ARG, exit virtual folder." (setq wl-summary-buffer-number-column (or (if (and update - (setq end (if (re-search-forward "^ *[0-9]+[^0-9]" nil t) + (setq end (if (re-search-forward "^ *[0-9-]+[^0-9]" nil t) (point)))) (- end (progn (beginning-of-line) (point)) 1)) (wl-get-assoc-list-value wl-summary-number-column-alist -- 1.7.10.4