Mercurial > emacs
comparison lisp/apropos.el @ 51933:8604d171445a
(apropos-sort-by-scores): Rename from apropos-show-scores.
All uses changed.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Mon, 14 Jul 2003 21:49:02 +0000 |
parents | 58bf3c3670d8 |
children | f3610e8bfe2d |
comparison
equal
deleted
inserted
replaced
51932:2a48b71ac770 | 51933:8604d171445a |
---|---|
100 This applies when you look for matches in the documentation or variable value | 100 This applies when you look for matches in the documentation or variable value |
101 for the regexp; the part that matches gets displayed in this font." | 101 for the regexp; the part that matches gets displayed in this font." |
102 :group 'apropos | 102 :group 'apropos |
103 :type 'face) | 103 :type 'face) |
104 | 104 |
105 (defcustom apropos-show-scores nil | 105 (defcustom apropos-sort-by-scores nil |
106 "*Non-nil means show score for each match, and sort matches by scores." | 106 "*Non-nil means sort matches by scores; best match is shown first. |
107 The computed score is shown for each match." | |
107 :group 'apropos | 108 :group 'apropos |
108 :type 'boolean) | 109 :type 'boolean) |
109 | 110 |
110 (defvar apropos-mode-map | 111 (defvar apropos-mode-map |
111 (let ((map (make-sparse-keymap))) | 112 (let ((map (make-sparse-keymap))) |
769 (setq apropos-accumulator | 770 (setq apropos-accumulator |
770 (sort apropos-accumulator | 771 (sort apropos-accumulator |
771 (lambda (a b) | 772 (lambda (a b) |
772 ;; Don't sort by score if user can't see the score. | 773 ;; Don't sort by score if user can't see the score. |
773 ;; It would be confusing. -- rms. | 774 ;; It would be confusing. -- rms. |
774 (if apropos-show-scores | 775 (if apropos-sort-by-scores |
775 (or (> (cadr a) (cadr b)) | 776 (or (> (cadr a) (cadr b)) |
776 (and (= (cadr a) (cadr b)) | 777 (and (= (cadr a) (cadr b)) |
777 (string-lessp (car a) (car b)))) | 778 (string-lessp (car a) (car b)))) |
778 (string-lessp (car a) (car b)))))) | 779 (string-lessp (car a) (car b)))))) |
779 (with-output-to-temp-buffer "*Apropos*" | 780 (with-output-to-temp-buffer "*Apropos*" |
802 'type 'apropos-symbol | 803 'type 'apropos-symbol |
803 ;; Can't use default, since user may have | 804 ;; Can't use default, since user may have |
804 ;; changed the variable! | 805 ;; changed the variable! |
805 ;; Just say `no' to variables containing faces! | 806 ;; Just say `no' to variables containing faces! |
806 'face apropos-symbol-face) | 807 'face apropos-symbol-face) |
807 (if apropos-show-scores | 808 (if apropos-sort-by-scores |
808 (insert " (" (number-to-string (cadr apropos-item)) ") ")) | 809 (insert " (" (number-to-string (cadr apropos-item)) ") ")) |
809 ;; Calculate key-bindings if we want them. | 810 ;; Calculate key-bindings if we want them. |
810 (and do-keys | 811 (and do-keys |
811 (commandp symbol) | 812 (commandp symbol) |
812 (indent-to 30 1) | 813 (indent-to 30 1) |