From: yamaoka Date: Fri, 16 Apr 2004 22:56:54 +0000 (+0000) Subject: Synch to No Gnus 200404161850. X-Git-Tag: t-gnus-6_17_4-quimby-~966 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=6d70ee5b48003576c48a0bd05d8ec225e741cac2;p=elisp%2Fgnus.git- Synch to No Gnus 200404161850. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9e09150..527e788 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,21 @@ +2004-04-16 Teodor Zlatanov + + * spam.el (spam-summary-prepare-exit): simplified logic + (spam-fetch-article-header): read the article header if it's not + available + (spam-list-articles): simplified logic + (spam-filelist-register-routine): found bug with unregister-list + + * gnus-registry.el: clarified comments at beginning + +2004-04-16 Jesper Harder + + * message.el (message-cater-to-broken-inn): Remove. + (message-shorten-references): Make the total folded length of + References is shorter than 998 characters to cater to a bug in INN + 2.3. Also, don't pretend that references aren't folded -- this + hasn't worked for a while. + 2004-04-15 Kevin Greiner * gnus-agent.el (gnus-agentize): diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el index 3fa2c88..bce7729 100644 --- a/lisp/gnus-registry.el +++ b/lisp/gnus-registry.el @@ -24,11 +24,11 @@ ;;; Commentary: -;; This is the gnus-registry.el package, works with other backends -;; besides nnmail. The major issue is that it doesn't go across -;; backends, so for instance if an article is in nnml:sys and you see -;; a reference to it in nnimap splitting, the article will end up in -;; nnimap:sys +;; This is the gnus-registry.el package, which works with all +;; backends, not just nnmail (e.g. NNTP). The major issue is that it +;; doesn't go across backends, so for instance if an article is in +;; nnml:sys and you see a reference to it in nnimap splitting, the +;; article will end up in nnimap:sys ;; gnus-registry.el intercepts article respooling, moving, deleting, ;; and copying for all backends. If it doesn't work correctly for diff --git a/lisp/message.el b/lisp/message.el index cb90c8c..f232b95 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -875,11 +875,6 @@ might set this variable to '(\"-f\" \"you@some.where\")." :type '(choice (function) (repeat string))) -(defvar message-cater-to-broken-inn t - "Non-nil means Gnus should not fold the `References' header. -Folding `References' makes ancient versions of INN create incorrect -NOV lines.") - (eval-when-compile (defvar gnus-post-method) (defvar gnus-select-method)) @@ -5787,8 +5782,9 @@ If the current line has `message-yank-prefix', insert it on the new line." (defun message-shorten-references (header references) "Trim REFERENCES to be 21 Message-ID long or less, and fold them. -If folding is disallowed, also check that the REFERENCES are less -than 988 characters long, and if they are not, trim them until they are." +When sending via news, also check that the REFERENCES are less +than 988 characters long, and if they are not, trim them until +they are." (let ((maxcount 21) (count 0) (cut 2) @@ -5810,33 +5806,25 @@ than 988 characters long, and if they are not, trim them until they are." (message-shorten-1 refs cut surplus) (decf count surplus))) - ;; If folding is disallowed, make sure the total length (including - ;; the spaces between) will be less than MAXSIZE characters. + ;; When sending via news, make sure the total folded length will + ;; be less than 998 characters. This is to cater to broken INN + ;; 2.3 which counts the total number of characters in a header + ;; rather than the physical line length of each line, as it shuld. ;; - ;; Only disallow folding for News messages. At this point the headers - ;; have not been generated, thus we use message-this-is-news directly. - (when (and message-this-is-news message-cater-to-broken-inn) - (let ((maxsize 988) - (totalsize (+ (apply #'+ (mapcar #'length refs)) - (1- count))) - (surplus 0) - (ptr (nthcdr (1- cut) refs))) - ;; Decide how many elements to cut off... - (while (> totalsize maxsize) - (decf totalsize (1+ (length (car ptr)))) - (incf surplus) - (setq ptr (cdr ptr))) - ;; ...and do it. - (when (> surplus 0) - (message-shorten-1 refs cut surplus)))) - + ;; This hack should be removed when it's believed than INN 2.3 is + ;; no longer widely used. + ;; + ;; At this point the headers have not been generated, thus we use + ;; message-this-is-news directly. + (when message-this-is-news + (while (< 998 + (with-temp-buffer + (message-fill-header header (mapconcat #'identity refs " ")) + (buffer-size))) + (message-shorten-1 refs cut 1))) ;; Finally, collect the references back into a string and insert ;; it into the buffer. - (let ((refstring (mapconcat #'identity refs " "))) - (if (and message-this-is-news message-cater-to-broken-inn) - (insert (capitalize (symbol-name header)) ": " - refstring "\n") - (message-fill-header header refstring))))) + (message-fill-header header (mapconcat #'identity refs " ")))) (defun message-position-point () "Move point to where the user probably wants to find it." diff --git a/lisp/spam.el b/lisp/spam.el index 5a566a5..82f30d7 100644 --- a/lisp/spam.el +++ b/lisp/spam.el @@ -744,10 +744,8 @@ Respects the process/prefix convention." (spam-group-processor-p gnus-newsgroup-name processor)) (spam-register-routine classification check)))) - (if spam-move-spam-nonspam-groups-only - (when (not (spam-group-spam-contents-p gnus-newsgroup-name)) - (spam-mark-spam-as-expired-and-move-routine - (gnus-parameter-spam-process-destination gnus-newsgroup-name))) + (unless (and spam-move-spam-nonspam-groups-only + (not (spam-group-spam-contents-p gnus-newsgroup-name))) (gnus-message 5 "Marking spam as expired and moving it to %s" gnus-newsgroup-name) (spam-mark-spam-as-expired-and-move-routine @@ -985,6 +983,7 @@ When either list is nil, the other is returned." (defun spam-fetch-article-header (article) (save-excursion (set-buffer gnus-summary-buffer) + (gnus-read-header article) (nth 3 (assq article gnus-newsgroup-data)))) @@ -1245,21 +1244,19 @@ functions") (let ((mark-check (if (eq classification 'spam) 'spam-group-spam-mark-p 'spam-group-ham-mark-p)) - list mark-cache-yes mark-cache-no) + alist mark-cache-yes mark-cache-no) (dolist (article articles) (let ((mark (gnus-summary-article-mark article))) - (unless (memq mark mark-cache-no) - (if (memq mark mark-cache-yes) - (push article list) - ;; else, we have to actually check the mark - (if (funcall mark-check - gnus-newsgroup-name - mark) - (progn - (push article list) - (push mark mark-cache-yes)) - (push mark mark-cache-no)))))) - list)) + (unless (or (memq mark mark-cache-yes) + (memq mark mark-cache-no)) + (if (funcall mark-check + gnus-newsgroup-name + mark) + (push mark mark-cache-yes) + (push mark mark-cache-no))) + (when (memq mark mark-cache-yes) + (push article alist)))) + alist)) (defun spam-register-routine (classification check @@ -1876,7 +1873,7 @@ REMOVE not nil, remove the ADDRESSES." (if blacklist 'spam-enter-blacklist 'spam-enter-whitelist)) (remove-function (if blacklist 'spam-enter-whitelist 'spam-enter-blacklist)) - from addresses unregister-list) + from addresses unregister-list article-unregister-list) (dolist (article articles) (let ((from (spam-fetch-field-from-fast article)) (id (spam-fetch-field-message-id-fast article)) @@ -1892,6 +1889,7 @@ REMOVE not nil, remove the ADDRESSES." (null unregister) (spam-log-unregistration-needed-p id 'process declassification de-symbol)) + (push article article-unregister-list) (push from unregister-list)) (unless sender-ignored (push from addresses))))) @@ -1900,7 +1898,7 @@ REMOVE not nil, remove the ADDRESSES." (funcall enter-function addresses t) ; unregister all these addresses ;; else, register normally and unregister what we need to (funcall remove-function unregister-list t) - (dolist (article unregister-list) + (dolist (article article-unregister-list) (spam-log-undo-registration (spam-fetch-field-message-id-fast article) 'process