From a2cfe8a3b8d2368a96951710c774e126c8283c10 Mon Sep 17 00:00:00 2001 From: Jan Tatarik Date: Fri, 16 Nov 2012 10:44:35 +0100 Subject: [PATCH] [Gnus] Don't score by headers when scoring by body * gnus-score.el (gnus-score-body): * gnus-logic.el (gnus-advanced-body): Don't score by headers when scoring by body. --- lisp/gnus/ChangeLog | 6 ++++++ lisp/gnus/gnus-logic.el | 13 +++++++------ lisp/gnus/gnus-score.el | 17 +++++++++-------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d1cf22fd971..55d11d4c6b1 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,9 @@ +2012-11-16 Jan Tatarik + + * gnus-score.el (gnus-score-body): + * gnus-logic.el (gnus-advanced-body): Don't score by headers when + scoring by body. + 2012-11-13 Glenn Morris * gnus-diary.el (nndiary-request-create-group-functions) diff --git a/lisp/gnus/gnus-logic.el b/lisp/gnus/gnus-logic.el index a440b779930..60d7b31713b 100644 --- a/lisp/gnus/gnus-logic.el +++ b/lisp/gnus/gnus-logic.el @@ -181,17 +181,18 @@ (with-current-buffer nntp-server-buffer (let* ((request-func (cond ((string= "head" header) 'gnus-request-head) - ;; We need to peek at the headers to detect the - ;; content encoding ((string= "body" header) - 'gnus-request-article) + 'gnus-request-body) (t 'gnus-request-article))) ofunc article handles) ;; Not all backends support partial fetching. In that case, we ;; just fetch the entire article. - (unless (gnus-check-backend-function - (intern (concat "request-" header)) - gnus-newsgroup-name) + ;; When scoring by body, we need to peek at the headers to detect the + ;; content encoding + (unless (or (gnus-check-backend-function + (intern (concat "request-" header)) + gnus-newsgroup-name) + (string= "body" header)) (setq ofunc request-func) (setq request-func 'gnus-request-article)) (setq article (mail-header-number gnus-advanced-headers)) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index f215b845514..b7061960839 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1762,21 +1762,22 @@ score in `gnus-newsgroup-scored' by SCORE." (all-scores scores) (request-func (cond ((string= "head" header) 'gnus-request-head) - ;; We need to peek at the headers to detect - ;; the content encoding ((string= "body" header) - 'gnus-request-article) + 'gnus-request-body) (t 'gnus-request-article))) entries alist ofunc article last) (when articles (setq last (mail-header-number (caar (last articles)))) ;; Not all backends support partial fetching. In that case, ;; we just fetch the entire article. - (unless (gnus-check-backend-function - (and (string-match "^gnus-" (symbol-name request-func)) - (intern (substring (symbol-name request-func) - (match-end 0)))) - gnus-newsgroup-name) + ;; When scoring by body, we need to peek at the headers to detect + ;; the content encoding + (unless (or (gnus-check-backend-function + (and (string-match "^gnus-" (symbol-name request-func)) + (intern (substring (symbol-name request-func) + (match-end 0)))) + gnus-newsgroup-name) + (string= "body" header)) (setq ofunc request-func) (setq request-func 'gnus-request-article)) (while articles -- 2.39.2