From: Kim F. Storm Date: Thu, 23 May 2002 10:24:14 +0000 (+0000) Subject: Only reduce string score for lengthy strings once. X-Git-Tag: ttn-vms-21-2-B4~14903 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d5857a966b7844ae39f338b9f987a2b78c2b6f3d;p=emacs.git Only reduce string score for lengthy strings once. --- 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)