lewang / flx

Fuzzy matching for Emacs ... a la Sublime Text.
GNU General Public License v3.0
518 stars 37 forks source link

Special buffers are given worse scores #20

Closed dgutov closed 11 years ago

dgutov commented 11 years ago

I have a message.el in recently opened files and a *Messages* buffer. If I type C-x b and then mess, it reliably gives the file (as a "virtual buffer") better score than the special buffer.

Similarly, for qc and questions_controller.rb over *Quail Completions*.

lewang commented 11 years ago

Thanks for the bug report.

Hmmm. If these strings weren't buffer names, then the sorting is as you would expect right?

I'm having a think about adding some kind of filter function that's able to adjust the score, but not sure if that kind of complexity belongs in flx or some other completion framework.

dgutov commented 11 years ago

I dunno, I might like it to ignore * in all kinds of strings: this is a non-word char, and it requires two keystrokes to type.

lewang commented 11 years ago

Thinking about it further, this is working exactly as designed. flx only cares about letters and numbers so it in a sense already ignores *, but the presence slightly lowers the score of the match. This is useful for filenames,etc where we want ".*" to be ranked after regular files.

I'm closing this, but it may get fixed if ever I decide to implement scoring hooks.

dgutov commented 11 years ago

I'm not so sure I'd like this behavior with files, either.

  1. It's quite rare to have two files with the same name, only one of them prepended with ..
  2. If dot-files show up in the candidates list at all (some of them may be ignored via framework-provided means), I'd prefer to just type the word characters to get to them, not the dot or any other symbols.
lewang commented 11 years ago

It definitely feels wrong to say "*foo" and "foo" should score the same, though.

Currently, pressing f causes "foo" to appear before "_foo", and _f goes the other way.

If we make "foo" and "_foo" essentially equal, there would be no way to force "foo" to appear before "_foo".

On Fri, Jul 12, 2013 at 8:16 PM, Dmitry Gutov notifications@github.comwrote:

I'm not so sure I'd like this behavior with files, either.

1.

It's quite rare to have two files with the same name, only one of them prepended with .. 2.

If dot-files show up in the candidates list at all (some of them may be ignored via framework-provided means), I'd prefer to just type the word characters, not the dot or any other symbols.

— Reply to this email directly or view it on GitHubhttps://github.com/lewang/flx/issues/20#issuecomment-20873058 .

Le

dgutov commented 11 years ago

True, but it's a rare, theoretical case, and one can always use arrow keys or C-s for that.

Selecting *Messages* is, on the other hand, something I do quite often.

IOW, a custom option should work fine, if it's not too hard to implement.

magnars commented 11 years ago

@dgutov Not exactly relevant, maybe, but you can always go to *Messages* with C-h e.

dgutov commented 11 years ago

@magnars I guess I could, if I advise it to never pop a new window. Thanks.

But *Message* is not the only special buffer I tend to visit, even if it's the most frequent one.