aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2002-05-23 10:24:14 +0000
committerKim F. Storm <[email protected]>2002-05-23 10:24:14 +0000
commitd5857a966b7844ae39f338b9f987a2b78c2b6f3d (patch)
tree225901a9aea6168e79e140b45afd034bbb1651b7
parent7dbffb1cf554c6de1625a8892f76f97d9794d6a8 (diff)
Only reduce string score for lengthy strings once.
-rw-r--r--lisp/apropos.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el
index 3b7072eb3e..8d1e163bd8 100644
--- a/lisp/apropos.el
+++ b/lisp/apropos.el
@@ -297,11 +297,12 @@ Value is a list of offsets of the words into the string."
(defun apropos-score-str (str)
"Return apropos score for string STR."
(if str
- (let ((score 0)
- (l (length str))
+ (let* (
+ (l (length str))
+ (score (- (/ l 10)))
i)
(dolist (s (apropos-calc-scores str apropos-all-words) score)
- (setq score (+ score 1000 (- (/ l 10)) (/ (* (- l s) 1000) l)))))
+ (setq score (+ score 1000 (/ (* (- l s) 1000) l)))))
0))
(defun apropos-score-doc (doc)