Giter Site home page Giter Site logo

flx's Introduction

Build Status MELPA MELPA Stable

Status

This project is more than a year old now. Lots of bugs have been worked out.

It appears some people use it on a regular basis.

Screencast

Screencast showing rationale and ido workflow

Installation

Manual

Just drop all .el files somewhere on your load-path. Here's an example using the folder ~/.emacs.d/vendor:

(add-to-list 'load-path "~/emacs.d/vendor")

Package Repositories

Available packages:

  • flx - matching engine
  • flx-ido - ido interface for flx

Install flx-ido will pull in flx as a dependency.

MELPA

If you're an Emacs 24 user or you have a recent version of package.el you can install flx-ido from MELPA.

This version will always be up-to-date.

Marmalade

flx-ido is also available on the Marmalade package.el repository.

Emacs Prelude

flx-ido is part of the Emacs Prelude. If you're a Prelude user - flx-ido is already properly configured and ready for action.

Debian and Ubuntu

Users of Debian 9 or Ubuntu 16.04 or later may simply apt-get install elpa-flx.

Usage

The sorting algorithm is a balance between word beginnings (abbreviation) and contiguous matches (substring).

The longer the substring match, the higher it scores. This maps well to how we think about matching.

In general, it's better form queries with only lowercase characters so the sorting algorithm can do something smart.

For example, if you have these files:

    projects/clojure-mode/clojure-mode.el
    projects/prelude/core/prelude-mode.el

If the search term was pre-mode, you might expect "prelude-mode.el" to rank higher. However because the substring match "re-mode" is so long, "clojure-mode.el" actually scores higher.

Here, using premode would give the expected order. Notice that the "-" actually prevents the algorithm from helping you.

uppercase letters

Flx always folds lowercase letters to match uppercase. However, you can use uppercase letters for force flx to only match uppercase.

This is similar to Emacs' case-folding. The difference is mixing in uppercase letters does not disable folding.

completing file names

Matches within the basepath score higher.

ido support

Add this to your init file and flx match will be enabled for ido.

(require 'flx-ido)
(ido-mode 1)
(ido-everywhere 1)
(flx-ido-mode 1)
;; disable ido faces to see flx highlights.
(setq ido-enable-flex-matching t)
(setq ido-use-faces nil)

If you don't want to use the flx's highlights you can turn them off like this:

(setq flx-ido-use-faces nil)

Flx uses a complex matching heuristics which can be slow for large collections

Customize flx-ido-threshold to change the collection size above which flx will revert to flex matching.

As soon as the collection is narrowed below flx-ido-threshold, flx will kick in again.

As a point of reference for a 2.3 GHz quad-core i7 processor, a value of 10000 still provides a reasonable completion experience.

Helm support

Helm is not supported yet. There is a demo showing how it could work, but I'm still working through how to integrate it into helm.

The Helm demo shows the score of the top 20 matches.

Memory Usage

The flx algorithm willingly sacrifices memory usage for speed.

For 10k file names, about 10 MB of memory will be used to speed up future matching. This memory is never released to keep the match speed fast.

So far with modern computers, this feels like a reasonable design decision.

It may change in future.

GC Optimization

Emacs's garbage collector is fairly primitive stop the world type. GC time can contribute significantly to the run-time of computation that allocates and frees a lot of memory.

Consider the following example:

(defun uuid ()
  (format "%08x-%08x-%08x-%08x"
          (random (expt 16 4))
          (random (expt 16 4))
          (random (expt 16 4))
          (random (expt 16 4))))

(benchmark-run 1
  (let ((cache (flx-make-filename-cache)))
    (dolist (i (number-sequence 0 10000))
      (flx-process-cache (uuid) cache))))
        ;;; ⇒ (0.899678 9 0.33650300000000044)

This means that roughly 30% of time is spent just doing garbage-collection.

flx can benefit significantly from garbage collection tuning.

By default Emacs will initiate GC every 0.76 MB allocated (gc-cons-threshold == 800000). If we increase this to 20 MB (gc-cons-threshold == 20000000) we get:

(benchmark-run 1
  (setq gc-cons-threshold 20000000)
  (let ((cache (flx-make-filename-cache)))
    (dolist (i (number-sequence 0 10000))
      (flx-process-cache (uuid) cache))))
    ;;; ⇒ (0.62035 1 0.05461100000000041)

So if you have a modern machine, I encourage you to add the following:

(setq gc-cons-threshold 20000000)

to your init file.

flx's People

Contributors

antmak avatar artagnon avatar bbatsov avatar bsuh avatar jcs090218 avatar jschaf avatar lewang avatar phst avatar pythonnut avatar skangas avatar spwhitton avatar tarsius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flx's Issues

Highlight current candidate

I think that flx should use some special face for the current candidate (although it's always the first one) to make it visually more apparent that it's the one selected. The matched characters in it should also be highlighted of course.

Basically I'm suggesting that we combine the standard ido face for the current candidate with the flx face for the matched characters in a candidate. I guess a face overlay would do the trick?

describe-function rx gives wrong candidates

With ido-flx-mode and ido-ubiquitous, C-h f (aka describe-function) gives useless candidates for the input rx. It lists rx-any as first candidate, org-fixup-indentation as second, but the function rx itself does not appear as candidate and cannot be selected.

This makes describe-function downright useless in combination with ido-flx-mode.

Problem with `read-file-name`

When executing the following

(read-file-name "Filename " "~/" nil nil "anonexistingfilename.pdf")

the cursor is initialy set before the "anonexistingfilename.pdf". This is good because it allows for easily removing this default file name. But, with flx-ido, after a few miliseconds, the cursor is placed after "anonexistingfilename.pdf". Which is less good :-(. Is it the intended behavior?

If you replace "anonexistingfilename.pdf" by the name of an existing file somewhere on your disk, like "README", then the parameter "~/" is totally ignored and a random README file is automatically selected. This is plain wrong in my use case: I use `read-file-name' to prompt the user for a place where to save an email attachment.

Improve docstrings in accordance with checkdoc

Many of the docstrings in flx.el and flx-ido.el at the moment do no comply to the established Emacs standards (M-x checkdoc) - it'd be great if they did.

I'd have updated them myself, but it's probably a better idea for @lewang to update them, since as the author he's capable to write the most precise descriptions.

navigating directory trees doesn't work consistently

From Oscar:

While navigating directory trees with find-file, at certain point no
candidates where listed as soon as any string was entered. With no
input, all candidates were shown. I was unable to replicate the problem.

Melpa version fails to build

Hello,

The current melpa version fails with the following error:

In flx-ido-cache:
flx-ido.el:160:13:Warning: reference to free variable `ido-cur-item'
flx-ido.el:213:1:Error: End of file during parsing

Is this some conflict with other package I may have?

Thanks

Possible bug in the matching algorithm

Given those two files:

~/projects/clojure-mode/clojure-mode.el
~/projects/prelude/core/prelude-mode.el

and the search text pre-mode, the first file gets selected by flx, although I think it should be the second one.

screen shot 2013-07-23 at 2 45 16 pm

corner cases confuse matcher

Matching "lllllll" against "~/foo/bar/blah.elllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll" takes a long time.

breaks after using calc

To reproduce problem:

M-x plp
[auto-completes to package-list-packages]
C-x * *
[open calc]
[input something]
M-x plp
[completes to pr-help]

If I don't input anything in the calc buffer, it still works.

Disable highlights

Hi,

Minor request: would it be possible to add an option to disable highlighting the matching characters? I realise the docs specify to disable ido-use-faces in order to enable highlights. It doesn't matter whether I set this to nil or t, I always get the highlighting.

Thanks,

Greg

Performance issues

As a noted on the reddit thread yesterday I've noticed some serious performance issues with flx (which apart from those issues is a terrific improvement over ido's flex matching). Here's the steps to reproduce them:

  1. Enable flex
  2. Install Projectile
  3. Invoke M-x projectile-find-file in a project with the size of https://github.com/bbatsov/rubocop

Start typing :-)

On my fairly modern Sandy Bridge quad-core core i7 processor there is a pretty noticeable lag on each keystoke. With flx disabled this works extremely fast.

I'm pretty sure the problem is caused not by the number of the items in the list (just about 250), but by the fact each item has many words in it. Here's an example:

spec/rubocop/cops/style/single_line_methods_spec.rb
spec/rubocop/cops/style/space_after_colon_spec.rb
spec/rubocop/cops/style/space_after_comma_spec.rb
spec/rubocop/cops/style/space_after_control_keyword_spec.rb
spec/rubocop/cops/style/space_after_semicolon_spec.rb
spec/rubocop/cops/style/space_around_braces_spec.rb
spec/rubocop/cops/style/space_around_equals_in_default_parameter_spec.rb
spec/rubocop/cops/style/space_around_operators_spec.rb

I'm using Emacs 24.3 on OSX Mountain Lion.

P.S. This was my email address indeed :-)

Some questionable rankings of various matches

Hi, I just tried out flx and flx-ido a few days ago. I'm happy to hear that the fontification of flex matches I did in ido-hacks inspired you.

Some of the match rankings don't seem optimal in my use and I wanted to run a few examples by you just to confirm that overall you think the current rankings are best.

(completing-read "" '(".stumpwmrc" ".stump/")  nil nil ".stump")

I'd expect .stump/ to win. I think this is the most important of the examples, since I think exact matches on directory names should match without a /.

Perhaps the number of characters in a candidate that don't match should be counted against it? I'm not sure.

(completing-read "" '("amusic" "texinfo-all-menus-update") nil nil "amu")

I'd expect amusic to win. I think you should prioritize prefix matches a bit more over first letter matches, but this one is a bit more subjective, and perhaps my use hasn't been diverse enough to recognize the benefits of the current settings. What are some examples of things you complete where you really want prefix to lose to first letter matches?

(completing-read "" '("*Group*" "*Customize Group: Flx*") nil nil "group")

I'd expect Group to win here. I think matches near the beginning should be preferred, if they aren't already, and perhaps omitting punctuation shouldn't count against a match.

Love what you've done and I look forward to using it more!

ALL CAPS candidates are given priority

  1. Launch fresh Emacs.
  2. Press C-x b, it shows the list of "virtual" buffers, aka files from recentf.
  3. Type cp.

Here's what I see:

Buffer: cp{COPYING | company-pkg.el | company-pysmell.el | ... | cperl-mode.el | main.cpp | Capfile | company.el

I don't think that COPYING should be at the front. Since the match is non-consecutive, it should score less than matching each letter at the beginning of a word.

In a similar example, for ra, README gets prioritized over range_answer.jst.ejs and Rakefile.

Performance Question

Hi Le,

I have a question regarding perf. I am using flx through projectile on my projects files (~8k). When searching for something which contains many matches initially, flx will lock up for ~1s before it narrows to a point where it can display results.

What I am curious about is if I then backspace to nothing, and type in the same word, performance is smooth as silk. But if I dismiss flx and invoke it again, I see the same lock up. Is there anything I can do to cache whatever calculations flx is doing the first time through?

Even with that, flx is so much better then the alternatives I will live with it :)

Killing buffer fails, pegs CPU, eats memory

Start emacs -Q and eval this code in scratch :

(ido-mode)
(setq ido-enable-flex-matching t)
(require 'flx-ido)
(flx-ido-mode 1)

(get-buffer-create "foo-1")
(get-buffer-create "foo-2")
(get-buffer-create "foo-3")
  • Now press C-x b for switching buffers.
  • Type foo and the list is reduced to the foo-buffers.
  • Press C-k for killing the buffer at the front of the list. The list remains the same (although the buffer was killed.)
  • Press C-s several times for cycling the list. When the "killed" buffer comes again to the front of the list, Emacs is using 100% CPU and eating memory at a fast pace.
  • C-g returns control to the user.

loss of functionality with version flx-ido-20140630.2152

Upon upgrading to the version 20140630.2152, I notice significant loss if functionality with the flx-ido package. For instance, where

M-x R

would normally highlight an ess-R process as top match, now I get a strange selection of options (see attached image), none particularly related with the search query. This forces me to validate my query by typing C-j instead of a plain RET.

mx-r

Interestingly enough, the same set of matches seems to pop up if I call for, say

M-x S

suggesting the awkward behaviour might be triggered by feeding certain single-character strings (but not any) to the matching engine.

Doesn't update buffer list after `ido-kill-buffer-at-head`

With ido-mode enabled for buffers, pressing C-k whilst in the buffer list will kill a buffer and remove it from the list.

With flx-ido enabled, the buffer is still killed, but it's still part of the list. On the next invocation, the buffer is no longer there (as expected).

Is it possible to make it so that killing a buffer from inside the list removes it from that list?

Top choice should be what I use most often

Hello,

Your plugin works nicely! Nice job.

I do miss something when using it tho: suggest what I use more often as first choice. In plain ido/smex, when I start typing "ma" it always suggest magit-status as this is what I use 90% of the time.

Flx does the correct fuzzy matching and gives me mm-annotationp... which is unfortunately not what I want :)

Any idea to get the best of both worlds?

C-SPC filtering is broken

Hi,

Sorry for a second bug report.

Using ido with flx, it seems that C-SPC filtering is broken. If I narrow down a candidate set and then hit C-SPC, I expect to be able to continue filtering the filtered candidates. Instead, this seems to start a new filter from scratch. Also, after pressing C-SPC, C-s and C-r no longer work.

Let me know if you need any further info.

Thanks,

-Greg

(args-out-of-range 6 9) right after startup

Setting debug-on-error to t usually (but not always) makes this go away, so obtaining the backtrace takes some luck.

Debugger entered--Lisp error: (args-out-of-range 6 9)
  buffer-substring-no-properties(9 6)
  (if (boundp (quote prompt)) (buffer-substring-no-properties (+ (point-min) (length prompt)) (point)) ido-text)
  flx-ido-key-for-query()
  (gethash (flx-ido-key-for-query) flx-ido-narrowed-matches-hash)
  (not (gethash (flx-ido-key-for-query) flx-ido-narrowed-matches-hash))
  (and (equal "" query) (not (gethash (flx-ido-key-for-query) flx-ido-narrowed-matches-hash)))
  (if (and (equal "" query) (not (gethash (flx-ido-key-for-query) flx-ido-narrowed-matches-hash))) (progn (setq items (nreverse (ido-delete-runs items))) (flx-ido-cache items)))
  flx-ido-match("" (#("agreement_mailer_test.rb" 0 24 (face ido-virtual)) ...))
  (setq ad-return-value (flx-ido-match ido-text items))
  (if (and flx-ido-use ido-enable-flex-matching) (setq ad-return-value (flx-ido-match ido-text items)) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function items do-full))))
  (let (ad-return-value) (if (and flx-ido-use ido-enable-flex-matching) (setq ad-return-value (flx-ido-match ido-text items)) (setq ad-return-value (with-no-warnings (funcall ad--addoit-function items do-full)))) ad-return-value)
  ad-Advice-ido-set-matches-1(#[(items &optional do-full) "��\n?\205\n

ido-next-match throws emacs into a frizzy.

Trying to cycle through results (ido-next-match) after a flx match is triggered with flx-ido throws emacs into a rapid memory leak and CPU utilization. Emacs quickly grabbed 7GB of memory and took 100% CPU utilization.

ido-find-file cache issues

Open Emacs, press C-x C-f.

  1. The initial dir is ~, type ~/vc/. The prompt continues to show the candidates for vc from ~, instead of entering ~/vc and showing items in there.
  2. Press RET once, nothing changes.
  3. Press RET again, the prompt now contains ~/vc/vc [No match].

Start from 1, type ~/vc/emacs-bzr, press RET twice, then it enters the directory. Now performing steps 1 and 2 will work as intended, until I want to open another directory, like ~/.emacs.d.

flx-ido-decorate leaks into buffer-file-name

After having ido hightlight the current matching string, buffer-file-name returns a propertized string. This makes for some odd highlighting when that string is used elsewhere.

#("/talks/webrebels/09-js-strings.js" 17 19 (face flx-highlight-face))

I see there is some attempt at undoing the decoration, but seems it doesn't hit all the cases. To trigger this case, I did not choose 09-js-strings.js, but something else.

Doesn't seem to work at all

I am new to Emacs, former Vim user, and I have no knowledge in Lisp/Elisp so my problem might be dumb.

I am running Emacs 24.3.1, I set the configuration as shown in the README but I don't see any difference than just setting ido-enable-flex-matching.

My complete init.el:

(package-initialize)

(require 'evil)
(evil-mode t)

;; --- GUI Settings
;; Enable line numbers
(global-linum-mode t)
;; Format line numbers
(setq linum-format "%4d \u2502 ")

(require 'ido)
(require 'flx-ido)
(setq ido-enable-flex-matching t)
(ido-mode t)
(flx-ido-mode t)

;; SMEX Key Bindings
;; See more: https://github.com/nonsequitur/smex/blob/master/README.markdown
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(package-archives (quote (("gnu" . "http://elpa.gnu.org/packages/") ("melpa" . "http://melpa.milkbox.net/packages/"))))
 '(uniquify-buffer-name-style (quote post-forward) nil (uniquify))
 '(custom-enabled-themes (quote (solarized-dark)))
 '(custom-safe-themes (quote ("8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default)))
 '(visible-bell t)
 '(menu-bar-mode nil)
 '(tool-bar-mode nil)
 '(inhibit-startup-echo-area-message nil)
 '(inhibit-startup-screen t)
 )
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 180 :width normal :foundry "default" :family "DejaVu Sans Mono")))))

Emacs and flx consumes all memory

Starting with

emacs -Q

eval this code in scratch:

(require 'flx-ido)
(ido-mode 1)
(setq ido-enable-flex-matching t)
(setq flx-ido-use t)

Now do C-x b for switching to another buffer. Once the list of candidates is shown, press C-s (which would usually cycle to the next candidate.) Emacs will start using 100% CPU and consuming memory at a very quick rate. C-g makes Emacs responsive again.

This is with GNU Emacs 24.3.50.5 (x86_64-unknown-linux-gnu, X toolkit) of 2013-04-06 on qcore

ido-next-match

ido-next-match seems not working as I expected when doing substring matching.

Here is an example: we have four files under a directory with names: "aa-bb, aa-cc, aa-dd, aa-dd-ee". After typing "aa" for substring matching, only "aa-bb, aa-cc, aa-dd" are the candidates which means that they could be picked by clicking "ctrl-s" (ido-next matching). "aa-dd-ee" will never be picked as a candidate. Is it by design?

Match results unstable when typing exact matches

This is a niggle I see when using projectile:

Examples: a project with multiple __init__.py files, or a project with patterns that result in many file names being equivalent (e.g. a bunch of {foo,bar,baz}/creator.rb) or common prefixes (helloworld.rb, helloworld_spec.rb)

While typing, I've noticed flx will, given two seemingly identically good matches, flap between them with every keystroke, even though it matches each of the problematic candidates seemingly equally.

It's hard to read match results with things flapping around, and in the asynchronous feedback loop of hands-eyes-mind it's easy to lose track of a match that flickers to the foremost, only to drop away after one more keypress already in progress.

On integrate flx with Helm

Hi Le Wang,

This is my high level idea of how we could use flx for Helm. If it is not applicable, then I guess we can leave this an open issue that hopefully be solved in the future.

My idea is that, if we enter a bunch of patterns, some of which can be normal Helm pattern, some can be fuzzy pattern, then we divide the narrowing process into two phases:

  • One is for normal Helm filtering. That is, we tried each pattern one by one; if one pattern results in empty set of candidates, then store that pattern and try the next one (without including the "failed" pattern). We filter until no more pattern and result in a set of candidates.
  • One is for flx filtering. That is, we apply flx on the output from the above phases and narrow down further. The result of this phase is the final set to be returned to user.

The key point is that flx is only applied when a pattern can result in no candidate.

Thanks.

uppercase entry produces lower case matches

Something is not right with flx when attempting to match uppercase letters. For example, if I'm visiting a buffer called mon.rb and I run ido-switch-buffer and then type M (uppercase), my minibuffer starts like this:

Buffer: M[essages*]
-> mon.rb
    *Messages*
    *Compile-Log*

(Yes, I'm using ido-vertical-mode.) Since I went to the effort of pressing Shift, there is no good reason for it to match mon.rb. Since we're fuzzy matching, I wouldn't mind if all the matches containing lowercase m characters appeared after all those containing uppercase M ... but for a lowercase match to appear first is definitely a bug. (And IMHO ideally it should be configurable whether fuzzy matching produces lowercase matches for uppercase searches.) In this case, if I press RET then it just stays in the current buffer, which is hardly a useful result.

The other bug in this situation is that the first line displays Buffer: M[essages*] which at a glance misleadingly suggests that the currently selected match is *Messages*.

FWIW I have ido-case-fold set to nil.

Typo on setup instructions

README.md says

(setq ido-enable-flex-matchint t
      flx-ido-use              t)

The variable ido-enable-flex-matching is mispelled (matchint -> matching).

Why does this beat that?

screen shot 2013-05-19 at 00 01 00

At least it breaks my expectation. If I wanted sane-defaults, I'd write sd. Actually selecting the defuns directory turns out to be more work than I was hoping for. Bug or feature? :)

Oh, and btw, thanks a lot for this package. On my machine it is very speedy. Smex is speedy, large projects are speedy. And I love the matching - for the most part at least. :)

Completely unusable with large candidate set

I was trying to use flx with projectile (which generates a list of candidates using git ls-files). It works well with small repositories, but it's completely unusable with linux.git.

Is the gc kicking in too often, or is something else going on? (I set gc-cons-threshold to 20M, like you suggested)

Thanks.

Newest version error

Debugger entered--Lisp error: (file-error "Cannot open load file" "flx-ido")
  require(flx-ido)
  eval-buffer(#<buffer  *load*-499653> nil "/Users/suyejun/.emacs.d/init-ido.el$
  load-with-code-conversion("/Users/suyejun/.emacs.d/init-ido.el" "/Users/suyej$
  require(init-ido)
  eval-buffer(#<buffer  *load*> nil "/Users/suyejun/.emacs.d/init.el" nil t)  ;$
  load-with-code-conversion("/Users/suyejun/.emacs.d/init.el" "/Users/suyejun/.$
  load("/Users/suyejun/.emacs.d/init" t t)
  #[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\20$
  command-line()
  normal-top-level()

My configuration is on https://github.com/goofansu/emacs.d/blob/master/init-ido.el.

Version 20130715.903 is ok.

Package `flx-ido` isn't found

I'm not sure if this is an error from MELPA's side. It works fine with Marmalade.

I can install flx but whenever I try to install flx-ido I get "Error during download request: Not Found".

Any idea as to why this might be happening?

flx-ido breaks smex recent-completion matching

flx's scoring seems to somehow ignore however smex prefers recent completions.

Example:

When using smex with regular ido, the following interaction would allow one to run replace-string several times, and then revert-buffer several times:

M-x replace-string
M-x r
M-x r
M-x r
M-x revert-buffer
M-x r
M-x r
M-x r

With flx, the single-letter attempt to complete matches against everything, so I get whatever is lexically first across all elisp symbols. In my case, rcirc is completed in all of the above M-x r

Reference to free variable flx-ido-mode

Hi

I'm using el-get for flx and flx-ido. It works fine.
But I will get the warning everytime I install a new package:

Compiling no file at Tue Jun 17 00:12:53 2014
flx/flx-ido.elc:Warning: reference to free variable `flx-ido-mode'

It doesn't effect the functionalities of flx though.

Alters the initial order of candidates for kill-buffer

Start Emacs with

emacs -Q

and eval this code in scratch

(require 'flx-ido)
(ido-mode 1)
(setq ido-enable-flex-matching t)
(setq flx-ido-use t)

Now do C-x k for executing kill-buffer. Usually, the first and default entry on the list of candidates would be the current buffer (scratch), but is Messages.

it will crash my emacs

emacs 24.2.1, here is my .emacs.d: https://github.com/redguardtoo/emacs.d, I install the flx.el and flx-ido.el into my ~/.emacs.d/site-lisp/flx/ and configure it as README said.

Then when I run smex by pressing "M-x", emacs hang and quit, I think the key issue is the matching algorithm is too slow. maybe you should start your match algorithm since the first three key press.

Add ability to disable matching algorithm

There are some cases (like when switching buffers) when I want to use ido's normal filtering mechanism (just filter the choices in order). However, even in those cases I would like to use flx's highlighting, so I don't want to disable flx altogether.

Is there a way to configure the matching algorithm on a per-use-case basis? Something like:

(setq flx-override-matching-algorithm
    '((ido-switch-buffer . nil))

Special buffers are given worse scores

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*.

Invoking ido-merge-work-directories leads to 'Wrong type argument: listp'

First, thanks a bunch for this, it's great!

After starting an ido-mode search for something, invoking ido-merge-work-directories causes an error and won't search outside of my current directory. Is anyone else running into this?

I'm starting with emacs -Q and then

(progn 
  (require 'ido)
  (ido-mode 1)
  (add-to-list 'load-path "~/.emacs.d/lewang-flx/")
  (require 'flx-ido)
  (setq debug-on-error t)
  (setq ido-enable-flex-matching t)
  (setq flx-ido-use nil))

C-x C-f'ing for something like jjjj or whatever string won't match causes an error. M-s is bound to ido-merge-work-directories for me, and I also have it set up to automatically do that after search fails in the current working directory.

I haven't had time to debug any further yet, but if it's only happening to me, I'll try updating my Emacs version and whatever else might help... OS X 10.7.5, GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.