[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Apropos scoring
From: |
Kim F. Storm |
Subject: |
Re: Apropos scoring |
Date: |
12 Jul 2003 03:23:43 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
address@hidden (Kai Großjohann) writes:
> I just invoked (apropos "gnus group name allow char" nil), and all
> scores were zero. Is this supposed to be so?
>
> /----[ first few matches of apropos command ]
> | ad-Orig-gnus-group-get-new-news (0)
> | Command: Get newly arrived articles.
> | ad-Orig-gnus-group-list-groups (0)
> | Command: List newsgroups with level LEVEL or lower that have unread
> articles.
> \----
>
> I noticed that I get scoring for some apropos searches but not for
> others. I haven't been able to find a pattern.
Sorry for not looking into this sooner.
The "pattern" is simple:
C-h C-a gives you genuine scores (and hits sorted accordingly).
M-x apropos-documentation also does scoring.
M-x apropos doesn't do any scoring (so the list of matching symbols is
sorted alphabetically).
The "fix" to `apropos' is simple (see patch below), but I'm not sure I
like it, as just scoring on the symbol name itself really doesn't give
you a lot... IMO, the lexical ordering is better for this purpose...
WDYT?
of course, the simplest thing is to reset apropos-show-scores to nil -
then you don't see the scores anymore :-)
Index: apropos.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/apropos.el,v
retrieving revision 1.92
diff -c -r1.92 apropos.el
*** apropos.el 4 Feb 2003 11:00:25 -0000 1.92
--- apropos.el 11 Jul 2003 23:16:32 -0000
***************
*** 466,474 ****
(let ((p apropos-accumulator)
symbol doc properties)
(while p
(setcar p (list
! (setq symbol (car p))
! 0
(when (fboundp symbol)
(if (setq doc (condition-case nil
(documentation symbol t)
--- 466,475 ----
(let ((p apropos-accumulator)
symbol doc properties)
(while p
+ (setq symbol (car p))
(setcar p (list
! symbol
! (apropos-score-symbol symbol) ;; score
(when (fboundp symbol)
(if (setq doc (condition-case nil
(documentation symbol t)
--
Kim F. Storm <address@hidden> http://www.cua.dk