Subject: Re: bug#16334: 24.3.50; company-capf eats the first char in IELM filename completions

From: Dmitry Gutov <[email-masked]>
Date: Sun, 05 Jan 2014 06:20:58 +0400

On 04.01.2014 09:00, Stefan Monnier wrote:
> That's normal.  Try C-x C-f / TAB TAB and you'll see that the leading /
> is also "missing" in the *Completions* buffer.
 > ...
 > Indeed, Company can't handle all completion-at-point-functions so far
 > because it assumes all completion tables are "simple", unlike
 > for example filename completion.
 >
 > You can know how many chars are "missing" by calling
 > `completion-boundaries'.

Thanks, I didn't know about that.

 > Ideally, Company should be extended to handle this feature,

It's not hard to do, but are you sure it would be a good addition to the 
API? "Completion prefix" and "completion bounds" are easy to mix up, and 
from what I see in various completion mechanisms, the non-simple 
completion tables more often need to look at the whole buffer before 
point, or at least a large chunk of it.

`completion-file-name-table' is more of an exception, I think. But if it 
was only passed the segment of STRING after the last path separator, it 
could still look behind it in the buffer and see the full path.

 > but for now that can be handled in company-capf.

Ok, I'll try.