aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2002-05-23 10:24:14 +0000
committerKim F. Storm2002-05-23 10:24:14 +0000
commitd5857a966b7844ae39f338b9f987a2b78c2b6f3d (patch)
tree225901a9aea6168e79e140b45afd034bbb1651b7
parent7dbffb1cf554c6de1625a8892f76f97d9794d6a8 (diff)
downloademacs-d5857a966b7844ae39f338b9f987a2b78c2b6f3d.tar.gz
emacs-d5857a966b7844ae39f338b9f987a2b78c2b6f3d.zip
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 3b7072eb3ed..8d1e163bd80 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."
297(defun apropos-score-str (str) 297(defun apropos-score-str (str)
298 "Return apropos score for string STR." 298 "Return apropos score for string STR."
299 (if str 299 (if str
300 (let ((score 0) 300 (let* (
301 (l (length str)) 301 (l (length str))
302 (score (- (/ l 10)))
302 i) 303 i)
303 (dolist (s (apropos-calc-scores str apropos-all-words) score) 304 (dolist (s (apropos-calc-scores str apropos-all-words) score)
304 (setq score (+ score 1000 (- (/ l 10)) (/ (* (- l s) 1000) l))))) 305 (setq score (+ score 1000 (/ (* (- l s) 1000) l)))))
305 0)) 306 0))
306 307
307(defun apropos-score-doc (doc) 308(defun apropos-score-doc (doc)