# HG changeset patch # User Kim F. Storm # Date 1022149454 0 # Node ID 642d016eb216056a1df81aea1a869d307dc45fb9 # Parent 81cb13e7ce4f6555edcd7c10522897b9e1485668 Only reduce string score for lengthy strings once. diff -r 81cb13e7ce4f -r 642d016eb216 lisp/apropos.el --- 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)