From 21b901456221a38d7181f3e45342b7b41e55f304 Mon Sep 17 00:00:00 2001 From: teranisi Date: Tue, 20 Feb 2001 02:05:40 +0000 Subject: [PATCH] Process crosspost and so on. --- elmo/ChangeLog | 56 ++++++++++++++++ elmo/elmo-filter.el | 10 +-- elmo/elmo-imap4.el | 4 ++ elmo/elmo-localdir.el | 4 +- elmo/elmo-map.el | 2 +- elmo/elmo-mark.el | 2 +- elmo/elmo-mime.el | 6 +- elmo/elmo-multi.el | 104 +++++++++++++++++++++--------- elmo/elmo-net.el | 8 ++- elmo/elmo-nmz.el | 2 +- elmo/elmo-nntp.el | 172 ++++++++++++++++++++++++++++++++++++++++++------- elmo/elmo-pipe.el | 4 +- elmo/elmo-util.el | 33 +++++++--- elmo/elmo-vars.el | 5 +- elmo/elmo.el | 156 ++++++++++++++++++++++++++++---------------- wl/ChangeLog | 38 +++++++++++ wl/wl-draft.el | 3 +- wl/wl-folder.el | 4 +- wl/wl-message.el | 2 +- wl/wl-mime.el | 11 +--- wl/wl-summary.el | 76 +--------------------- wl/wl-util.el | 23 ++----- wl/wl.el | 4 +- 23 files changed, 482 insertions(+), 247 deletions(-) diff --git a/elmo/ChangeLog b/elmo/ChangeLog index 423011e..ec4cce3 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,59 @@ +2001-02-20 Yuuichi Teranishi + + * elmo.el (elmo-folder-process-crosspost): New generic method. + (elmo-folder-writable-p): Ditto. + (elmo-folder-message-appendable-p): Eliminated. + (elmo-generic-folder-append-msgdb): Rewrite. + (elmo-newsgroups-hashtb): New internal variable. + (elmo-crosspost-message-set): Eliminated. + (elmo-crosspost-message-delete): Ditto. + (elmo-setup-subscribed-newsgroups): New function. + (elmo-crosspost-message-alist-modified): New internal variable. + (elmo-crosspost-message-alist-load): New function (Renamed from + `wl-crosspost-alist-load'). + (elmo-crosspost-message-alist-save): Ditto (Renamed from + `wl-crosspost-alist-save'). + + * elmo-util.el (elmo-parse): New function (Renamed from `wl-parse'). + + * elmo-nntp.el (elmo-nntp-folder): New slots `temp-crosses' and + `unreads'. + (elmo-nntp-groups-hashtb): Eliminated (Renamed to + elmo-newsgroups-hashtb). + (elmo-nntp-message-fetch): Call `elmo-nntp-setup-crosspost-buffer', + `elmo-nntp-folder-update-crosspost-message-alist'. + (elmo-nntp-get-folders-info): Use `elmo-newsgroups-hashtb' instead of + `elmo-nntp-groups-hashtb'. + (elmo-nntp-make-groups-hashtb): Eliminated. + (elmo-nntp-parse-newsgroups): New function (Renamed from + `wl-parse-newsgroups'). + (elmo-folder-creatable-p, elmo-folder-writable-p, + elmo-folder-close-internal, elmo-folder-mark-as-read, + elmo-folder-process-crosspost, elmo-folder-list-unreads-internal): + Define. + (elmo-nntp-folder-update-crosspost-message-alist): New function. + + * elmo-net.el (elmo-message-fetch): Check buffer size. + + * elmo-multi.el (elmo-multi-split-number-alist): New function. + + * elmo-localdir.el (elmo-folder-append-buffer): Fixed logic. + + * elmo-imap4.el (elmo-folder-rename-internal): Send `select' command + before `close' command. + + * elmo.el (elmo-folder-list-unreads-internal): Added argument + `mark-alist' (All other related portions are changed). + +2001-02-13 Yuuichi Teranishi + + * elmo-util.el (elmo-create-hash-size): Eliminated. + (elmo-make-hash) Make a hash with `one less than a power of two' + length. + + * elmo-vars.el (elmo-hash-minimum-size): New variable. + (elmo-hash-maximum-size): Changed value. + 2001-02-09 Yuuichi Teranishi * elmo-mime.el (elmo-mime-message-display): Added argument `unread'. diff --git a/elmo/elmo-filter.el b/elmo/elmo-filter.el index 2bc3276..0f321ad 100644 --- a/elmo/elmo-filter.el +++ b/elmo/elmo-filter.el @@ -113,10 +113,11 @@ (elmo-folder-search (elmo-filter-folder-target-internal folder) (elmo-filter-folder-condition-internal folder))) -(defsubst elmo-filter-folder-list-unreads-internal (folder unread-marks) +(defsubst elmo-filter-folder-list-unreads-internal (folder unread-marks + mark-alist) (let ((unreads (elmo-folder-list-unreads-internal (elmo-filter-folder-target-internal folder) - unread-marks))) + unread-marks mark-alist))) (unless (listp unreads) (setq unreads (delq nil @@ -133,9 +134,8 @@ (luna-define-method elmo-folder-list-unreads-internal ((folder elmo-filter-folder) - unread-marks) - (elmo-filter-folder-list-unreads-internal folder unread-marks)) - + unread-marks &optional mark-alist) + (elmo-filter-folder-list-unreads-internal folder unread-marks mark-alist)) (defsubst elmo-filter-folder-list-importants-internal (folder important-mark) (let ((importants (elmo-folder-list-importants-internal diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index 9a17632..7bcfb0b 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -1979,6 +1979,10 @@ Return nil if no complete line has arrived." (luna-define-method elmo-folder-rename-internal ((folder elmo-imap4-folder) new-folder) (let ((session (elmo-imap4-get-session folder))) + ;; make sure the folder is selected. + (elmo-imap4-session-select-mailbox session + (elmo-imap4-folder-mailbox-internal + folder)) (elmo-imap4-send-command-wait session "close") (elmo-imap4-send-command-wait session diff --git a/elmo/elmo-localdir.el b/elmo/elmo-localdir.el index 1cb113c..f391dc8 100644 --- a/elmo/elmo-localdir.el +++ b/elmo/elmo-localdir.el @@ -214,8 +214,8 @@ (1+ (car (elmo-folder-status folder))))))) (if (file-writable-p filename) (write-region-as-binary - (point-min) (point-max) filename nil 'no-msg) - t))) + (point-min) (point-max) filename nil 'no-msg)) + t)) (luna-define-method elmo-folder-append-messages :around ((folder elmo-localdir-folder) src-folder numbers diff --git a/elmo/elmo-map.el b/elmo/elmo-map.el index 09866e2..e04ab2c 100644 --- a/elmo/elmo-map.el +++ b/elmo/elmo-map.el @@ -271,7 +271,7 @@ strategy section outbuf unread)) (luna-define-method elmo-folder-list-unreads-internal - ((folder elmo-map-folder) unread-marks) + ((folder elmo-map-folder) unread-marks &optional mark-alist) (elmo-map-folder-locations-to-numbers folder (elmo-map-folder-list-unreads folder))) diff --git a/elmo/elmo-mark.el b/elmo/elmo-mark.el index 9fcc326..5d569bb 100644 --- a/elmo/elmo-mark.el +++ b/elmo/elmo-mark.el @@ -192,7 +192,7 @@ ;;; To override elmo-map-folder methods. (luna-define-method elmo-folder-list-unreads-internal - ((folder elmo-mark-folder) unread-marks) + ((folder elmo-mark-folder) unread-marks &optional mark-alist) t) (luna-define-method elmo-folder-list-importants-internal diff --git a/elmo/elmo-mime.el b/elmo/elmo-mime.el index 13397cd..49c085c 100644 --- a/elmo/elmo-mime.el +++ b/elmo/elmo-mime.el @@ -178,13 +178,13 @@ value is used." elmo-message-sorted-field-list) (run-hooks 'elmo-message-header-inserted-hook)) -(defun elmo-make-mime-message-location (folder number strategy rawbuf unseen) +(defun elmo-make-mime-message-location (folder number strategy rawbuf unread) ;; Return the MIME message location structure. ;; FOLDER is the ELMO folder structure. ;; NUMBER is the number of the message in the FOLDER. ;; STRATEGY is the message fetching strategy. ;; RAWBUF is the output buffer for original message. -;; If second optional argument UNSEEN is non-nil, message is not marked +;; If second optional argument UNREAD is non-nil, message is not marked ;; as read. (if (and strategy (eq (elmo-fetch-strategy-entireness strategy) 'section)) @@ -200,7 +200,7 @@ value is used." (if strategy (elmo-message-fetch folder number strategy nil (current-buffer) - unseen)))) + unread)))) rawbuf)) (defun elmo-mime-message-display (folder number viewbuf rawbuf original-mode diff --git a/elmo/elmo-multi.el b/elmo/elmo-multi.el index ff5fe05..fd8e6ad 100644 --- a/elmo/elmo-multi.el +++ b/elmo/elmo-multi.el @@ -165,37 +165,52 @@ (setq cur-number (1+ cur-number))) (elmo-msgdb-sort-by-date msgdb))) +(luna-define-method elmo-folder-process-crosspost ((folder elmo-multi-folder) + &optional + number-alist) + (let ((number-alists (elmo-multi-split-number-alist + folder + (elmo-msgdb-get-number-alist + (elmo-folder-msgdb-internal folder)))) + (cur-number 1)) + (dolist (child (elmo-multi-folder-children-internal folder)) + (elmo-folder-process-crosspost child (car number-alists)) + (setq cur-number (+ 1 cur-number) + number-alists (cdr number-alists))))) + (defsubst elmo-multi-folder-append-msgdb (folder append-msgdb) - (let* ((number-alist (elmo-msgdb-get-number-alist append-msgdb)) - (all-alist (copy-sequence (append - (elmo-msgdb-get-number-alist - (elmo-folder-msgdb-internal folder)) - number-alist))) - (cur number-alist) - to-be-deleted - mark-alist same) - (while cur - (setq all-alist (delq (car cur) all-alist)) - ;; same message id exists. - (if (setq same (rassoc (cdr (car cur)) all-alist)) - (unless (= (/ (car (car cur)) - (elmo-multi-folder-divide-number-internal folder)) - (/ (car same) - (elmo-multi-folder-divide-number-internal folder))) - ;; base is also same...delete it! - (setq to-be-deleted (append to-be-deleted (list (car cur)))))) - (setq cur (cdr cur))) - (setq mark-alist (elmo-delete-if - (function - (lambda (x) - (assq (car x) to-be-deleted))) - (elmo-msgdb-get-mark-alist append-msgdb))) - (elmo-msgdb-set-mark-alist append-msgdb mark-alist) - (elmo-folder-set-msgdb-internal folder - (elmo-msgdb-append - (elmo-folder-msgdb-internal folder) - append-msgdb t)) - (length to-be-deleted))) + (if append-msgdb + (let* ((number-alist (elmo-msgdb-get-number-alist append-msgdb)) + (all-alist (copy-sequence (append + (elmo-msgdb-get-number-alist + (elmo-folder-msgdb-internal folder)) + number-alist))) + (cur number-alist) + to-be-deleted + mark-alist same) + (while cur + (setq all-alist (delq (car cur) all-alist)) + ;; same message id exists. + (if (setq same (rassoc (cdr (car cur)) all-alist)) + (unless (= (/ (car (car cur)) + (elmo-multi-folder-divide-number-internal folder)) + (/ (car same) + (elmo-multi-folder-divide-number-internal folder))) + ;; base is also same...delete it! + (setq to-be-deleted (append to-be-deleted (list (car cur)))))) + (setq cur (cdr cur))) + (setq mark-alist (elmo-delete-if + (function + (lambda (x) + (assq (car x) to-be-deleted))) + (elmo-msgdb-get-mark-alist append-msgdb))) + (elmo-msgdb-set-mark-alist append-msgdb mark-alist) + (elmo-folder-set-msgdb-internal folder + (elmo-msgdb-append + (elmo-folder-msgdb-internal folder) + append-msgdb t)) + (length to-be-deleted)) + 0)) (luna-define-method elmo-folder-append-msgdb ((folder elmo-multi-folder) append-msgdb) @@ -280,6 +295,31 @@ (elmo-folder-set-info-hashtb folder nil messages) (cons unsync messages))) +(defun elmo-multi-split-number-alist (folder number-alist) + (let ((alist (sort (copy-sequence number-alist) + (lambda (pair1 pair2) + (< (car pair1)(car pair2))))) + (cur-number 0) + one-alist split num) + (while alist + (setq cur-number (+ cur-number 1)) + (setq one-alist nil) + (while (and alist + (eq 0 + (/ (- (setq num (car (car alist))) + (* elmo-multi-divide-number cur-number)) + (elmo-multi-folder-divide-number-internal folder)))) + (setq one-alist (nconc + one-alist + (list + (cons + (% num (* (elmo-multi-folder-divide-number-internal + folder) cur-number)) + (cdr (car alist)))))) + (setq alist (cdr alist))) + (setq split (nconc split (list one-alist)))) + split)) + (defun elmo-multi-split-mark-alist (folder mark-alist) (let ((cur-number 0) (alist (sort (copy-sequence mark-alist) @@ -307,7 +347,7 @@ result)) (luna-define-method elmo-folder-list-unreads-internal - ((folder elmo-multi-folder) unread-marks) + ((folder elmo-multi-folder) unread-marks &optional mark-alist) (elmo-multi-folder-list-unreads-internal folder unread-marks)) (defun elmo-multi-folder-list-unreads-internal (folder unread-marks) @@ -323,7 +363,7 @@ (setq cur-number (+ cur-number 1)) (unless (listp (setq unreads (elmo-folder-list-unreads-internal - (car folders) unread-marks))) + (car folders) unread-marks (car mark-alists)))) (setq unreads (delq nil (mapcar (lambda (x) diff --git a/elmo/elmo-net.el b/elmo/elmo-net.el index aac2884..b6d8593 100644 --- a/elmo/elmo-net.el +++ b/elmo/elmo-net.el @@ -349,7 +349,7 @@ Returns a process object. if making session failed, returns nil." (error "Unplugged"))) (luna-define-method elmo-folder-list-unreads-internal - ((folder elmo-net-folder) unread-marks) + ((folder elmo-net-folder) unread-marks &optional mark-alist) (if (and (elmo-folder-plugged-p folder) (elmo-folder-use-flag-p folder)) (elmo-folder-send folder 'elmo-folder-list-unreads-plugged) @@ -437,7 +437,8 @@ Returns a process object. if making session failed, returns nil." number strategy section (current-buffer) unseen) (elmo-delete-cr-buffer) - (when (elmo-fetch-strategy-save-cache strategy) + (when (and (> (buffer-size) 0) + (elmo-fetch-strategy-save-cache strategy)) (elmo-file-cache-save (elmo-fetch-strategy-cache-path strategy) section)) @@ -447,7 +448,8 @@ Returns a process object. if making session failed, returns nil." number strategy section (current-buffer) unseen) (elmo-delete-cr-buffer) - (when (elmo-fetch-strategy-save-cache strategy) + (when (and (> (buffer-size) 0) + (elmo-fetch-strategy-save-cache strategy)) (elmo-file-cache-save (elmo-fetch-strategy-cache-path strategy) section)) diff --git a/elmo/elmo-nmz.el b/elmo/elmo-nmz.el index df740a7..0bb4bb4 100644 --- a/elmo/elmo-nmz.el +++ b/elmo/elmo-nmz.el @@ -226,7 +226,7 @@ ;;; To override elmo-map-folder methods. (luna-define-method elmo-folder-list-unreads-internal - ((folder elmo-nmz-folder) unread-marks) + ((folder elmo-nmz-folder) unread-marks &optional mark-alist) t) (luna-define-method elmo-folder-list-importants-internal diff --git a/elmo/elmo-nntp.el b/elmo/elmo-nntp.el index 1389529..48f985c 100644 --- a/elmo/elmo-nntp.el +++ b/elmo/elmo-nntp.el @@ -44,7 +44,7 @@ ;;; ELMO NNTP folder (eval-and-compile (luna-define-class elmo-nntp-folder (elmo-net-folder) - (group)) + (group temp-crosses reads)) (luna-define-internal-accessors 'elmo-nntp-folder)) (luna-define-method elmo-folder-initialize :around ((folder @@ -108,7 +108,7 @@ Don't cache if nil.") (defvar elmo-nntp-list-folders-cache nil) -(defvar elmo-nntp-groups-hashtb nil) + (defvar elmo-nntp-groups-async nil) (defvar elmo-nntp-header-fetch-chop-length 200) @@ -608,7 +608,7 @@ Don't cache if nil.") (elmo-net-folder-server-internal folder) (elmo-net-folder-port-internal folder) (elmo-net-folder-stream-type-internal folder))) - elmo-nntp-groups-hashtb)) + elmo-newsgroups-hashtb)) (progn (setq end-num (nth 2 entry)) (when(and killed-list @@ -930,11 +930,12 @@ Don't cache if nil.") (luna-define-method elmo-message-fetch-plugged ((folder elmo-nntp-folder) number strategy &optional section outbuf - unseen) - (elmo-nntp-message-fetch folder number strategy section outbuf unseen)) + unread) + (elmo-nntp-message-fetch folder number strategy section outbuf unread)) -(defun elmo-nntp-message-fetch (folder number strategy section outbuf unseen) - (let ((session (elmo-nntp-get-session folder))) +(defun elmo-nntp-message-fetch (folder number strategy section outbuf unread) + (let ((session (elmo-nntp-get-session folder)) + newsgroups) (with-current-buffer (elmo-network-session-buffer session) (elmo-nntp-select-group session (elmo-nntp-folder-group-internal folder)) (elmo-nntp-send-command session (format "article %s" number)) @@ -948,7 +949,11 @@ Don't cache if nil.") (goto-char (point-min)) (while (re-search-forward "^\\." nil t) (replace-match "") - (forward-line)))))))) + (forward-line)) + (elmo-nntp-setup-crosspost-buffer folder number) + (unless unread + (elmo-nntp-folder-update-crosspost-message-alist + folder (list number))))))))) (defun elmo-nntp-post (hostname content-buf) (let ((session (elmo-nntp-get-session @@ -1185,8 +1190,8 @@ Returns a list of cons cells like (NUMBER . VALUE)" (user (aref key 2)) (port (aref key 3)) (type (aref key 4)) - (hashtb (or elmo-nntp-groups-hashtb - (setq elmo-nntp-groups-hashtb + (hashtb (or elmo-newsgroups-hashtb + (setq elmo-newsgroups-hashtb (elmo-make-hash count))))) (save-excursion (elmo-nntp-groups-read-response session cur count) @@ -1261,17 +1266,6 @@ Returns a list of cons cells like (NUMBER . VALUE)" (replace-match "" t t)) (copy-to-buffer outbuf (point-min) (point-max))))) -(defun elmo-nntp-make-groups-hashtb (groups &optional size) - (let ((hashtb (or elmo-nntp-groups-hashtb - (setq elmo-nntp-groups-hashtb - (elmo-make-hash (or size (length groups))))))) - (mapcar - '(lambda (group) - (or (elmo-get-hash-val group hashtb) - (elmo-set-hash-val group nil hashtb))) - groups) - hashtb)) - ;; from nntp.el [Gnus] (defsubst elmo-nntp-next-result-arrived-p () @@ -1400,10 +1394,138 @@ Returns a list of cons cells like (NUMBER . VALUE)" (luna-define-method elmo-message-use-cache-p ((folder elmo-nntp-folder) number) elmo-nntp-use-cache) -(luna-define-method elmo-folder-append-msgdb :around - ((folder elmo-nntp-folder) append-msgdb) - ;; IMPLEMENT ME: Process crosspost here instead of following. - (luna-call-next-method)) +(luna-define-method elmo-folder-creatable-p ((folder elmo-nntp-folder)) + nil) + +(luna-define-method elmo-folder-writable-p ((folder elmo-nntp-folder)) + nil) + +(defun elmo-nntp-parse-newsgroups (string &optional subscribe-only) + (let ((nglist (elmo-parse string "[ \t\f\r\n,]*\\([^ \t\f\r\n,]+\\)")) + ngs) + (if (not subscribe-only) + nglist + (dolist (ng nglist) + (if (intern-soft ng elmo-newsgroups-hashtb) + (setq ngs (cons ng ngs)))) + ngs))) + +;;; Crosspost processing. + +;; 1. setup crosspost alist. +;; 1.1. When message is fetched and is crossposted message, +;; it is remembered in `temp-crosses' slot. +;; temp-crosses slot is a list of cons cell: +;; (NUMBER . (MESSAGE-ID (LIST-OF-NEWSGROUPS) 'ng)) +;; 1.2. In elmo-folder-close, `temp-crosses' slot is cleared, +;; 1.3. In elmo-folder-mark-as-read, move crosspost entry +;; from `temp-crosses' slot to `elmo-crosspost-message-alist'. + +;; 2. process crosspost alist. +;; 2.1. At elmo-folder-process-crosspost, setup `reads' slot from +;; `elmo-crosspost-message-alist'. +;; 2.2. remove crosspost entry for current newsgroup from +;; `elmo-crosspost-message-alist'. +;; 2.3. elmo-folder-list-unreads return unread message list according to +;; `reads' slot. +;; (There's a problem that if `elmo-folder-list-unreads' +;; never executed, crosspost information is thrown away.) +;; 2.4. In elmo-folder-close, `read' slot is cleared, + +(defun elmo-nntp-setup-crosspost-buffer (folder number) +;; 1.1. When message is fetched and is crossposted message, +;; it is remembered in `temp-crosses' slot. +;; temp-crosses slot is a list of cons cell: +;; (NUMBER . (MESSAGE-ID (LIST-OF-NEWSGROUPS) 'ng)) + (let (newsgroups crosspost-newsgroups message-id) + (save-restriction + (std11-narrow-to-header) + (setq newsgroups (std11-fetch-field "newsgroups") + message-id (std11-msg-id-string + (car (std11-parse-msg-id-string + (std11-fetch-field "message-id")))))) + (when newsgroups + (when (setq crosspost-newsgroups + (delete + (elmo-nntp-folder-group-internal folder) + (elmo-nntp-parse-newsgroups newsgroups t))) + (unless (assq number + (elmo-nntp-folder-temp-crosses-internal folder)) + (elmo-nntp-folder-set-temp-crosses-internal + folder + (cons (cons number (list message-id crosspost-newsgroups 'ng)) + (elmo-nntp-folder-temp-crosses-internal folder)))))))) + +(luna-define-method elmo-folder-close-internal ((folder elmo-nntp-folder)) +;; 1.2. In elmo-folder-close, `temp-crosses' slot is cleared, + (elmo-nntp-folder-set-temp-crosses-internal folder nil) + (elmo-nntp-folder-set-reads-internal folder nil) + ) + +(defun elmo-nntp-folder-update-crosspost-message-alist (folder numbers) +;; 1.3. In elmo-folder-mark-as-read, move crosspost entry +;; from `temp-crosses' slot to `elmo-crosspost-message-alist'. + (let (elem) + (dolist (number numbers) + (when (setq elem (assq number + (elmo-nntp-folder-temp-crosses-internal folder))) + (unless (assoc (cdr (cdr elem)) elmo-crosspost-message-alist) + (setq elmo-crosspost-message-alist + (cons (cdr elem) elmo-crosspost-message-alist))) + (elmo-nntp-folder-set-temp-crosses-internal + folder + (delq elem (elmo-nntp-folder-temp-crosses-internal folder))))))) + +(luna-define-method elmo-folder-mark-as-read ((folder elmo-nntp-folder) + numbers) + (elmo-nntp-folder-update-crosspost-message-alist folder numbers) + t) + +(luna-define-method elmo-folder-process-crosspost ((folder elmo-nntp-folder) + &optional + number-alist) + (elmo-nntp-folder-process-crosspost folder number-alist)) + +(defun elmo-nntp-folder-process-crosspost (folder number-alist) +;; 2.1. At elmo-folder-process-crosspost, setup `reads' slot from +;; `elmo-crosspost-message-alist'. +;; 2.2. remove crosspost entry for current newsgroup from +;; `elmo-crosspost-message-alist'. + (let (cross-deletes reads entity ngs) + (dolist (cross elmo-crosspost-message-alist) + (if number-alist + (when (setq entity (rassoc (nth 0 cross) number-alist)) + (setq reads (cons (car entity) reads))) + (when (setq entity (elmo-msgdb-overview-get-entity + (nth 0 cross) + (elmo-folder-msgdb-internal folder))) + (setq reads (cons (elmo-msgdb-overview-entity-get-number entity) + reads)))) + (when entity + (if (setq ngs (delete (elmo-nntp-folder-group-internal folder) + (nth 1 cross))) + (setcar (cdr cross) ngs) + (setq cross-deletes (cons cross cross-deletes))) + (setq elmo-crosspost-message-alist-modified t))) + (dolist (dele cross-deletes) + (setq elmo-crosspost-message-alist (delq + dele + elmo-crosspost-message-alist))) + (elmo-nntp-folder-set-reads-internal folder reads))) + +(luna-define-method elmo-folder-list-unreads-internal + ((folder elmo-nntp-folder) unread-marks mark-alist) + ;; 2.3. elmo-folder-list-unreads return unread message list according to + ;; `reads' slot. + (let ((mark-alist (or mark-alist (elmo-msgdb-get-mark-alist + (elmo-folder-msgdb-internal folder))))) + (elmo-living-messages (delq nil + (mapcar + (lambda (x) + (if (member (nth 1 x) unread-marks) + (car x))) + mark-alist)) + (elmo-nntp-folder-reads-internal folder)))) (require 'product) (product-provide (provide 'elmo-nntp) (require 'elmo-version)) diff --git a/elmo/elmo-pipe.el b/elmo/elmo-pipe.el index c659cc4..db4544d 100644 --- a/elmo/elmo-pipe.el +++ b/elmo/elmo-pipe.el @@ -120,9 +120,9 @@ folder))) (luna-define-method elmo-folder-list-unreads-internal - ((folder elmo-pipe-folder) unread-marks) + ((folder elmo-pipe-folder) unread-marks &optional mark-alist) (elmo-folder-list-unreads-internal (elmo-pipe-folder-dst-internal folder) - unread-marks)) + unread-marks mark-alist)) (luna-define-method elmo-folder-list-importants-internal ((folder elmo-pipe-folder) important-mark) diff --git a/elmo/elmo-util.el b/elmo/elmo-util.el index 523f1b5..8b87674 100644 --- a/elmo/elmo-util.el +++ b/elmo/elmo-util.el @@ -906,11 +906,23 @@ Emacs 19.28 or earlier does not have `unintern'." (static-if (fboundp 'unintern) (list 'unintern string))) -;; Make a hash table (default and minimum size is 1024). (defun elmo-make-hash (&optional hashsize) + "Make a new hash table which have HASHSIZE size." (make-vector - (if hashsize (max (min (elmo-create-hash-size hashsize) - elmo-hash-maximum-size) 1024) 1024) 0)) + (if hashsize + (max + ;; Prime numbers as lengths tend to result in good + ;; hashing; lengths one less than a power of two are + ;; also good. + (min + (let ((i 1)) + (while (< (- i 1) hashsize) + (setq i (* 2 i))) + (- i 1)) + elmo-hash-maximum-size) + elmo-hash-minimum-size) + elmo-hash-minimum-size) + 0)) (defsubst elmo-mime-string (string) "Normalize MIME encoded STRING." @@ -959,12 +971,6 @@ Emacs 19.28 or earlier does not have `unintern'." (setq dest (cons (cons name body) dest)))) dest))) -(defun elmo-create-hash-size (min) - (let ((i 1)) - (while (< i min) - (setq i (* 2 i))) - i)) - (defun elmo-safe-filename (folder) (elmo-replace-in-string (elmo-replace-in-string @@ -1333,6 +1339,15 @@ NUMBER-SET is altered." (setq files (cdr files))) (nconc (and (not root) (list file)) dirs))) +(defun elmo-parse (string regexp &optional matchn) + (or matchn (setq matchn 1)) + (let (list) + (store-match-data nil) + (while (string-match regexp string (match-end 0)) + (setq list (cons (substring string (match-beginning matchn) + (match-end matchn)) list))) + (nreverse list))) + (require 'product) (product-provide (provide 'elmo-util) (require 'elmo-version)) diff --git a/elmo/elmo-vars.el b/elmo/elmo-vars.el index fe2ad92..1389b5c 100644 --- a/elmo/elmo-vars.el +++ b/elmo/elmo-vars.el @@ -277,7 +277,10 @@ Arguments for this function are NAME, BUFFER, HOST and SERVICE.") If server doesn't accept asynchronous commands, this variable should be set as non-nil.") -(defvar elmo-hash-maximum-size 4096 +(defvar elmo-hash-minimum-size 1023 + "Minimum size of hash table.") + +(defvar elmo-hash-maximum-size 4095 "Maximum size of hash table.") (defvar elmo-use-decoded-cache (featurep 'xemacs) diff --git a/elmo/elmo.el b/elmo/elmo.el index cd53bfb..644f403 100644 --- a/elmo/elmo.el +++ b/elmo/elmo.el @@ -73,6 +73,9 @@ Otherwise, entire fetching of the message is aborted without confirmation." ;;; internal (defvar elmo-folder-type-alist nil) + +(defvar elmo-newsgroups-hashtb nil) + (elmo-define-error 'elmo-error "Error" 'error) (elmo-define-error 'elmo-open-error "Cannot open" 'elmo-error) (elmo-define-error 'elmo-authenticate-error "Login failed" 'elmo-open-error) @@ -196,7 +199,8 @@ Return value is a cons cell of NEWS and MESSAGES.") (defun elmo-folder-list-unreads (folder unread-marks) "Return a list of unread message numbers contained in FOLDER. UNREAD-MARKS is the unread marks." - (let ((list (elmo-folder-list-unreads-internal folder unread-marks))) + (let ((list (elmo-folder-list-unreads-internal folder + unread-marks))) (if (listp list) list ;; Not available, use current mark. @@ -228,8 +232,11 @@ IMPORTANT-MARK is the important mark." ;; Return t if the message list is not available. ) -(luna-define-generic elmo-folder-list-unreads-internal (folder unread-marks) +(luna-define-generic elmo-folder-list-unreads-internal (folder + unread-marks + &optional mark-alist) ;; Return a list of unread message numbers contained in FOLDER. + ;; If optional MARK-ALIST is set, it is used as mark-alist. ;; Return t if this feature is not available. ) @@ -251,15 +258,15 @@ Otherwise, all descendent folders are returned.") (luna-define-generic elmo-folder-creatable-p (folder) "Returns non-nil when FOLDER is creatable.") +(luna-define-generic elmo-folder-writable-p (folder) + "Returns non-nil when FOLDER is writable.") + (luna-define-generic elmo-folder-persistent-p (folder) "Return non-nil when FOLDER is persistent.") (luna-define-generic elmo-folder-create (folder) "Create a FOLDER.") -(luna-define-generic elmo-folder-message-appendable-p (folder) - "Returns non-nil when FOLDER is appendable.") - (luna-define-generic elmo-message-deletable-p (folder number) "Returns non-nil when the message in the FOLDER with NUMBER is deletable.") @@ -325,8 +332,8 @@ If optional argument NUMBER is specified, the new message number is set same-number) "Append messages from folder. FOLDER is the ELMO folder structure. -Make sure FOLDER is `message-appendable'. -(Can be checked with `elmo-folder-message-appendable-p'). +Caller should make sure FOLDER is `writable'. +(Can be checked with `elmo-folder-writable-p'). SRC-FOLDER is the source ELMO folder structure. NUMBERS is the message numbers to be appended in the SRC-FOLDER. UNREAD-MARKS is a list of unread mark string. @@ -473,7 +480,7 @@ Return newly created temporary directory name which contains temporary files.") t) (luna-define-method elmo-folder-list-unreads-internal - ((folder elmo-folder) unread-marks) + ((folder elmo-folder) unread-marks &optional mark-alist) t) (luna-define-method elmo-folder-list-importants-internal @@ -509,6 +516,13 @@ Returns non-nil if fetching was succeed.") (luna-define-generic elmo-message-folder (folder number) "Get primitive folder of the message.") +(luna-define-generic elmo-folder-process-crosspost (folder + &optional + number-alist) + "Process crosspost for FOLDER. +If NUMBER-ALIST is set, it is used as number-alist. +Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST).") + (luna-define-generic elmo-folder-append-msgdb (folder append-msgdb) "Append APPEND-MSGDB to the current msgdb of the folder.") @@ -938,33 +952,42 @@ FIELD is a symbol of the field." (luna-define-method elmo-folder-mark-as-read ((folder elmo-folder) numbers) t) +(luna-define-method elmo-folder-process-crosspost ((folder elmo-folder) + &optional + number-alist) + ;; Do nothing. + ) + (defun elmo-generic-folder-append-msgdb (folder append-msgdb) - (let* ((number-alist (elmo-msgdb-get-number-alist append-msgdb)) - (all-alist (copy-sequence (append - (elmo-msgdb-get-number-alist - (elmo-folder-msgdb-internal folder)) - number-alist))) - (cur number-alist) - pair - to-be-deleted - mark-alist) - (while cur - (setq all-alist (delq (car cur) all-alist)) - ;; same message id exists. - (if (setq pair (rassoc (cdr (car cur)) all-alist)) - (setq to-be-deleted (nconc to-be-deleted (list (car pair))))) - (setq cur (cdr cur))) - (setq mark-alist (elmo-delete-if - (function - (lambda (x) - (memq (car x) to-be-deleted))) - (elmo-msgdb-get-mark-alist append-msgdb))) - (elmo-msgdb-set-mark-alist append-msgdb mark-alist) - (elmo-folder-set-msgdb-internal folder - (elmo-msgdb-append - (elmo-folder-msgdb-internal folder) - append-msgdb t)) - (length to-be-deleted))) + (if append-msgdb + (let* ((number-alist (elmo-msgdb-get-number-alist append-msgdb)) + (all-alist (copy-sequence (append + (elmo-msgdb-get-number-alist + (elmo-folder-msgdb-internal folder)) + number-alist))) + (cur number-alist) + pair + to-be-deleted + mark-alist) + (while cur + (setq all-alist (delq (car cur) all-alist)) + ;; same message id exists. + (if (setq pair (rassoc (cdr (car cur)) all-alist)) + (setq to-be-deleted (nconc to-be-deleted (list (car pair))))) + (setq cur (cdr cur))) + ;; XXXX If caching is enabled, read-uncached mark should be set. + (setq mark-alist (elmo-delete-if + (function + (lambda (x) + (memq (car x) to-be-deleted))) + (elmo-msgdb-get-mark-alist append-msgdb))) + (elmo-msgdb-set-mark-alist append-msgdb mark-alist) + (elmo-folder-set-msgdb-internal folder + (elmo-msgdb-append + (elmo-folder-msgdb-internal folder) + append-msgdb t)) + (length to-be-deleted)) + 0)) (luna-define-method elmo-folder-append-msgdb ((folder elmo-folder) append-msgdb) @@ -1069,9 +1092,9 @@ CROSSED is cross-posted message number." (and (eq (length (car diff)) 0) (eq (length (cadr diff)) 0))) (progn - ;; NNTP: (elmo-folder-update-number folder) - nil ; no update + (elmo-folder-process-crosspost folder) + nil ; no update. ) (if delete-list (elmo-msgdb-delete-msgs folder delete-list)) (when new-list @@ -1089,10 +1112,13 @@ CROSSED is cross-posted message number." (elmo-folder-msgdb-path folder) nil))) (setq before-append nil) (setq crossed (elmo-folder-append-msgdb folder new-msgdb)) + ;; process crosspost. + ;; Return a cons cell of (NUMBER-CROSSPOSTS . NEW-MARK-ALIST). + (elmo-folder-process-crosspost folder) (elmo-folder-set-message-modified-internal folder t) - (elmo-folder-set-mark-modified-internal folder t)) - ;; return value. - (list new-msgdb delete-list crossed))) + (elmo-folder-set-mark-modified-internal folder t) + ;; return value. + (list new-msgdb delete-list crossed)))) (quit ;; Resume to the original status. (if before-append @@ -1161,22 +1187,42 @@ CROSSED is cross-posted message number." (elmo-make-directory new-dir)) (rename-file old new))))) -(defun elmo-crosspost-message-set (message-id folders &optional type) - (if (assoc message-id elmo-crosspost-message-alist) - (setcdr (assoc message-id elmo-crosspost-message-alist) - (list folders type)) - (setq elmo-crosspost-message-alist - (nconc elmo-crosspost-message-alist - (list (list message-id folders type)))))) - -(defun elmo-crosspost-message-delete (message-id folders) - (let* ((id-fld (assoc message-id elmo-crosspost-message-alist)) - (folder-list (nth 1 id-fld))) - (when id-fld - (if (setq folder-list (elmo-list-delete folders folder-list)) - (setcar (cdr id-fld) folder-list) - (setq elmo-crosspost-message-alist - (delete id-fld elmo-crosspost-message-alist)))))) +(defun elmo-setup-subscribed-newsgroups (groups) + "Setup subscribed newsgroups. +GROUPS is a list of newsgroup name string. +Return a hashtable for newsgroups." + (let ((hashtb (or elmo-newsgroups-hashtb + (setq elmo-newsgroups-hashtb + (elmo-make-hash (length groups)))))) + (dolist (group groups) + (or (elmo-get-hash-val group hashtb) + (elmo-set-hash-val group nil hashtb))) + hashtb)) + +(defvar elmo-crosspost-message-alist-modified nil) +(defun elmo-crosspost-message-alist-load () + "Load crosspost message alist." + (setq elmo-crosspost-message-alist (elmo-crosspost-alist-load)) + (setq elmo-crosspost-message-alist-modified nil)) + +(defun elmo-crosspost-message-alist-save () + "Save crosspost message alist." + (when elmo-crosspost-message-alist-modified + (let ((alist elmo-crosspost-message-alist) + newsgroups) + (while alist + (setq newsgroups + (elmo-delete-if + '(lambda (x) + (not (intern-soft x elmo-newsgroups-hashtb))) + (nth 1 (car alist)))) + (if newsgroups + (setcar (cdar alist) newsgroups) + (setq elmo-crosspost-message-alist + (delete (car alist) elmo-crosspost-message-alist))) + (setq alist (cdr alist))) + (elmo-crosspost-alist-save elmo-crosspost-message-alist) + (setq elmo-crosspost-message-alist-modified nil)))) (defun elmo-folder-make-temp-dir (folder) ;; Make a temporary directory for FOLDER. diff --git a/wl/ChangeLog b/wl/ChangeLog index 6ca4e32..4932900 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,41 @@ +2001-02-20 Yuuichi Teranishi + + * wl-summary.el (wl-summary-edit-addresses): Use + `wl-summary-get-original-buffer' + (wl-summary-mark-as-unread): Don't call `wl-summary-set-crosspost'. + (wl-summary-jump-to-msg-by-message-id-via-nntp): + Use `elmo-nntp-parse-newsgroup' instead of `wl-parse-newsgroups'. + (wl-summary-get-newsgroups): Eliminated. + (wl-summary-set-crosspost): Ditto. + (wl-summary-is-crosspost-folder): Ditto. + (wl-crosspost-alist-load): Ditto. + (wl-crosspost-alist-save): Ditto. + + * wl-folder.el (wl-folder-create-newsgroups-hashtb): Call + `elmo-setup-subscribed-newsgroups' instead of + `elmo-nntp-make-groups-hashtb'. + (wl-folder-suspend): Call `elmo-crosspost-message-alist-save' + instead of `wl-crosspost-alist-save'. + + * wl-mime.el (wl-summary-burst): Use `elmo-folder-writable-p' instead + of `elmo-folder-message-appendable-p'. + (wl-mime-header-presentation-method): Eliminated. + + * wl-message.el (wl-message-prev-page): Don't pass -1 to `recenter'. + (Error occurs in emacs21). + + * wl-draft.el (wl-draft-queue-flush): Fix (fetch message to + the current buffer). + + * wl.el (wl-save-status): Call `elmo-crosspost-message-alist-save' + instead of `wl-crosspost-alist-save'. + (wl-init): `elmo-crosspost-message-alist-load' + instead of `wl-crosspost-alist-load' + + * wl-util.el (wl-parse): Eliminated (Renamed to `elmo-parse'). + (wl-parse-newsgroups): Likewise. + (wl-biff-notify): Run `wl-biff-notify-hook'. + 2001-02-20 Katsumi Yamaoka * wl-e21.el (wl-highlight-folder-current-line): Call diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 7c85068..62cd8b7 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -1805,7 +1805,8 @@ If optional argument is non-nil, current draft buffer is killed" (wl-draft-queue-info-operation (car msgs) 'load) (elmo-message-fetch queue-folder (car msgs) - (elmo-make-fetch-strategy 'entire)) + (elmo-make-fetch-strategy 'entire) + nil (current-buffer)) (condition-case err (setq failure (funcall wl-draft-queue-flush-send-func diff --git a/wl/wl-folder.el b/wl/wl-folder.el index 93f8890..fe23e67 100644 --- a/wl/wl-folder.el +++ b/wl/wl-folder.el @@ -1878,7 +1878,7 @@ Entering Folder mode calls the value of `wl-folder-mode-hook'." (setq entities (wl-pop entity-stack)))) (and info (message "Creating newsgroups...done")) (if (or newsgroups make-hashtb) - (elmo-nntp-make-groups-hashtb newsgroups)))) + (elmo-setup-subscribed-newsgroups newsgroups)))) (defun wl-folder-get-path (entity target-id &optional string) (let ((entities (list entity)) @@ -2180,7 +2180,7 @@ Use `wl-subscribed-mailing-list'." (interactive) (run-hooks 'wl-folder-suspend-hook) (wl-folder-info-save) - (wl-crosspost-alist-save) + (elmo-crosspost-message-alist-save) (elmo-quit) ;(if (fboundp 'mmelmo-cleanup-entity-buffers) ;(mmelmo-cleanup-entity-buffers)) diff --git a/wl/wl-message.el b/wl/wl-message.el index 8a09ea8..c669d8e 100644 --- a/wl/wl-message.el +++ b/wl/wl-message.el @@ -266,7 +266,7 @@ Returns non-nil if top of message." (progn (wl-message-narrow-to-page -1) (goto-char (point-max)) - (recenter -1)) + (recenter)) (if (not (bobp)) (condition-case nil (scroll-down lines) diff --git a/wl/wl-mime.el b/wl/wl-mime.el index a249d8d..8eeba59 100644 --- a/wl/wl-mime.el +++ b/wl/wl-mime.el @@ -32,7 +32,7 @@ (require 'mime-view) (require 'mime-edit) (require 'mime-play) -(require 'mmelmo) +(require 'elmo) (eval-when-compile (defalias-maybe 'Meadow-version 'ignore)) @@ -182,7 +182,7 @@ By setting following-method as yank-content." children message-entity content-type target) (save-excursion (setq target wl-summary-buffer-elmo-folder) - (while (not (elmo-folder-message-appendable-p target)) + (while (not (elmo-folder-writable-p target)) (setq target (wl-summary-read-folder wl-default-folder "to extract to"))) (wl-summary-set-message-buffer-or-redisplay) @@ -280,13 +280,6 @@ By setting following-method as yank-content." (setq overviews (cdr overviews))) (message "Not all partials found."))))) -(defun wl-mime-header-presentation-method (entity situation) - (let ((mmelmo-sort-field-list wl-message-sort-field-list)) - (mime-insert-header entity - wl-message-ignored-field-list - wl-message-visible-field-list) - (wl-highlight-headers))) - ;;; Setup methods. (defun wl-mime-setup () (set-alist 'mime-preview-quitting-method-alist diff --git a/wl/wl-summary.el b/wl/wl-summary.el index f2e971e..4408757 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -1178,10 +1178,9 @@ Optional argument ADDR-STR is used as a target address if specified." (if (null (wl-summary-message-number)) (message "No message.") (save-excursion - (wl-summary-set-message-buffer-or-redisplay) (let* ((charset wl-summary-buffer-mime-charset) (candidates - (with-current-buffer (wl-message-get-original-buffer) + (with-current-buffer (wl-summary-get-original-buffer) (wl-summary-edit-addresses-collect-candidate-fields charset))) address pair result) @@ -4059,11 +4058,7 @@ If ARG, exit virtual folder." (elmo-msgdb-set-mark-alist msgdb mark-alist) (wl-summary-set-mark-modified)) (if (and visible wl-summary-highlight) - (wl-highlight-summary-current-line nil nil t)) - (if (not notcrosses) - (wl-summary-set-crosspost - wl-summary-buffer-elmo-folder - number))) + (wl-highlight-summary-current-line nil nil t))) (if mark (message "Warning: Changing mark failed."))))) (set-buffer-modified-p nil) (if stat @@ -4756,7 +4751,7 @@ Return t if message exists." (or user elmo-default-nntp-user) (or port elmo-default-nntp-port) (or type elmo-default-nntp-stream-type))) - (setq newsgroups (wl-parse-newsgroups ret)) + (setq newsgroups (elmo-nntp-parse-newsgroups ret)) (setq folder (concat "-" (car newsgroups) (elmo-nntp-folder-postfix user server port type))) (catch 'found @@ -5513,71 +5508,6 @@ Use function list is `wl-summary-write-current-folder-functions'." (wl-summary-set-message-buffer-or-redisplay) (wl-message-get-original-buffer))) -;; This function will be needless in the future. -;; (After when Newsgroups: field is saved in msgdb) -(defun wl-summary-get-newsgroups () - (let ((folder-list (elmo-folder-get-primitive-list - wl-summary-buffer-elmo-folder)) - ng-list) - (while folder-list - (when (eq (elmo-folder-type-internal (car folder-list)) 'nntp) - (wl-append ng-list (list (elmo-nntp-folder-group-internal - (car folder-list))))) - (setq folder-list (cdr folder-list))) - ng-list)) - -;; This function will be moved to elmo in the future. -;; (After when Newsgroups: field is saved in msgdb) -(defun wl-summary-set-crosspost (folder number) - (let (newsgroups) - (when (eq (elmo-folder-type-internal folder) 'nntp) - (with-current-buffer (wl-summary-get-original-buffer) - (setq newsgroups (std11-field-body "newsgroups"))) - (when newsgroups - (let* ((ng-list (wl-summary-get-newsgroups)) ;; for multi folder - crosspost-newsgroups) - (when (setq crosspost-newsgroups - (elmo-list-delete ng-list - (wl-parse-newsgroups newsgroups t))) - (elmo-crosspost-message-set - (elmo-message-field folder number 'message-id) - crosspost-newsgroups) - (setq wl-crosspost-alist-modified t))))))) - -(defun wl-summary-is-crosspost-folder (folder-list groups) - "Returns newsgroup string list of FOLDER-LIST which are contained in GROUPS." - (let (group crosses) - (while folder-list - (if (and (eq (elmo-folder-type-internal (car folder-list)) 'nntp) - (member (setq group (elmo-nntp-folder-group-internal - (car folder-list))) groups)) - (wl-append crosses (list group))) - (setq folder-list (cdr folder-list))) - crosses)) - -(defun wl-crosspost-alist-load () - (setq elmo-crosspost-message-alist (elmo-crosspost-alist-load)) - (setq wl-crosspost-alist-modified nil)) - -(defun wl-crosspost-alist-save () - (when wl-crosspost-alist-modified - ;; delete non-exists newsgroups - (let ((alist elmo-crosspost-message-alist) - newsgroups) - (while alist - (setq newsgroups - (elmo-delete-if - '(lambda (x) - (not (intern-soft x wl-folder-newsgroups-hashtb))) - (nth 1 (car alist)))) - (if newsgroups - (setcar (cdar alist) newsgroups) - (setq elmo-crosspost-message-alist - (delete (car alist) elmo-crosspost-message-alist))) - (setq alist (cdr alist))) - (elmo-crosspost-alist-save elmo-crosspost-message-alist) - (setq wl-crosspost-alist-modified nil)))) - (defun wl-summary-pack-number (&optional arg) (interactive "P") (elmo-folder-pack-numbers wl-summary-buffer-elmo-folder) diff --git a/wl/wl-util.el b/wl/wl-util.el index 95aa7b9..5fb51fe 100644 --- a/wl/wl-util.el +++ b/wl/wl-util.el @@ -57,14 +57,8 @@ (list 'nconc val func) (list 'setq val func))) -(defun wl-parse (string regexp &optional matchn) - (or matchn (setq matchn 1)) - (let (list) - (store-match-data nil) - (while (string-match regexp string (match-end 0)) - (setq list (cons (substring string (match-beginning matchn) - (match-end matchn)) list))) - (nreverse list))) +(defalias 'wl-parse 'elmo-parse) +(make-obsolete 'wl-parse 'elmo-parse) (defun wl-delete-duplicates (list &optional all hack-addresses) "Delete duplicate equivalent strings from the LIST. @@ -303,17 +297,6 @@ If HACK-ADDRESSES is t, then the strings are considered to be mail addresses, (defalias 'wl-string 'elmo-string) (make-obsolete 'wl-string 'elmo-string) -(defun wl-parse-newsgroups (string &optional subscribe-only) - (let* ((nglist (wl-parse string "[ \t\f\r\n,]*\\([^ \t\f\r\n,]+\\)")) - ret-val) - (if (not subscribe-only) - nglist - (while nglist - (if (intern-soft (car nglist) wl-folder-newsgroups-hashtb) - (wl-append ret-val (list (car nglist)))) - (setq nglist (cdr nglist))) - ret-val))) - ;; Check if active region exists or not. (if (boundp 'mark-active) (defmacro wl-region-exists-p () @@ -803,6 +786,8 @@ This function is imported from Emacs 20.7." (fset 'wl-biff-start 'ignore))) (defsubst wl-biff-notify (new-mails notify-minibuf) + (if (and (not wl-modeline-biff-status) (> new-mails 0)) + (run-hooks 'wl-biff-notify-hook)) (setq wl-modeline-biff-status (> new-mails 0)) (force-mode-line-update t) (when notify-minibuf diff --git a/wl/wl.el b/wl/wl.el index 11e9326..00342e4 100644 --- a/wl/wl.el +++ b/wl/wl.el @@ -628,7 +628,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (wl-refile-alist-save) (wl-folder-info-save) (and (featurep 'wl-fldmgr) (wl-fldmgr-exit)) - (wl-crosspost-alist-save) + (elmo-crosspost-message-alist-save) (message "Saving summary and folder status...done")) (defun wl-exit () @@ -667,7 +667,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'." (wl-address-init) (wl-draft-setup) (wl-refile-alist-setup) - (wl-crosspost-alist-load) + (elmo-crosspost-message-alist-load) (if wl-use-semi (progn (require 'wl-mime) -- 1.7.10.4