/[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.92 by lektu, Tue Feb 4 11:00:25 2003 UTC revision 1.93 by rms, Sat Jul 12 21:57:50 2003 UTC
# Line 102  for the regexp; the part that matches ge Line 102  for the regexp; the part that matches ge
102    :group 'apropos    :group 'apropos
103    :type 'face)    :type 'face)
104    
105    (defcustom apropos-show-scores nil
106      "*Non-nil means show score for each match, and sort matches by scores."
107      :group 'apropos
108      :type 'boolean)
109    
110  (defvar apropos-mode-map  (defvar apropos-mode-map
111    (let ((map (make-sparse-keymap)))    (let ((map (make-sparse-keymap)))
# Line 119  for the regexp; the part that matches ge Line 123  for the regexp; the part that matches ge
123  (defvar apropos-mode-hook nil  (defvar apropos-mode-hook nil
124    "*Hook run when mode is turned on.")    "*Hook run when mode is turned on.")
125    
 (defvar apropos-show-scores nil  
   "*Show apropos scores if non-nil.")  
   
126  (defvar apropos-regexp nil  (defvar apropos-regexp nil
127    "Regexp used in current apropos run.")    "Regexp used in current apropos run.")
128    
# Line 468  time-consuming.  Returns list of symbols Line 469  time-consuming.  Returns list of symbols
469      (while p      (while p
470        (setcar p (list        (setcar p (list
471                   (setq symbol (car p))                   (setq symbol (car p))
472                   0                   (apropos-score-symbol symbol)
473                   (when (fboundp symbol)                   (when (fboundp symbol)
474                     (if (setq doc (condition-case nil                     (if (setq doc (condition-case nil
475                                       (documentation symbol t)                                       (documentation symbol t)
# Line 766  separate items with that string." Line 767  separate items with that string."
767    (if (null apropos-accumulator)    (if (null apropos-accumulator)
768        (message "No apropos matches for `%s'" apropos-orig-regexp)        (message "No apropos matches for `%s'" apropos-orig-regexp)
769      (setq apropos-accumulator      (setq apropos-accumulator
770            (sort apropos-accumulator (lambda (a b)            (sort apropos-accumulator
771                                        (or (> (cadr a) (cadr b))                  (lambda (a b)
772                                            (and (= (cadr a) (cadr b))                    ;; Don't sort by score if user can't see the score.
773                                                 (string-lessp (car a) (car b)))))))                    ;; It would be confusing.  -- rms.
774                      (if apropos-show-scores
775                          (or (> (cadr a) (cadr b))
776                              (and (= (cadr a) (cadr b))
777                                   (string-lessp (car a) (car b))))
778                        (string-lessp (car a) (car b))))))
779      (with-output-to-temp-buffer "*Apropos*"      (with-output-to-temp-buffer "*Apropos*"
780        (let ((p apropos-accumulator)        (let ((p apropos-accumulator)
781              (old-buffer (current-buffer))              (old-buffer (current-buffer))

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

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