+2003-11-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus-score.el (gnus-decay-score): Return a surely smaller value
+ than the argument in XEmacs.
+
2003-11-18 Reiner Steib <Reiner.Steib@gmx.de>
* message.el (message-insert-to): Don't use `gnus-message'.
(defun gnus-decay-score (score)
"Decay SCORE according to `gnus-score-decay-constant' and `gnus-score-decay-scale'."
- (condition-case nil
- (floor
- (- score
- (* (if (< score 0) -1 1)
- (min (abs score)
- (max gnus-score-decay-constant
- (* (abs score)
- gnus-score-decay-scale))))))
- (arith-error (lsh -1 -1))))
+ (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' 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))))
(defun gnus-decay-scores (alist day)
"Decay non-permanent scores in ALIST."
+2003-11-19 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * gnus.texi (Score Decays): Update the gnus-decay-score function.
+
2003-11-17 Jesper Harder <harder@ifa.au.dk>
* gnus.texi (Troubleshooting): Update.
@lisp
(defun gnus-decay-score (score)
- "Decay SCORE.
-This is done according to `gnus-score-decay-constant'
+ "Decay SCORE according to `gnus-score-decay-constant'
and `gnus-score-decay-scale'."
- (floor
- (- score
- (* (if (< score 0) 1 -1)
- (min (abs score)
- (max gnus-score-decay-constant
- (* (abs score)
- 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' 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))))
@end lisp
@vindex gnus-score-decay-scale
@lisp
(defun gnus-decay-score (score)
- "Decay SCORE.
-This is done according to `gnus-score-decay-constant'
+ "Decay SCORE according to `gnus-score-decay-constant'
and `gnus-score-decay-scale'."
- (floor
- (- score
- (* (if (< score 0) 1 -1)
- (min (abs score)
- (max gnus-score-decay-constant
- (* (abs score)
- 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' 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))))
@end lisp
@vindex gnus-score-decay-scale