Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix ac-prefix. #175

wants to merge 1 commit into


None yet
3 participants

monsanto commented Sep 22, 2012

I encountered three bugs in ac-prefix while working with my new ac-elisp source.

The first bug is that if you have two sources in succession, where the first source's prefix matches, and the second source's prefix is different from the first's, then the second source will be ignored.

The second bug is that if the last source doesn't match, no sources will be returned. This is because "point" will be set to nil, and the "finally" clause will return nil because of (and point ...) check.

The third bug is that ac-point will always be set to the last matched prefix's start. It makes more sense to set ac-point to the smallest possible value; then the range from ac-point to (point) will encompass the length of all possible prefixes.

Code review welcome!


m2ym commented Sep 25, 2012

The prefix must be shared with sources that returns same points with prefix property. So (1) is not a bug.


m2ym commented Sep 25, 2012

You can specify prefix prioerties by ordering the sources. In this case, you may swap the first source with the second source.


monsanto commented Sep 25, 2012

Well, I was ordering, but I couldn't get my source to work. That might just be a result of (2) and (3). If (1) is intentional, I can revert the "fix" to that problem.


m2ym commented Sep 26, 2012

Here, we can also consider how and what prefix should be. The idea will be used in 2.x development.


memeplex commented Aug 12, 2014

Please take a look at this very simple solution:


It's just a matter of semantics: the prefix must be shared, but this doesn't imply that the prefix parser has to be shared.


m2ym commented Jan 17, 2015

Merged #348

@m2ym m2ym closed this Jan 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment