From d5857a966b7844ae39f338b9f987a2b78c2b6f3d Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 23 May 2002 10:24:14 +0000 Subject: [PATCH] Only reduce string score for lengthy strings once. --- lisp/apropos.el | 7 ++++--- 1 file 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." (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) -- 2.39.5