kconfig: sort found symbols by relevance
authorYann E. MORIN <yann.morin.1998@free.fr>
Mon, 6 May 2013 12:57:47 +0000 (14:57 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Wed, 23 Oct 2013 20:20:56 +0000 (22:20 +0200)
commit3c443264cbef7b1e1fe08cc51cb7ad6d5752e7ae
tree4e7a01b8e156695463b2185ca8f8fafb9042ca81
parente7bcd5ddb8a85f899faf07e4c0aed4c8818d7acb
kconfig: sort found symbols by relevance

When searching for symbols, return the symbols sorted by relevance.

Sorting is done as thus:
  - first, symbols that match exactly
  - then, alphabetical sort

Since the search can be a regexp, it is possible that more than one symbol
matches exactly. In this case, we can't decide which to sort first, so we
fallback to alphabeticall sort.

Explain this (new!) sorting heuristic in the documentation.

Reported-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Roland Eggner <edvx1@systemanalysen.net>
Cc: Wang YanQing <udknight@gmail.com>
--
Changes v1->v2:
  - drop the previous, complex heuristic in favour of a simpler heuristic
    that is both easier to understand, *and* to maintain (Jean)
  - explain sorting heuristic in the doc  (Jean)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
config/symbol.c