[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130509152731.GA3355@udknight>
Date: Thu, 9 May 2013 23:27:31 +0800
From: Wang YanQing <udknight@...il.com>
To: "Yann E. MORIN" <yann.morin.1998@...e.fr>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Jean Delvare <jdelvare@...e.de>, Michal Marek <mmarek@...e.cz>,
Roland Eggner <edvx1@...temanalysen.net>
Subject: Re: [PATCH v3] kconfig: sort found symbols by relevance
On Mon, May 06, 2013 at 11:15:31PM +0200, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@...e.fr>
>
> When searching for symbols, return the symbols sorted by relevance.
>
> Sorting is done as thus:
> - first, symbols with a prompt, [1]
> - then, smallest offset, [2]
> - then, shortest match, [3]
> - then, highest relative match, [4]
> - finally, alphabetical sort [5]
>
> So, searching (eg.) for 'P.*CI' :
>
> [1] Symbols of interest are probably those with a prompt, as they can be
> changed, while symbols with no prompt are only for info. Thus:
> PCIEASPM comes before PCI_ATS
Search the value of symbols with no prompt are useful too
> [2] Symbols that match earlier in the name are to be preferred over
> symbols which match later. Thus:
> PCI_MSI comes before WDTPCI
We can achieve this with ^PCI regular search
> [3] The shortest match is (IMHO) more interesting than a longer one.
> Thus:
> PCI comes before PCMCIA
We can achieve this with ^PCI regular search plus your previous heuristic
> [4] The relative match is the ratio of the length of the match against
> the length of the symbol. The more of a symbol name we match, the
> more instersting that symbol is. Thus:
> PCIEAER comes before PCIEASPM
This is what your first heuristic
> [5] As fallback, sort symbols alphabetically
This is in your first heuristic too.
> This heuristic tries hard to get interesting symbols first in the list.
I don't mean your this heuristic is bad, but
maybe provide mechanism to user will make guesser life easier.
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists