247 |
(concat "\\(" |
(concat "\\(" |
248 |
(mapconcat 'identity words "\\|") |
(mapconcat 'identity words "\\|") |
249 |
"\\)" wild |
"\\)" wild |
250 |
(if (cdr words) |
(if (cdr words) |
251 |
(concat "\\(" |
(concat "\\(" |
252 |
(mapconcat 'identity words "\\|") |
(mapconcat 'identity words "\\|") |
253 |
"\\)") |
"\\)") |
314 |
(dolist (s (apropos-calc-scores doc apropos-all-words) score) |
(dolist (s (apropos-calc-scores doc apropos-all-words) score) |
315 |
(setq score (+ score 50 (/ (* (- l s) 50) l))))) |
(setq score (+ score 50 (/ (* (- l s) 50) l))))) |
316 |
0)) |
0)) |
317 |
|
|
318 |
(defun apropos-score-symbol (symbol &optional weight) |
(defun apropos-score-symbol (symbol &optional weight) |
319 |
"Return apropos score for SYMBOL." |
"Return apropos score for SYMBOL." |
320 |
(setq symbol (symbol-name symbol)) |
(setq symbol (symbol-name symbol)) |
413 |
(if (functionp symbol) |
(if (functionp symbol) |
414 |
(if (setq doc (documentation symbol t)) |
(if (setq doc (documentation symbol t)) |
415 |
(progn |
(progn |
416 |
(setq score (+ score (apropos-score-doc doc))) |
(setq score (+ score (apropos-score-doc doc))) |
417 |
(substring doc 0 (string-match "\n" doc))) |
(substring doc 0 (string-match "\n" doc))) |
418 |
"(not documented)"))) |
"(not documented)"))) |
419 |
(and var-predicate |
(and var-predicate |
531 |
(if (apropos-false-hit-str p) |
(if (apropos-false-hit-str p) |
532 |
(setq p nil)) |
(setq p nil)) |
533 |
(if (or f v p) |
(if (or f v p) |
534 |
(setq apropos-accumulator (cons (list symbol |
(setq apropos-accumulator (cons (list symbol |
535 |
(+ (apropos-score-str f) |
(+ (apropos-score-str f) |
536 |
(apropos-score-str v) |
(apropos-score-str v) |
537 |
(apropos-score-str p)) |
(apropos-score-str p)) |
580 |
(setcar (nthcdr 2 apropos-item) v) |
(setcar (nthcdr 2 apropos-item) v) |
581 |
(setcar apropos-item (+ (car apropos-item) sv))))) |
(setcar apropos-item (+ (car apropos-item) sv))))) |
582 |
(setq apropos-accumulator |
(setq apropos-accumulator |
583 |
(cons (list symbol |
(cons (list symbol |
584 |
(+ (apropos-score-symbol symbol 2) sf sv) |
(+ (apropos-score-symbol symbol 2) sf sv) |
585 |
f v) |
f v) |
586 |
apropos-accumulator))))))) |
apropos-accumulator))))))) |
665 |
(or (and (setq apropos-item (assq symbol apropos-accumulator)) |
(or (and (setq apropos-item (assq symbol apropos-accumulator)) |
666 |
(setcar (cdr apropos-item) |
(setcar (cdr apropos-item) |
667 |
(+ (cadr apropos-item) (apropos-score-doc doc)))) |
(+ (cadr apropos-item) (apropos-score-doc doc)))) |
668 |
(setq apropos-item (list symbol |
(setq apropos-item (list symbol |
669 |
(+ (apropos-score-symbol symbol 2) |
(+ (apropos-score-symbol symbol 2) |
670 |
(apropos-score-doc doc)) |
(apropos-score-doc doc)) |
671 |
nil nil) |
nil nil) |
755 |
(defun apropos-print (do-keys spacing) |
(defun apropos-print (do-keys spacing) |
756 |
"Output result of apropos searching into buffer `*Apropos*'. |
"Output result of apropos searching into buffer `*Apropos*'. |
757 |
The value of `apropos-accumulator' is the list of items to output. |
The value of `apropos-accumulator' is the list of items to output. |
758 |
Each element should have the format |
Each element should have the format |
759 |
(SYMBOL SCORE FN-DOC VAR-DOC [PLIST-DOC WIDGET-DOC FACE-DOC GROUP-DOC]). |
(SYMBOL SCORE FN-DOC VAR-DOC [PLIST-DOC WIDGET-DOC FACE-DOC GROUP-DOC]). |
760 |
The return value is the list that was in `apropos-accumulator', sorted |
The return value is the list that was in `apropos-accumulator', sorted |
761 |
alphabetically by symbol name; but this function also sets |
alphabetically by symbol name; but this function also sets |