[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Why do apropos commands match only pairs of words in a word-list pat
RE: Why do apropos commands match only pairs of words in a word-list pattern?
Mon, 11 May 2015 07:06:01 -0700 (PDT)
> > Instead of matching each word in the list you provide it, apropos
> > commands match each pair of words from the list.
> > Why is this the design? Wouldn't users more typically want *each*
> > of the words they type to be matched?
> My own experience is that I both sometimes liked and sometimes hated
> the behaviour. Often the latter, though. I think it would be nice to
> sort by relevance (e.g. the number of words that matched). How
> easy/difficult would that be ?
That's not the answer, IMO. Better is to give users control over the
behavior. A user option is one approach.
(I've done that in my library `apu.el': `apu-match-word-pairs-only-flag',
Another possibility is to have an option to define the default behavior,
but to let users decide immediately which behavior to get when they use
the command. That is the approach taken by apropos commands for DO-ALL.
That's the way to go, I think.
It's not just about ordering things. Order is a separate choice axis,
and yes, users should be able to order the output in different ways.
But simply always combining the two matching approaches mentioned, and
relegating the "looser" pair-matching candidates to the end of the
buffer is not a good design. (IMHO.)
But I would still like to hear from someone who gives a good reason
for the current design. You've said that you sometimes like it, but
that doesn't tell why. And why pairs and not triplets or...?
My guess so far is that this is just historical - a vestige of the
fact that apropos was implemented to use a regexp, so we cobbled
together a regexp that, while not doing what one would expect for
keyword matching, at least covers all of the true positives, even
if it also throws in a lot of false positives.
But I would like to hear arguments of why this is TRT for apropos.