diff options
| author | Dave Love | 2000-11-08 20:52:08 +0000 |
|---|---|---|
| committer | Dave Love | 2000-11-08 20:52:08 +0000 |
| commit | 59896c4c630b94f9d270bc72db4f6217a6986a7d (patch) | |
| tree | de8956570fe70f7cc1a0df81ef13d20db861ad57 | |
| parent | 9db2706e22fb343001f2467c8f58e5f5d70d525e (diff) | |
| download | emacs-59896c4c630b94f9d270bc72db4f6217a6986a7d.tar.gz emacs-59896c4c630b94f9d270bc72db4f6217a6986a7d.zip | |
(gnus-score-load-file): Use expand-file-name.
(gnus-score-find-bnews): Don't concat "".
2000-10-07 09:18:53 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-score.el (gnus-score-body): Don't score body when
agent-fetching.
(gnus-score-followup): Don't score followup either.
2000-09-21 16:15:25 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-score.el (gnus-score-use-all-scores): New variable.
(gnus-all-score-files): Use it.
2000-09-20 18:33:00 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-score.el (gnus-score-find-bnews): Use directory-sep-char.
| -rw-r--r-- | lisp/gnus/ChangeLog | 12 | ||||
| -rw-r--r-- | lisp/gnus/gnus-score.el | 437 |
2 files changed, 236 insertions, 213 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 259bb4ac819..cc5446d2dca 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,5 +1,17 @@ | |||
| 1 | 2000-11-08 ShengHuo ZHU <zsh@cs.rochester.edu> | ||
| 2 | |||
| 3 | * gnus-score.el (gnus-score-body): Don't score body when | ||
| 4 | agent-fetching. | ||
| 5 | (gnus-score-followup): Don't score followup either. | ||
| 6 | (gnus-score-use-all-scores): New variable. | ||
| 7 | (gnus-all-score-files): Use it. | ||
| 8 | (gnus-score-find-bnews): Use directory-sep-char. | ||
| 9 | |||
| 1 | 2000-11-08 Dave Love <fx@gnu.org> | 10 | 2000-11-08 Dave Love <fx@gnu.org> |
| 2 | 11 | ||
| 12 | * gnus-score.el (gnus-score-load-file): Use expand-file-name. | ||
| 13 | (gnus-score-find-bnews): Don't concat "". | ||
| 14 | |||
| 3 | * cu-exit.xpm, prev-ur.xpm, next-ur.xpm, post.xpm, fuwo.xpm: | 15 | * cu-exit.xpm, prev-ur.xpm, next-ur.xpm, post.xpm, fuwo.xpm: |
| 4 | * followup.xpm, uu-post.xpm, uu-decode.xpm, mail-reply.xpm: | 16 | * followup.xpm, uu-post.xpm, uu-decode.xpm, mail-reply.xpm: |
| 5 | * reply.xpm, reply-wo.xpm, rot13.xpm, save-aif.xpm, save-art.xpm: | 17 | * reply.xpm, reply-wo.xpm, rot13.xpm, save-aif.xpm, save-art.xpm: |
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index 57c001e39d7..c6ddb5bf1fd 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el | |||
| @@ -395,6 +395,9 @@ If nil, the user will be asked for a duration." | |||
| 395 | 395 | ||
| 396 | ;; Internal variables. | 396 | ;; Internal variables. |
| 397 | 397 | ||
| 398 | (defvar gnus-score-use-all-scores t | ||
| 399 | "If nil, only `gnus-score-find-score-files-function' is used.") | ||
| 400 | |||
| 398 | (defvar gnus-adaptive-word-syntax-table | 401 | (defvar gnus-adaptive-word-syntax-table |
| 399 | (let ((table (copy-syntax-table (standard-syntax-table))) | 402 | (let ((table (copy-syntax-table (standard-syntax-table))) |
| 400 | (numbers '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))) | 403 | (numbers '(?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9))) |
| @@ -1099,8 +1102,7 @@ EXTRA is the possible non-standard header." | |||
| 1099 | gnus-kill-files-directory))) | 1102 | gnus-kill-files-directory))) |
| 1100 | (expand-file-name file)) | 1103 | (expand-file-name file)) |
| 1101 | file) | 1104 | file) |
| 1102 | (concat (file-name-as-directory gnus-kill-files-directory) | 1105 | (expand-file-name file gnus-kill-files-directory)))) |
| 1103 | file)))) | ||
| 1104 | (cached (assoc file gnus-score-cache)) | 1106 | (cached (assoc file gnus-score-cache)) |
| 1105 | (global (member file gnus-internal-global-score-files)) | 1107 | (global (member file gnus-internal-global-score-files)) |
| 1106 | lists alist) | 1108 | lists alist) |
| @@ -1636,204 +1638,211 @@ score in GNUS-NEWSGROUP-SCORED by SCORE." | |||
| 1636 | nil) | 1638 | nil) |
| 1637 | 1639 | ||
| 1638 | (defun gnus-score-body (scores header now expire &optional trace) | 1640 | (defun gnus-score-body (scores header now expire &optional trace) |
| 1639 | (save-excursion | 1641 | (if gnus-agent-fetching |
| 1640 | (setq gnus-scores-articles | 1642 | nil |
| 1641 | (sort gnus-scores-articles | 1643 | (save-excursion |
| 1642 | (lambda (a1 a2) | 1644 | (setq gnus-scores-articles |
| 1643 | (< (mail-header-number (car a1)) | 1645 | (sort gnus-scores-articles |
| 1644 | (mail-header-number (car a2)))))) | 1646 | (lambda (a1 a2) |
| 1645 | (set-buffer nntp-server-buffer) | 1647 | (< (mail-header-number (car a1)) |
| 1646 | (save-restriction | 1648 | (mail-header-number (car a2)))))) |
| 1647 | (let* ((buffer-read-only nil) | 1649 | (set-buffer nntp-server-buffer) |
| 1648 | (articles gnus-scores-articles) | 1650 | (save-restriction |
| 1649 | (all-scores scores) | 1651 | (let* ((buffer-read-only nil) |
| 1650 | (request-func (cond ((string= "head" header) | 1652 | (articles gnus-scores-articles) |
| 1651 | 'gnus-request-head) | 1653 | (all-scores scores) |
| 1652 | ((string= "body" header) | 1654 | (request-func (cond ((string= "head" header) |
| 1653 | 'gnus-request-body) | 1655 | 'gnus-request-head) |
| 1654 | (t 'gnus-request-article))) | 1656 | ((string= "body" header) |
| 1655 | entries alist ofunc article last) | 1657 | 'gnus-request-body) |
| 1656 | (when articles | 1658 | (t 'gnus-request-article))) |
| 1657 | (setq last (mail-header-number (caar (last articles)))) | 1659 | entries alist ofunc article last) |
| 1660 | (when articles | ||
| 1661 | (setq last (mail-header-number (caar (last articles)))) | ||
| 1658 | ;; Not all backends support partial fetching. In that case, | 1662 | ;; Not all backends support partial fetching. In that case, |
| 1659 | ;; we just fetch the entire article. | 1663 | ;; we just fetch the entire article. |
| 1660 | (unless (gnus-check-backend-function | 1664 | (unless (gnus-check-backend-function |
| 1661 | (and (string-match "^gnus-" (symbol-name request-func)) | 1665 | (and (string-match "^gnus-" (symbol-name request-func)) |
| 1662 | (intern (substring (symbol-name request-func) | 1666 | (intern (substring (symbol-name request-func) |
| 1663 | (match-end 0)))) | 1667 | (match-end 0)))) |
| 1664 | gnus-newsgroup-name) | 1668 | gnus-newsgroup-name) |
| 1665 | (setq ofunc request-func) | 1669 | (setq ofunc request-func) |
| 1666 | (setq request-func 'gnus-request-article)) | 1670 | (setq request-func 'gnus-request-article)) |
| 1667 | (while articles | 1671 | (while articles |
| 1668 | (setq article (mail-header-number (caar articles))) | 1672 | (setq article (mail-header-number (caar articles))) |
| 1669 | (gnus-message 7 "Scoring article %s of %s..." article last) | 1673 | (gnus-message 7 "Scoring article %s of %s..." article last) |
| 1670 | (widen) | 1674 | (widen) |
| 1671 | (when (funcall request-func article gnus-newsgroup-name) | 1675 | (when (funcall request-func article gnus-newsgroup-name) |
| 1672 | (goto-char (point-min)) | 1676 | (goto-char (point-min)) |
| 1673 | ;; If just parts of the article is to be searched, but the | 1677 | ;; If just parts of the article is to be searched, but the |
| 1674 | ;; backend didn't support partial fetching, we just narrow | 1678 | ;; backend didn't support partial fetching, we just narrow |
| 1675 | ;; to the relevant parts. | 1679 | ;; to the relevant parts. |
| 1676 | (when ofunc | 1680 | (when ofunc |
| 1677 | (if (eq ofunc 'gnus-request-head) | 1681 | (if (eq ofunc 'gnus-request-head) |
| 1682 | (narrow-to-region | ||
| 1683 | (point) | ||
| 1684 | (or (search-forward "\n\n" nil t) (point-max))) | ||
| 1678 | (narrow-to-region | 1685 | (narrow-to-region |
| 1679 | (point) | 1686 | (or (search-forward "\n\n" nil t) (point)) |
| 1680 | (or (search-forward "\n\n" nil t) (point-max))) | 1687 | (point-max)))) |
| 1681 | (narrow-to-region | 1688 | (setq scores all-scores) |
| 1682 | (or (search-forward "\n\n" nil t) (point)) | 1689 | ;; Find matches. |
| 1683 | (point-max)))) | 1690 | (while scores |
| 1684 | (setq scores all-scores) | 1691 | (setq alist (pop scores) |
| 1685 | ;; Find matches. | 1692 | entries (assoc header alist)) |
| 1686 | (while scores | 1693 | (while (cdr entries) ;First entry is the header index. |
| 1687 | (setq alist (pop scores) | 1694 | (let* ((rest (cdr entries)) |
| 1688 | entries (assoc header alist)) | 1695 | (kill (car rest)) |
| 1689 | (while (cdr entries) ;First entry is the header index. | 1696 | (match (nth 0 kill)) |
| 1690 | (let* ((rest (cdr entries)) | 1697 | (type (or (nth 3 kill) 's)) |
| 1691 | (kill (car rest)) | 1698 | (score (or (nth 1 kill) |
| 1692 | (match (nth 0 kill)) | 1699 | gnus-score-interactive-default-score)) |
| 1693 | (type (or (nth 3 kill) 's)) | 1700 | (date (nth 2 kill)) |
| 1694 | (score (or (nth 1 kill) | 1701 | (found nil) |
| 1695 | gnus-score-interactive-default-score)) | 1702 | (case-fold-search |
| 1696 | (date (nth 2 kill)) | 1703 | (not (or (eq type 'R) (eq type 'S) |
| 1697 | (found nil) | 1704 | (eq type 'Regexp) (eq type 'String)))) |
| 1698 | (case-fold-search | 1705 | (search-func |
| 1699 | (not (or (eq type 'R) (eq type 'S) | 1706 | (cond ((or (eq type 'r) (eq type 'R) |
| 1700 | (eq type 'Regexp) (eq type 'String)))) | 1707 | (eq type 'regexp) (eq type 'Regexp)) |
| 1701 | (search-func | 1708 | 're-search-forward) |
| 1702 | (cond ((or (eq type 'r) (eq type 'R) | 1709 | ((or (eq type 's) (eq type 'S) |
| 1703 | (eq type 'regexp) (eq type 'Regexp)) | 1710 | (eq type 'string) (eq type 'String)) |
| 1704 | 're-search-forward) | 1711 | 'search-forward) |
| 1705 | ((or (eq type 's) (eq type 'S) | 1712 | (t |
| 1706 | (eq type 'string) (eq type 'String)) | 1713 | (error "Invalid match type: %s" type))))) |
| 1707 | 'search-forward) | 1714 | (goto-char (point-min)) |
| 1708 | (t | 1715 | (when (funcall search-func match nil t) |
| 1709 | (error "Invalid match type: %s" type))))) | 1716 | ;; Found a match, update scores. |
| 1710 | (goto-char (point-min)) | 1717 | (setcdr (car articles) (+ score (cdar articles))) |
| 1711 | (when (funcall search-func match nil t) | 1718 | (setq found t) |
| 1712 | ;; Found a match, update scores. | 1719 | (when trace |
| 1713 | (setcdr (car articles) (+ score (cdar articles))) | 1720 | (push |
| 1714 | (setq found t) | 1721 | (cons (car-safe (rassq alist gnus-score-cache)) kill) |
| 1715 | (when trace | 1722 | gnus-score-trace))) |
| 1716 | (push | 1723 | ;; Update expire date |
| 1717 | (cons (car-safe (rassq alist gnus-score-cache)) kill) | 1724 | (unless trace |
| 1718 | gnus-score-trace))) | 1725 | (cond |
| 1719 | ;; Update expire date | 1726 | ((null date)) ;Permanent entry. |
| 1720 | (unless trace | 1727 | ((and found gnus-update-score-entry-dates) |
| 1721 | (cond | 1728 | ;; Match, update date. |
| 1722 | ((null date)) ;Permanent entry. | 1729 | (gnus-score-set 'touched '(t) alist) |
| 1723 | ((and found gnus-update-score-entry-dates) | 1730 | (setcar (nthcdr 2 kill) now)) |
| 1724 | ;; Match, update date. | 1731 | ((and expire (< date expire)) ;Old entry, remove. |
| 1725 | (gnus-score-set 'touched '(t) alist) | 1732 | (gnus-score-set 'touched '(t) alist) |
| 1726 | (setcar (nthcdr 2 kill) now)) | 1733 | (setcdr entries (cdr rest)) |
| 1727 | ((and expire (< date expire)) ;Old entry, remove. | 1734 | (setq rest entries)))) |
| 1728 | (gnus-score-set 'touched '(t) alist) | 1735 | (setq entries rest))))) |
| 1729 | (setcdr entries (cdr rest)) | 1736 | (setq articles (cdr articles))))))) |
| 1730 | (setq rest entries)))) | 1737 | nil)) |
| 1731 | (setq entries rest))))) | ||
| 1732 | (setq articles (cdr articles))))))) | ||
| 1733 | nil) | ||
| 1734 | 1738 | ||
| 1735 | (defun gnus-score-thread (scores header now expire &optional trace) | 1739 | (defun gnus-score-thread (scores header now expire &optional trace) |
| 1736 | (gnus-score-followup scores header now expire trace t)) | 1740 | (gnus-score-followup scores header now expire trace t)) |
| 1737 | 1741 | ||
| 1738 | (defun gnus-score-followup (scores header now expire &optional trace thread) | 1742 | (defun gnus-score-followup (scores header now expire &optional trace thread) |
| 1739 | ;; Insert the unique article headers in the buffer. | 1743 | (if gnus-agent-fetching |
| 1740 | (let ((gnus-score-index (nth 1 (assoc header gnus-header-index))) | 1744 | ;; FIXME: It seems doable in fetching mode. |
| 1741 | (current-score-file gnus-current-score-file) | 1745 | nil |
| 1742 | (all-scores scores) | 1746 | ;; Insert the unique article headers in the buffer. |
| 1743 | ;; gnus-score-index is used as a free variable. | 1747 | (let ((gnus-score-index (nth 1 (assoc header gnus-header-index))) |
| 1744 | alike last this art entries alist articles | 1748 | (current-score-file gnus-current-score-file) |
| 1745 | new news) | 1749 | (all-scores scores) |
| 1746 | 1750 | ;; gnus-score-index is used as a free variable. | |
| 1747 | ;; Change score file to the adaptive score file. All entries that | 1751 | alike last this art entries alist articles |
| 1748 | ;; this function makes will be put into this file. | 1752 | new news) |
| 1749 | (save-excursion | 1753 | |
| 1750 | (set-buffer gnus-summary-buffer) | 1754 | ;; Change score file to the adaptive score file. All entries that |
| 1751 | (gnus-score-load-file | 1755 | ;; this function makes will be put into this file. |
| 1752 | (or gnus-newsgroup-adaptive-score-file | 1756 | (save-excursion |
| 1753 | (gnus-score-file-name | 1757 | (set-buffer gnus-summary-buffer) |
| 1754 | gnus-newsgroup-name gnus-adaptive-file-suffix)))) | 1758 | (gnus-score-load-file |
| 1759 | (or gnus-newsgroup-adaptive-score-file | ||
| 1760 | (gnus-score-file-name | ||
| 1761 | gnus-newsgroup-name gnus-adaptive-file-suffix)))) | ||
| 1755 | 1762 | ||
| 1756 | (setq gnus-scores-articles (sort gnus-scores-articles 'gnus-score-string<) | 1763 | (setq gnus-scores-articles (sort gnus-scores-articles |
| 1757 | articles gnus-scores-articles) | 1764 | 'gnus-score-string<) |
| 1765 | articles gnus-scores-articles) | ||
| 1758 | 1766 | ||
| 1759 | (erase-buffer) | 1767 | (erase-buffer) |
| 1760 | (while articles | 1768 | (while articles |
| 1761 | (setq art (car articles) | 1769 | (setq art (car articles) |
| 1762 | this (aref (car art) gnus-score-index) | 1770 | this (aref (car art) gnus-score-index) |
| 1763 | articles (cdr articles)) | 1771 | articles (cdr articles)) |
| 1764 | (if (equal last this) | 1772 | (if (equal last this) |
| 1765 | (push art alike) | 1773 | (push art alike) |
| 1766 | (when last | 1774 | (when last |
| 1767 | (insert last ?\n) | 1775 | (insert last ?\n) |
| 1768 | (put-text-property (1- (point)) (point) 'articles alike)) | 1776 | (put-text-property (1- (point)) (point) 'articles alike)) |
| 1769 | (setq alike (list art) | 1777 | (setq alike (list art) |
| 1770 | last this))) | 1778 | last this))) |
| 1771 | (when last ; Bwadr, duplicate code. | 1779 | (when last ; Bwadr, duplicate code. |
| 1772 | (insert last ?\n) | 1780 | (insert last ?\n) |
| 1773 | (put-text-property (1- (point)) (point) 'articles alike)) | 1781 | (put-text-property (1- (point)) (point) 'articles alike)) |
| 1774 | 1782 | ||
| 1775 | ;; Find matches. | 1783 | ;; Find matches. |
| 1776 | (while scores | 1784 | (while scores |
| 1777 | (setq alist (car scores) | 1785 | (setq alist (car scores) |
| 1778 | scores (cdr scores) | 1786 | scores (cdr scores) |
| 1779 | entries (assoc header alist)) | 1787 | entries (assoc header alist)) |
| 1780 | (while (cdr entries) ;First entry is the header index. | 1788 | (while (cdr entries) ;First entry is the header index. |
| 1781 | (let* ((rest (cdr entries)) | 1789 | (let* ((rest (cdr entries)) |
| 1782 | (kill (car rest)) | 1790 | (kill (car rest)) |
| 1783 | (match (nth 0 kill)) | 1791 | (match (nth 0 kill)) |
| 1784 | (type (or (nth 3 kill) 's)) | 1792 | (type (or (nth 3 kill) 's)) |
| 1785 | (score (or (nth 1 kill) gnus-score-interactive-default-score)) | 1793 | (score (or (nth 1 kill) gnus-score-interactive-default-score)) |
| 1786 | (date (nth 2 kill)) | 1794 | (date (nth 2 kill)) |
| 1787 | (found nil) | 1795 | (found nil) |
| 1788 | (mt (aref (symbol-name type) 0)) | 1796 | (mt (aref (symbol-name type) 0)) |
| 1789 | (case-fold-search | 1797 | (case-fold-search |
| 1790 | (not (or (= mt ?R) (= mt ?S) (= mt ?E) (= mt ?F)))) | 1798 | (not (or (= mt ?R) (= mt ?S) (= mt ?E) (= mt ?F)))) |
| 1791 | (dmt (downcase mt)) | 1799 | (dmt (downcase mt)) |
| 1792 | (search-func | 1800 | (search-func |
| 1793 | (cond ((= dmt ?r) 're-search-forward) | 1801 | (cond ((= dmt ?r) 're-search-forward) |
| 1794 | ((or (= dmt ?e) (= dmt ?s) (= dmt ?f)) 'search-forward) | 1802 | ((or (= dmt ?e) (= dmt ?s) (= dmt ?f)) 'search-forward) |
| 1795 | (t (error "Invalid match type: %s" type)))) | 1803 | (t (error "Invalid match type: %s" type)))) |
| 1796 | arts art) | 1804 | arts art) |
| 1797 | (goto-char (point-min)) | 1805 | (goto-char (point-min)) |
| 1798 | (if (= dmt ?e) | 1806 | (if (= dmt ?e) |
| 1807 | (while (funcall search-func match nil t) | ||
| 1808 | (and (= (progn (beginning-of-line) (point)) | ||
| 1809 | (match-beginning 0)) | ||
| 1810 | (= (progn (end-of-line) (point)) | ||
| 1811 | (match-end 0)) | ||
| 1812 | (progn | ||
| 1813 | (setq found (setq arts (get-text-property | ||
| 1814 | (point) 'articles))) | ||
| 1815 | ;; Found a match, update scores. | ||
| 1816 | (while arts | ||
| 1817 | (setq art (car arts) | ||
| 1818 | arts (cdr arts)) | ||
| 1819 | (gnus-score-add-followups | ||
| 1820 | (car art) score all-scores thread)))) | ||
| 1821 | (end-of-line)) | ||
| 1799 | (while (funcall search-func match nil t) | 1822 | (while (funcall search-func match nil t) |
| 1800 | (and (= (progn (beginning-of-line) (point)) | 1823 | (end-of-line) |
| 1801 | (match-beginning 0)) | 1824 | (setq found (setq arts (get-text-property (point) 'articles))) |
| 1802 | (= (progn (end-of-line) (point)) | 1825 | ;; Found a match, update scores. |
| 1803 | (match-end 0)) | 1826 | (while (setq art (pop arts)) |
| 1804 | (progn | 1827 | (when (setq new (gnus-score-add-followups |
| 1805 | (setq found (setq arts (get-text-property | 1828 | (car art) score all-scores thread)) |
| 1806 | (point) 'articles))) | 1829 | (push new news))))) |
| 1807 | ;; Found a match, update scores. | 1830 | ;; Update expire date |
| 1808 | (while arts | 1831 | (cond ((null date)) ;Permanent entry. |
| 1809 | (setq art (car arts) | 1832 | ((and found gnus-update-score-entry-dates) |
| 1810 | arts (cdr arts)) | 1833 | ;Match, update date. |
| 1811 | (gnus-score-add-followups | 1834 | (gnus-score-set 'touched '(t) alist) |
| 1812 | (car art) score all-scores thread)))) | 1835 | (setcar (nthcdr 2 kill) now)) |
| 1813 | (end-of-line)) | 1836 | ((and expire (< date expire)) ;Old entry, remove. |
| 1814 | (while (funcall search-func match nil t) | 1837 | (gnus-score-set 'touched '(t) alist) |
| 1815 | (end-of-line) | 1838 | (setcdr entries (cdr rest)) |
| 1816 | (setq found (setq arts (get-text-property (point) 'articles))) | 1839 | (setq rest entries))) |
| 1817 | ;; Found a match, update scores. | 1840 | (setq entries rest)))) |
| 1818 | (while (setq art (pop arts)) | 1841 | ;; We change the score file back to the previous one. |
| 1819 | (when (setq new (gnus-score-add-followups | 1842 | (save-excursion |
| 1820 | (car art) score all-scores thread)) | 1843 | (set-buffer gnus-summary-buffer) |
| 1821 | (push new news))))) | 1844 | (gnus-score-load-file current-score-file)) |
| 1822 | ;; Update expire date | 1845 | (list (cons "references" news))))) |
| 1823 | (cond ((null date)) ;Permanent entry. | ||
| 1824 | ((and found gnus-update-score-entry-dates) ;Match, update date. | ||
| 1825 | (gnus-score-set 'touched '(t) alist) | ||
| 1826 | (setcar (nthcdr 2 kill) now)) | ||
| 1827 | ((and expire (< date expire)) ;Old entry, remove. | ||
| 1828 | (gnus-score-set 'touched '(t) alist) | ||
| 1829 | (setcdr entries (cdr rest)) | ||
| 1830 | (setq rest entries))) | ||
| 1831 | (setq entries rest)))) | ||
| 1832 | ;; We change the score file back to the previous one. | ||
| 1833 | (save-excursion | ||
| 1834 | (set-buffer gnus-summary-buffer) | ||
| 1835 | (gnus-score-load-file current-score-file)) | ||
| 1836 | (list (cons "references" news)))) | ||
| 1837 | 1846 | ||
| 1838 | (defun gnus-score-add-followups (header score scores &optional thread) | 1847 | (defun gnus-score-add-followups (header score scores &optional thread) |
| 1839 | "Add a score entry to the adapt file." | 1848 | "Add a score entry to the adapt file." |
| @@ -2551,12 +2560,12 @@ GROUP using BNews sys file syntax." | |||
| 2551 | ;; too much. | 2560 | ;; too much. |
| 2552 | (delete-char (min (1- (point-max)) klen)) | 2561 | (delete-char (min (1- (point-max)) klen)) |
| 2553 | (goto-char (point-max)) | 2562 | (goto-char (point-max)) |
| 2554 | (search-backward "/") | 2563 | (search-backward (string directory-sep-char)) |
| 2555 | (delete-region (1+ (point)) (point-min))) | 2564 | (delete-region (1+ (point)) (point-min))) |
| 2556 | ;; If short file names were used, we have to translate slashes. | 2565 | ;; If short file names were used, we have to translate slashes. |
| 2557 | (goto-char (point-min)) | 2566 | (goto-char (point-min)) |
| 2558 | (let ((regexp (concat | 2567 | (let ((regexp (concat |
| 2559 | "[/:" (if trans (char-to-string trans) "") "]"))) | 2568 | "[/:" (if trans (char-to-string trans)) "]"))) |
| 2560 | (while (re-search-forward regexp nil t) | 2569 | (while (re-search-forward regexp nil t) |
| 2561 | (replace-match "." t t))) | 2570 | (replace-match "." t t))) |
| 2562 | ;; Kludge to get rid of "nntp+" problems. | 2571 | ;; Kludge to get rid of "nntp+" problems. |
| @@ -2707,19 +2716,20 @@ The list is determined from the variable gnus-score-file-alist." | |||
| 2707 | (and funcs | 2716 | (and funcs |
| 2708 | (not (listp funcs)) | 2717 | (not (listp funcs)) |
| 2709 | (setq funcs (list funcs))) | 2718 | (setq funcs (list funcs))) |
| 2710 | ;; Get the initial score files for this group. | 2719 | (when gnus-score-use-all-scores |
| 2711 | (when funcs | 2720 | ;; Get the initial score files for this group. |
| 2712 | (setq score-files (nreverse (gnus-score-find-alist group)))) | 2721 | (when funcs |
| 2713 | ;; Add any home adapt files. | 2722 | (setq score-files (nreverse (gnus-score-find-alist group)))) |
| 2714 | (let ((home (gnus-home-score-file group t))) | 2723 | ;; Add any home adapt files. |
| 2715 | (when home | 2724 | (let ((home (gnus-home-score-file group t))) |
| 2716 | (push home score-files) | 2725 | (when home |
| 2717 | (setq gnus-newsgroup-adaptive-score-file home))) | 2726 | (push home score-files) |
| 2718 | ;; Check whether there is a `adapt-file' group parameter. | 2727 | (setq gnus-newsgroup-adaptive-score-file home))) |
| 2719 | (let ((param-file (gnus-group-find-parameter group 'adapt-file))) | 2728 | ;; Check whether there is a `adapt-file' group parameter. |
| 2720 | (when param-file | 2729 | (let ((param-file (gnus-group-find-parameter group 'adapt-file))) |
| 2721 | (push param-file score-files) | 2730 | (when param-file |
| 2722 | (setq gnus-newsgroup-adaptive-score-file param-file))) | 2731 | (push param-file score-files) |
| 2732 | (setq gnus-newsgroup-adaptive-score-file param-file)))) | ||
| 2723 | ;; Go through all the functions for finding score files (or actual | 2733 | ;; Go through all the functions for finding score files (or actual |
| 2724 | ;; scores) and add them to a list. | 2734 | ;; scores) and add them to a list. |
| 2725 | (while funcs | 2735 | (while funcs |
| @@ -2727,14 +2737,15 @@ The list is determined from the variable gnus-score-file-alist." | |||
| 2727 | (setq score-files | 2737 | (setq score-files |
| 2728 | (nconc score-files (nreverse (funcall (car funcs) group))))) | 2738 | (nconc score-files (nreverse (funcall (car funcs) group))))) |
| 2729 | (setq funcs (cdr funcs))) | 2739 | (setq funcs (cdr funcs))) |
| 2730 | ;; Add any home score files. | 2740 | (when gnus-score-use-all-scores |
| 2731 | (let ((home (gnus-home-score-file group))) | 2741 | ;; Add any home score files. |
| 2732 | (when home | 2742 | (let ((home (gnus-home-score-file group))) |
| 2733 | (push home score-files))) | 2743 | (when home |
| 2734 | ;; Check whether there is a `score-file' group parameter. | 2744 | (push home score-files))) |
| 2735 | (let ((param-file (gnus-group-find-parameter group 'score-file))) | 2745 | ;; Check whether there is a `score-file' group parameter. |
| 2736 | (when param-file | 2746 | (let ((param-file (gnus-group-find-parameter group 'score-file))) |
| 2737 | (push param-file score-files))) | 2747 | (when param-file |
| 2748 | (push param-file score-files)))) | ||
| 2738 | ;; Expand all files names. | 2749 | ;; Expand all files names. |
| 2739 | (let ((files score-files)) | 2750 | (let ((files score-files)) |
| 2740 | (while files | 2751 | (while files |