unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Apropos scoring
@ 2003-06-14 20:42 Kai Großjohann
  2003-07-12  1:23 ` Kim F. Storm
  0 siblings, 1 reply; 10+ messages in thread
From: Kai Großjohann @ 2003-06-14 20:42 UTC (permalink / raw


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.
-- 
This line is not blank.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-06-14 20:42 Apropos scoring Kai Großjohann
@ 2003-07-12  1:23 ` Kim F. Storm
  2003-07-12  9:16   ` Kai Großjohann
  0 siblings, 1 reply; 10+ messages in thread
From: Kim F. Storm @ 2003-07-12  1:23 UTC (permalink / raw
  Cc: emacs-devel

kai.grossjohann@gmx.net (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 <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-12  1:23 ` Kim F. Storm
@ 2003-07-12  9:16   ` Kai Großjohann
  2003-07-13  0:11     ` Richard Stallman
  2003-07-13  0:55     ` Kim F. Storm
  0 siblings, 2 replies; 10+ messages in thread
From: Kai Großjohann @ 2003-07-12  9:16 UTC (permalink / raw


storm@cua.dk (Kim F. Storm) writes:

> 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...

Hm.  C-h a is apropos-command, which I think also searches the symbol
names, just like apropos does.  So why have scoring for
apropos-command but not for apropos?

If I am allowed to dream, the best would be to always have scoring,
but to allow for sorting the output in different ways.  Sort by score
and sort by name would be the two obvious sorting methods.

Would that be difficult to do?
-- 
~/.signature

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-12  9:16   ` Kai Großjohann
@ 2003-07-13  0:11     ` Richard Stallman
  2003-07-13  0:55     ` Kim F. Storm
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2003-07-13  0:11 UTC (permalink / raw
  Cc: emacs-devel

    Hm.  C-h a is apropos-command, which I think also searches the symbol
    names, just like apropos does.  So why have scoring for
    apropos-command but not for apropos?

I find that I dislike the non-lexical order of the output of
apropos-command.  There is no clear reason logic behind it,
so it is mysterious.

I think that the score should be used in sorting only if the score is
shown.  When the score is shown, the user will see that the score was
the basis for the ordering.  It will make sense.

I will do that now.

    If I am allowed to dream, the best would be to always have scoring,
    but to allow for sorting the output in different ways.  Sort by score
    and sort by name would be the two obvious sorting methods.

I agree, that would be useful.  

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-12  9:16   ` Kai Großjohann
  2003-07-13  0:11     ` Richard Stallman
@ 2003-07-13  0:55     ` Kim F. Storm
  2003-07-13  9:13       ` Kai Großjohann
  2003-07-13 17:34       ` Richard Stallman
  1 sibling, 2 replies; 10+ messages in thread
From: Kim F. Storm @ 2003-07-13  0:55 UTC (permalink / raw


kai.grossjohann@gmx.net (Kai Großjohann) writes:

> If I am allowed to dream, the best would be to always have scoring,
> but to allow for sorting the output in different ways.  Sort by score
> and sort by name would be the two obvious sorting methods.

I can see that Richard has installed my patch, but at the same time
modified the meaning of apropos-show-scores to also mean "sort by
scores".  I do not object to that coupling as such, but I think the
variable is named wrong with the new meaning.

Since apropos scoring is new in 21.4, I think we can just change the
name of that variable.

I think a better name would be apropos-list-ordering with options
nil (lexical), t (scoring), 'show (scoring, show scores).

WDYT?

BTW, the new entry added to NEWS about the recent change should be
rewritten to describe apropos scoring in general (I'm sorry I forgot
to add one when I originally introduced scoring).

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-13  0:55     ` Kim F. Storm
@ 2003-07-13  9:13       ` Kai Großjohann
  2003-07-13 10:46         ` Robert J. Chassell
  2003-07-13 17:34         ` Richard Stallman
  2003-07-13 17:34       ` Richard Stallman
  1 sibling, 2 replies; 10+ messages in thread
From: Kai Großjohann @ 2003-07-13  9:13 UTC (permalink / raw


storm@cua.dk (Kim F. Storm) writes:

> I think a better name would be apropos-list-ordering with options
> nil (lexical), t (scoring), 'show (scoring, show scores).

I think it's also useful to have lexical ordering, but scores shown.

Why not two options, apropos-show-scores and apropos-sort-by-scores?
-- 
~/.signature

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-13  9:13       ` Kai Großjohann
@ 2003-07-13 10:46         ` Robert J. Chassell
  2003-07-13 17:34         ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Robert J. Chassell @ 2003-07-13 10:46 UTC (permalink / raw


kai.grossjohann@gmx.net wroteMail-Followup-To: emacs-devel@gnu.org

   I think it's also useful to have lexical ordering, but scores shown.

Yes, I agree.  That is what I would choose, lexical ordering with
scores shown.  I dislike non-lexical ordering, but do like scoring.

-- 
    Robert J. Chassell                         Rattlesnake Enterprises
    http://www.rattlesnake.com                  GnuPG Key ID: 004B4AC8
    http://www.teak.cc                             bob@rattlesnake.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-13  9:13       ` Kai Großjohann
  2003-07-13 10:46         ` Robert J. Chassell
@ 2003-07-13 17:34         ` Richard Stallman
  1 sibling, 0 replies; 10+ messages in thread
From: Richard Stallman @ 2003-07-13 17:34 UTC (permalink / raw
  Cc: emacs-devel

    Why not two options, apropos-show-scores and apropos-sort-by-scores?

Because what you get by turning on one of them and not the other
is not very useful.  The most useful options would be both-yes
or both-no.  Having two separate options makes it inconvenient
to switch between those two.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-13  0:55     ` Kim F. Storm
  2003-07-13  9:13       ` Kai Großjohann
@ 2003-07-13 17:34       ` Richard Stallman
  2003-07-15  0:04         ` Kim F. Storm
  1 sibling, 1 reply; 10+ messages in thread
From: Richard Stallman @ 2003-07-13 17:34 UTC (permalink / raw
  Cc: emacs-devel

    Since apropos scoring is new in 21.4, I think we can just change the
    name of that variable.

    I think a better name would be apropos-list-ordering with options
    nil (lexical), t (scoring), 'show (scoring, show scores).

Ok.

    BTW, the new entry added to NEWS about the recent change should be
    rewritten to describe apropos scoring in general (I'm sorry I forgot
    to add one when I originally introduced scoring).

Would you please do that too?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Apropos scoring
  2003-07-13 17:34       ` Richard Stallman
@ 2003-07-15  0:04         ` Kim F. Storm
  0 siblings, 0 replies; 10+ messages in thread
From: Kim F. Storm @ 2003-07-15  0:04 UTC (permalink / raw
  Cc: emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Since apropos scoring is new in 21.4, I think we can just change the
>     name of that variable.
> 
>     I think a better name would be apropos-list-ordering with options
>     nil (lexical), t (scoring), 'show (scoring, show scores).
> 
> Ok.

I have thought more about your argument for collapsing the
functionality of scoring and showing the scores, and I fullt agree.

So I simply renamed apropos-show-scores to apropos-sort-by-scores
and changed the doc string accordingly.

> 
>     BTW, the new entry added to NEWS about the recent change should be
>     rewritten to describe apropos scoring in general (I'm sorry I forgot
>     to add one when I originally introduced scoring).
> 
> Would you please do that too?

Done.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-07-15  0:04 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-14 20:42 Apropos scoring Kai Großjohann
2003-07-12  1:23 ` Kim F. Storm
2003-07-12  9:16   ` Kai Großjohann
2003-07-13  0:11     ` Richard Stallman
2003-07-13  0:55     ` Kim F. Storm
2003-07-13  9:13       ` Kai Großjohann
2003-07-13 10:46         ` Robert J. Chassell
2003-07-13 17:34         ` Richard Stallman
2003-07-13 17:34       ` Richard Stallman
2003-07-15  0:04         ` Kim F. Storm

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).