summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-score.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/gnus-score.el')
-rw-r--r--lisp/gnus/gnus-score.el54
1 files changed, 25 insertions, 29 deletions
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index ef096fe7684..b7360a0f22c 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -29,6 +29,7 @@
(require 'gnus)
(require 'gnus-sum)
+(require 'gnus-art)
(require 'gnus-range)
(require 'gnus-win)
(require 'message)
@@ -126,26 +127,26 @@ the `a' symbolic prefix to the score commands will always use
(function :tag "Other" :value 'ignore)))
(defcustom gnus-score-interactive-default-score 1000
- "*Scoring commands will raise/lower the score with this number as the default."
+ "Scoring commands will raise/lower the score with this number as the default."
:group 'gnus-score-default
:type 'integer)
(defcustom gnus-score-expiry-days 7
- "*Number of days before unused score file entries are expired.
+ "Number of days before unused score file entries are expired.
If this variable is nil, no score file entries will be expired."
:group 'gnus-score-expire
:type '(choice (const :tag "never" nil)
number))
(defcustom gnus-update-score-entry-dates t
- "*If non-nil, update matching score entry dates.
+ "If non-nil, update matching score entry dates.
If this variable is nil, then score entries that provide matches
will be expired along with non-matching score entries."
:group 'gnus-score-expire
:type 'boolean)
(defcustom gnus-decay-scores nil
- "*If non-nil, decay non-permanent scores.
+ "If non-nil, decay non-permanent scores.
If it is a regexp, only decay score files matching regexp."
:group 'gnus-score-decay
@@ -156,19 +157,19 @@ If it is a regexp, only decay score files matching regexp."
(regexp)))
(defcustom gnus-decay-score-function 'gnus-decay-score
- "*Function called to decay a score.
+ "Function called to decay a score.
It is called with one parameter -- the score to be decayed."
:group 'gnus-score-decay
:type '(radio (function-item gnus-decay-score)
(function :tag "Other")))
(defcustom gnus-score-decay-constant 3
- "*Decay all \"small\" scores with this amount."
+ "Decay all \"small\" scores with this amount."
:group 'gnus-score-decay
:type 'integer)
(defcustom gnus-score-decay-scale .05
- "*Decay all \"big\" scores with this factor."
+ "Decay all \"big\" scores with this factor."
:group 'gnus-score-decay
:type 'number)
@@ -248,7 +249,7 @@ If you use score decays, you might want to set values higher than
(integer :tag "Score"))))))
(defcustom gnus-adaptive-word-length-limit nil
- "*Words of a length lesser than this limit will be ignored when doing adaptive scoring."
+ "Words of a length lesser than this limit will be ignored when doing adaptive scoring."
:version "22.1"
:group 'gnus-score-adapt
:type '(radio (const :format "Unlimited " nil)
@@ -274,7 +275,7 @@ If you use score decays, you might want to set values higher than
"being" "current" "back" "still" "go" "point" "value" "each" "did"
"both" "true" "off" "say" "another" "state" "might" "under" "start"
"try" "re")
- "*Default list of words to be ignored when doing adaptive word scoring."
+ "Default list of words to be ignored when doing adaptive word scoring."
:group 'gnus-score-adapt
:type '(repeat string))
@@ -283,7 +284,7 @@ If you use score decays, you might want to set values higher than
(,gnus-catchup-mark . -10)
(,gnus-killed-mark . -20)
(,gnus-del-mark . -15))
- "*Alist of marks and scores."
+ "Alist of marks and scores."
:group 'gnus-score-adapt
:type '(repeat (cons (character :tag "Mark")
(integer :tag "Score"))))
@@ -299,12 +300,12 @@ If you use score decays, you might want to set values higher than
:type 'boolean)
(defcustom gnus-score-mimic-keymap nil
- "*Have the score entry functions pretend that they are a keymap."
+ "Have the score entry functions pretend that they are a keymap."
:group 'gnus-score-default
:type 'boolean)
(defcustom gnus-score-exact-adapt-limit 10
- "*Number that says how long a match has to be before using substring matching.
+ "Number that says how long a match has to be before using substring matching.
When doing adaptive scoring, one normally uses fuzzy or substring
matching. However, if the header one matches is short, the possibility
for false positives is great, so if the length of the match is less
@@ -739,6 +740,8 @@ current score file."
(with-current-buffer gnus-summary-buffer
(gnus-score-load-file current-score-file)))))
+(autoload 'appt-select-lowest-window "appt")
+
(defun gnus-score-insert-help (string alist idx)
(setq gnus-score-help-winconf (current-window-configuration))
(with-current-buffer (gnus-get-buffer-create "*Score Help*")
@@ -773,7 +776,7 @@ current score file."
(setq i (1+ i))))
(goto-char (point-min))
;; display ourselves in a small window at the bottom
- (gnus-select-lowest-window)
+ (appt-select-lowest-window)
(if (< (/ (window-height) 2) window-min-height)
(switch-to-buffer "*Score Help*")
(split-window)
@@ -1428,7 +1431,7 @@ If FORMAT, also format the current score file."
(and (file-exists-p file)
(not (file-writable-p file))))
()
- (setq score (setcdr entry (gnus-delete-alist 'touched score)))
+ (setq score (setcdr entry (assq-delete-all 'touched score)))
(erase-buffer)
(let (emacs-lisp-mode-hook)
(if (and (not gnus-adaptive-pretty-print)
@@ -1724,7 +1727,7 @@ score in `gnus-newsgroup-scored' by SCORE."
nil)
(defun gnus-score-decode-text-parts ()
- (gmm-labels
+ (cl-labels
((mm-text-parts
(handle)
(cond ((stringp (car handle))
@@ -1748,7 +1751,7 @@ score in `gnus-newsgroup-scored' by SCORE."
(mm-display-inline handle)
(goto-char (point-max))))))
- (let (;(mm-text-html-renderer 'w3m-standalone)
+ (let ( ;(mm-text-html-renderer 'w3m-standalone)
(handles (mm-dissect-buffer t)))
(save-excursion
(article-goto-body)
@@ -3048,19 +3051,12 @@ If ADAPT, return the home adaptive file instead."
(defun gnus-decay-score (score)
"Decay SCORE according to `gnus-score-decay-constant' and `gnus-score-decay-scale'."
- (let ((n (- score
- (* (if (< score 0) -1 1)
- (min (abs score)
- (max gnus-score-decay-constant
- (* (abs score)
- gnus-score-decay-scale)))))))
- (if (and (featurep 'xemacs)
- ;; XEmacs's floor can handle only the floating point
- ;; number below the half of the maximum integer.
- (> (abs n) (lsh -1 -2)))
- (string-to-number
- (car (split-string (number-to-string n) "\\.")))
- (floor n))))
+ (floor (- score
+ (* (if (< score 0) -1 1)
+ (min (abs score)
+ (max gnus-score-decay-constant
+ (* (abs score)
+ gnus-score-decay-scale)))))))
(defun gnus-decay-scores (alist day)
"Decay non-permanent scores in ALIST."