[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new apropos feature in Emacs-22

From: Kim F. Storm
Subject: Re: new apropos feature in Emacs-22
Date: Sun, 06 Nov 2005 23:54:57 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Luc Teirlinck <address@hidden> writes:

> Eli Zaretskii wrote:
>    That's your ``always use quotes'' rule again; see above for why it
>    might not be useful for someone (like a newbie) who does not know the
>    exact phrase she is looking for.
> Phrases like "global font lock mode" or "text only terminal" are
> conceptually single items, even though, without quoting, to the
> computer they look like four or three unrelated keywords.  That is
> exactly why one _needs_ quoting in searches.

With apropos-sort-by-scores turned on, apropos-documentation returns
the following entries for "global font lock mode" (in this sequence):

  Command: Toggle Font-Lock mode in every buffer.
  Command: Toggle Font Lock mode.
  Variable: *Modes for which Font Lock mode is automagically turned on.
  Command: Toggle minor mode for interactively adding font-lock highlighting 
  Variable: *Support mode for Font Lock mode.
  Function: Toggle Just-in-time Lock mode.
{the list is much longer, but most entries have some relevance}

On the other hand, if you search for the regexp "global font lock
mode", you get just two entries (not including the obvious

  Variable: *Modes for which Font Lock mode is automagically turned on.
  Command: Toggle Font Lock mode.

BTW, I strongly doubt that any novice user will search for anything
remotely similar to "font lock". Instead they will search for "syntax
highlighting" -- where regexp and keyword search produces similar
results -- or they will search for "highlight syntax" where regexp
shows nothing, while keywords show that same result as before.

To me it is a bit strange that someone who favours regexp search is so
worried about the potential pitfalls of the novice, while those of us
who advocate keyword searches don't see the big problem...

> A newbie using apropos can not be assumed to be 100% ignorant: one way
> or the other he managed to find out about the apropos commands.  So he
> should be familiar with at least some multi-word phrases that are
> conceptually a single item.

And keyword search will find then -- and place them high on the list
with sort-by-score enabled.

In any case, I'll try to make some corrections to the scoring algorithm
to make it behave better when the search string/regexp matches literally
as well as a regexp (e.g. for .emacs or *scratch*).  It's almost there,
but there are a few rough edges...

Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]