From 0f3cc6b1d71301ad28d75dd2adb38ff2d51a838c Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 16 May 2002 22:25:52 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 29 ++++++++++++++++++++++++----- lisp/gnus-sum.el | 12 ++++++++++-- lisp/nnbabyl.el | 4 ++-- lisp/nndiary.el | 2 +- lisp/nnfolder.el | 2 +- lisp/nnimap.el | 3 ++- lisp/nnmail.el | 46 ++++++++++++++++------------------------------ lisp/nnmbox.el | 2 +- lisp/nnmh.el | 2 +- texi/ChangeLog | 4 ++++ texi/gnus-ja.texi | 4 ++++ texi/gnus.texi | 4 ++++ 12 files changed, 70 insertions(+), 44 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c71e0c8..34430b4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,22 @@ +2002-05-16 Simon Josefsson + + * gnus-sum.el (gnus-simplify-all-whitespace): New function. + (gnus-simplify-subject-functions): Mention g-s-a-w. + +2002-05-15 Josh Huber + + * nnbabyl.el (nnbabyl-request-accept-article): Pass group to + nnmail-cache-insert. + * nndiary.el (nndiary-request-accept-article): Ditto. + * nnfolder.el (nnfolder-request-accept-article): Ditto. + * nnimap.el (nnimap-request-accept-article): Ditto. + * nnmail.el (nnmail-process-unix-mail-format): Ditto. + * nnmail.el (nnmail-check-duplication): Ditto. (from gnus-art) + * nnmbox.el (nnmbox-request-accept-article): Ditto. + * nnmh.el (nnmh-request-accept-article): Ditto. + * nnmail.el (nnmail-cache-insert): Change group to required, + removed code which tried to figure out the group. + 2002-05-13 Josh Huber * mml.el (mml-generate-mime-1): Fix mml generation for signed only @@ -11,7 +30,7 @@ 2002-05-08 Kai Gro,A_(Bjohann From Florian Weimer . - + * gnus.el (subscribed): New group parameter. (gnus-find-subscribed-addresses): Use it. @@ -160,12 +179,12 @@ Trivial change from Karl Pfl,Ad(Bsterer . 2002-04-27 Katsumi Yamaoka - + * dns.el (dns-make-network-process): New macro. (query-dns): Use it. 2002-04-27 ShengHuo ZHU - + * gnus-msg.el (gnus-summary-reply): Remove unbound variable article-buffer. @@ -191,7 +210,7 @@ problems. (nnkiboze-generate-group): Set newsrc to the *highest* article number kibozed, not the lowest. - + 2002-04-15 Jesper Harder * gnus-art.el (article-unsplit-urls): Allow trailing SPC. @@ -207,7 +226,7 @@ headers for message which are missing these headers. Get rid of spurious \\ lines (purely cosmetic). Extend body-end and file-end regexps, to exclude more garbage from the message. - Make URL rephrasing regexp more flexible, to match current + Make URL rephrasing regexp more flexible, to match current format. 2002-04-23 Simon Josefsson diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index 9cfd3a7..127c120 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -147,8 +147,9 @@ comparing subjects." "List of functions taking a string argument that simplify subjects. The functions are applied recursively. -Useful functions to put in this list include: `gnus-simplify-subject-re', -`gnus-simplify-subject-fuzzy' and `gnus-simplify-whitespace'." +Useful functions to put in this list include: +`gnus-simplify-subject-re', `gnus-simplify-subject-fuzzy', +`gnus-simplify-whitespace', and `gnus-simplify-all-whitespace'." :group 'gnus-thread :type '(repeat function)) @@ -1380,6 +1381,13 @@ buffers. For example: (setq mystr (substring mystr 0 (match-beginning 0)))) mystr)) +(defun gnus-simplify-all-whitespace (str) + "Remove all whitespace from STR." + (let ((mystr str)) + (while (string-match "[ \t\n]+" mystr) + (setq mystr (replace-match "" nil nil mystr))) + mystr)) + (defsubst gnus-simplify-subject-re (subject) "Remove \"Re:\" from subject lines." (if (string-match message-subject-re-regexp subject) diff --git a/lisp/nnbabyl.el b/lisp/nnbabyl.el index 78676fe..8cecb1e 100644 --- a/lisp/nnbabyl.el +++ b/lisp/nnbabyl.el @@ -350,7 +350,7 @@ (while (re-search-backward "^X-Gnus-Newsgroup: " beg t) (delete-region (point) (progn (forward-line 1) (point))))) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") group)) (setq result (if (stringp group) (list (cons group (nnbabyl-active-number group))) @@ -366,7 +366,7 @@ (insert-buffer-substring buf) (when last (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") group)) (save-buffer) (nnmail-save-active nnbabyl-group-alist nnbabyl-active-file)) result)))) diff --git a/lisp/nndiary.el b/lisp/nndiary.el index 45aac6c..b3b7cf3 100644 --- a/lisp/nndiary.el +++ b/lisp/nndiary.el @@ -759,7 +759,7 @@ all. This may very well take some time.") (when (nndiary-schedule) (let (result) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") group)) (if (stringp group) (and (nnmail-activate 'nndiary) diff --git a/lisp/nnfolder.el b/lisp/nnfolder.el index 591a0bd..876647f 100644 --- a/lisp/nnfolder.el +++ b/lisp/nnfolder.el @@ -491,7 +491,7 @@ the group. Then the marks file will be regenerated properly by Gnus.") (while (re-search-backward (concat "^" nnfolder-article-marker) nil t) (delete-region (point) (progn (forward-line 1) (point)))) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") group)) (setq result (if (stringp group) (list (cons group (nnfolder-active-number group))) (setq art-group diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 394aefc..268dee6 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -1384,7 +1384,8 @@ function is generally only called when Gnus is shutting down." (while (search-forward "\n" nil t) (replace-match "\r\n")) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id")))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") + group))) (when (and last nnmail-cache-accepted-message-ids) (nnmail-cache-close)) ;; this 'or' is for Cyrus server bug diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 07c2f79..311dc75 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -1457,37 +1457,23 @@ See the documentation for the variable `nnmail-split-fancy' for documentation." (defvar group) (defvar group-art-list) (defvar group-art) -(defun nnmail-cache-insert (id &optional grp) +(defun nnmail-cache-insert (id grp) (when nnmail-treat-duplicates ;; Store some information about the group this message is written - ;; to. This function might have been called from various places. - ;; Sometimes, a function up in the calling sequence has an - ;; argument GROUP which is bound to a string, the group name. At - ;; other times, there is a function up in the calling sequence - ;; which has an argument GROUP-ART which is a list of pairs, and - ;; the car of a pair is a group name. Should we check that the - ;; length of the list is equal to 1? -- kai - (let ((g nil)) - (cond (grp - (setq g grp)) - ((and (boundp 'group-art) group-art (listp group-art)) - (setq g (caar group-art))) - ((and (boundp 'group) group) - (setq g group)) - ((and (boundp 'group-art-list) group-art-list - (listp group-art-list)) - (setq g (caar group-art-list))) - (t (setq g ""))) - (unless (gnus-buffer-live-p nnmail-cache-buffer) - (nnmail-cache-open)) - (save-excursion - (set-buffer nnmail-cache-buffer) - (goto-char (point-max)) - (if (and g (not (string= "" g)) - (gnus-methods-equal-p gnus-command-method - (nnmail-cache-primary-mail-backend))) - (insert id "\t" g "\n") - (insert id "\n")))))) + ;; to. This is passed in as the grp argument -- all locations this + ;; has been called from have been checked and the group is available. + ;; The only ambiguous case is nnmail-check-duplication which will only + ;; pass the first (of possibly >1) group which matches. -Josh + (unless (gnus-buffer-live-p nnmail-cache-buffer) + (nnmail-cache-open)) + (save-excursion + (set-buffer nnmail-cache-buffer) + (goto-char (point-max)) + (if (and grp (not (string= "" grp)) + (gnus-methods-equal-p gnus-command-method + (nnmail-cache-primary-mail-backend))) + (insert id "\t" grp "\n") + (insert id "\n"))))) (defun nnmail-cache-primary-mail-backend () (let ((be-list (cons gnus-select-method gnus-secondary-select-methods)) @@ -1589,7 +1575,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." ((not duplication) (funcall func (setq group-art (nreverse (nnmail-article-group artnum-func)))) - (nnmail-cache-insert message-id)) + (nnmail-cache-insert message-id (caar group-art))) ((eq action 'delete) (setq group-art nil)) ((eq action 'warn) diff --git a/lisp/nnmbox.el b/lisp/nnmbox.el index 8157bec..33986cc 100644 --- a/lisp/nnmbox.el +++ b/lisp/nnmbox.el @@ -341,7 +341,7 @@ (while (re-search-backward "^X-Gnus-Newsgroup: " nil t) (delete-region (point) (progn (forward-line 1) (point)))) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") group)) (setq result (if (stringp group) (list (cons group (nnmbox-active-number group))) (nnmail-article-group 'nnmbox-active-number))) diff --git a/lisp/nnmh.el b/lisp/nnmh.el index 91fbcc0..e814774 100644 --- a/lisp/nnmh.el +++ b/lisp/nnmh.el @@ -325,7 +325,7 @@ as unread by Gnus.") (not (equal group "draft"))) (nnmail-check-syntax)) (when nnmail-cache-accepted-message-ids - (nnmail-cache-insert (nnmail-fetch-field "message-id"))) + (nnmail-cache-insert (nnmail-fetch-field "message-id") group)) (nnheader-init-server-buffer) (prog1 (if (stringp group) diff --git a/texi/ChangeLog b/texi/ChangeLog index 11b6a6e..95b2b0e 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,7 @@ +2002-05-16 Simon Josefsson + + * gnus.texi (Loose Threads): Add gnus-simplify-all-whitespace. + 2002-05-08 Kai Gro,A_(Bjohann * gnus.texi (Mail-To-News Gateways): The default diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 923d2d7..54420a8 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -6240,6 +6240,10 @@ Gnus $B$OJ,$J6uGr(B (whitespace) $B$r