unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: emacs-devel@gnu.org
Subject: Re: Apropos scoring
Date: 12 Jul 2003 03:23:43 +0200	[thread overview]
Message-ID: <5x8yr4o7vk.fsf@kfs2.cua.dk> (raw)
In-Reply-To: <84znkk1jcl.fsf@lucy.is.informatik.uni-duisburg.de>

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

  reply	other threads:[~2003-07-12  1:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-14 20:42 Apropos scoring Kai Großjohann
2003-07-12  1:23 ` Kim F. Storm [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5x8yr4o7vk.fsf@kfs2.cua.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).