/[emacs]/emacs/lisp/apropos.el
ViewVC logotype

Diff of /emacs/lisp/apropos.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.91 by jpw, Tue Jan 14 20:47:21 2003 UTC revision 1.92 by lektu, Tue Feb 4 11:00:25 2003 UTC
# Line 247  before finding a label." Line 247  before finding a label."
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                        "\\)")                        "\\)")
# Line 314  Value is a list of offsets of the words Line 314  Value is a list of offsets of the words
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))
# Line 413  satisfy the predicate VAR-PREDICATE." Line 413  satisfy the predicate VAR-PREDICATE."
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
# Line 531  Returns list of symbols and values found Line 531  Returns list of symbols and values found
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))
# Line 580  Returns list of symbols and documentatio Line 580  Returns list of symbols and documentatio
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)))))))
# Line 665  Returns list of symbols and documentatio Line 665  Returns list of symbols and documentatio
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)
# Line 755  Will return nil instead." Line 755  Will return nil instead."
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

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.92

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26