changeset 45484:642d016eb216

Only reduce string score for lengthy strings once.
author Kim F. Storm <storm@cua.dk>
date Thu, 23 May 2002 10:24:14 +0000
parents 81cb13e7ce4f
children 08b14b8f7bc2
files lisp/apropos.el
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/apropos.el	Thu May 23 10:20:12 2002 +0000
+++ b/lisp/apropos.el	Thu May 23 10:24:14 2002 +0000
@@ -297,11 +297,12 @@
 (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)